Added error condition to curve25519_gen