Public key generation working properly