diff --git a/src/libsodium/crypto_sign/ed25519/ref10/keypair.c b/src/libsodium/crypto_sign/ed25519/ref10/keypair.c index 4b9bf0dc..e8e40150 100644 --- a/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +++ b/src/libsodium/crypto_sign/ed25519/ref10/keypair.c @@ -15,11 +15,7 @@ crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk, { ge25519_p3 A; -#ifdef ED25519_NONDETERMINISTIC - memmove(sk, seed, 32); -#else crypto_hash_sha512(sk, seed, 32); -#endif sk[0] &= 248; sk[31] &= 127; sk[31] |= 64; @@ -76,11 +72,7 @@ crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk, { unsigned char h[crypto_hash_sha512_BYTES]; -#ifdef ED25519_NONDETERMINISTIC - memcpy(h, ed25519_sk, 32); -#else crypto_hash_sha512(h, ed25519_sk, 32); -#endif h[0] &= 248; h[31] &= 127; h[31] |= 64; diff --git a/test/default/ed25519_convert.c b/test/default/ed25519_convert.c index a384c31e..d067547e 100644 --- a/test/default/ed25519_convert.c +++ b/test/default/ed25519_convert.c @@ -18,16 +18,10 @@ main(void) unsigned char curve25519_sk[crypto_scalarmult_curve25519_BYTES]; char curve25519_pk_hex[crypto_scalarmult_curve25519_BYTES * 2 + 1]; char curve25519_sk_hex[crypto_scalarmult_curve25519_BYTES * 2 + 1]; - unsigned char hseed[crypto_hash_sha512_BYTES]; unsigned int i; assert(crypto_sign_ed25519_SEEDBYTES <= crypto_hash_sha512_BYTES); -#ifdef ED25519_NONDETERMINISTIC - crypto_hash_sha512(hseed, keypair_seed, crypto_sign_ed25519_SEEDBYTES); -#else - memcpy(hseed, keypair_seed, crypto_sign_ed25519_SEEDBYTES); -#endif - crypto_sign_ed25519_seed_keypair(ed25519_pk, ed25519_skpk, hseed); + crypto_sign_ed25519_seed_keypair(ed25519_pk, ed25519_skpk, keypair_seed); if (crypto_sign_ed25519_pk_to_curve25519(curve25519_pk, ed25519_pk) != 0) { printf("conversion failed\n");