From 150de39b2b9d29dc8e07564331446580d75ac92f Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 14 Nov 2017 22:11:35 +0100 Subject: [PATCH] Move sign addition where it makes more sense --- src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c index b742c3a4..5fc48edb 100644 --- a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c +++ b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c @@ -1956,9 +1956,10 @@ ge25519_from_uniform(unsigned char s[32], const unsigned char r[32]) fe25519_invert(x_plus_one_inv, x_plus_one); fe25519_mul(yed, x_minus_one, x_plus_one_inv); fe25519_tobytes(s, yed); - s[31] |= x_sign; } + /* recover x */ + s[31] |= x_sign; ge25519_frombytes(&p3, s); /* multiply by the cofactor */