mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Use conditional_negate in select_precomputed_point
This commit is contained in:
parent
8a1c13ef49
commit
dc5621f527
1 changed files with 2 additions and 2 deletions
|
|
@ -87,6 +87,7 @@ use field::FieldElement;
|
||||||
use scalar::Scalar;
|
use scalar::Scalar;
|
||||||
use util::bytes_equal_ct;
|
use util::bytes_equal_ct;
|
||||||
use util::CTAssignable;
|
use util::CTAssignable;
|
||||||
|
use util::CTNegateable;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Compressed points
|
// Compressed points
|
||||||
|
|
@ -734,9 +735,8 @@ fn select_precomputed_point<T>(x: i8, points: &[T; 8]) -> T
|
||||||
}
|
}
|
||||||
// Now t == |x| * P.
|
// Now t == |x| * P.
|
||||||
|
|
||||||
let minus_t = -(&t);
|
|
||||||
let neg_mask = (xmask & 1) as u8;
|
let neg_mask = (xmask & 1) as u8;
|
||||||
t.conditional_assign(&minus_t, neg_mask);
|
t.conditional_negate(neg_mask);
|
||||||
// Now t == x * P.
|
// Now t == x * P.
|
||||||
|
|
||||||
t
|
t
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue