Less silly key gen. Simplified, tests removed.