commit b7eab94a9078b18593a0d0d378d0ccdc07798178 Author: teor teor2345@gmail.com Date: Sun Sep 28 20:44:00 2014 -0400
Stop ed25519 8-bit signed left shift overflowing
Standardise usage in ge_scalarmult_base.c for 1 new fix. --- src/ext/ed25519/ref10/ge_scalarmult_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ext/ed25519/ref10/ge_scalarmult_base.c b/src/ext/ed25519/ref10/ge_scalarmult_base.c index 3ede0ad..5292f83 100644 --- a/src/ext/ed25519/ref10/ge_scalarmult_base.c +++ b/src/ext/ed25519/ref10/ge_scalarmult_base.c @@ -39,7 +39,7 @@ static void select(ge_precomp *t,int pos,signed char b) { ge_precomp minust; unsigned char bnegative = negative(b); - unsigned char babs = b - (((-bnegative) & b) << 1); + unsigned char babs = b - SHL8( (-bnegative) & (unsigned char)b, 1);
ge_precomp_0(t); cmov(t,&base[pos][0],equal(babs,1));
tor-commits@lists.torproject.org