mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Fix an attempted overflow on absolute value computation for radix-256 tables.
Found by the fuzzer in 4f5d2d4.
This commit is contained in:
parent
ca1f730790
commit
1f8a19a753
1 changed files with 2 additions and 2 deletions
|
|
@ -53,8 +53,8 @@ where
|
|||
debug_assert!(x as i16 <= $size as i16); // XXX We have to convert to i16s here for the radix-256 case.. this is wrong.
|
||||
|
||||
// Compute xabs = |x|
|
||||
let xmask = x >> 7;
|
||||
let xabs = (x + xmask) ^ xmask;
|
||||
let xmask = x as i16 >> 7;
|
||||
let xabs = (x as i16 + xmask) ^ xmask;
|
||||
|
||||
// Set t = 0 * P = identity
|
||||
let mut t = T::identity();
|
||||
|
|
|
|||
Loading…
Reference in a new issue