diff options
author | teor <teor2345@gmail.com> | 2014-09-28 20:44:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-28 20:44:00 -0400 |
commit | b7eab94a9078b18593a0d0d378d0ccdc07798178 (patch) | |
tree | 004bc938276e849a576a0333c576fdf5cb4071ba /src/ext/ed25519 | |
parent | 6129ff320e6510a453922dba01163824923bc782 (diff) | |
download | tor-b7eab94a9078b18593a0d0d378d0ccdc07798178.tar.gz tor-b7eab94a9078b18593a0d0d378d0ccdc07798178.zip |
Stop ed25519 8-bit signed left shift overflowing
Standardise usage in ge_scalarmult_base.c for 1 new fix.
Diffstat (limited to 'src/ext/ed25519')
-rw-r--r-- | src/ext/ed25519/ref10/ge_scalarmult_base.c | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |