From f78355277392d6c09923f77f6b6c1ff2ce53952b Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 12 Oct 2017 13:14:25 +0200 Subject: [PATCH] Just use constants instead of macros In this context, they are actually less confusing. --- src/libsodium/crypto_sign/ed25519/ref10/keypair.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libsodium/crypto_sign/ed25519/ref10/keypair.c b/src/libsodium/crypto_sign/ed25519/ref10/keypair.c index 47dfd24c..b62a43e1 100644 --- a/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +++ b/src/libsodium/crypto_sign/ed25519/ref10/keypair.c @@ -27,8 +27,8 @@ crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk, ge_scalarmult_base(&A, sk); ge_p3_tobytes(pk, &A); - memmove(sk, seed, crypto_sign_ed25519_SECRETKEYBYTES); - memmove(sk + 32, pk, crypto_sign_ed25519_PUBLICKEYBYTES); + memmove(sk, seed, 32); + memmove(sk + 32, pk, 32); return 0; } @@ -81,11 +81,9 @@ crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk, unsigned char h[crypto_hash_sha512_BYTES]; #ifdef ED25519_NONDETERMINISTIC - memcpy(h, ed25519_sk, crypto_sign_ed25519_SECRETKEYBYTES); + memcpy(h, ed25519_sk, 32); #else - crypto_hash_sha512(h, ed25519_sk, - crypto_sign_ed25519_SECRETKEYBYTES - - crypto_sign_ed25519_PUBLICKEYBYTES); + crypto_hash_sha512(h, ed25519_sk, 32); #endif h[0] &= 248; h[31] &= 127;