From b7eab94a9078b18593a0d0d378d0ccdc07798178 Mon Sep 17 00:00:00 2001 From: teor Date: Sun, 28 Sep 2014 20:44:00 -0400 Subject: 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(-) (limited to 'src/ext') diff --git a/src/ext/ed25519/ref10/ge_scalarmult_base.c b/src/ext/ed25519/ref10/ge_scalarmult_base.c index 3ede0ad177..5292f83221 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)); -- cgit v1.2.3-54-g00ecf