The key generation algorithm for Namecoin and Bitcoin is exactly the same (i.e. the algorithm that produces the full public and private keypair). It is only the hashing algorithm that is different (i.e. the algorithm that produces a short Bitcoin/Namecoin address from the long public key).