Constant-time field square root

WARNING: THIS IS NOT FULLY CONSTANT TIME YET!

This will be fixed once we migrate to the jubjub and bls12_381 crates.
This commit is contained in:
Jack Grigg
2019-05-15 10:35:14 +01:00
parent 40749da9a7
commit 3d2acf48ce
14 changed files with 223 additions and 345 deletions

View File

@@ -1025,8 +1025,9 @@ mod test {
let x = Fr::random(rng);
let s: bool = rng.next_u32() % 2 != 0;
if let Some(p) = montgomery::Point::<Bls12, _>::get_for_x(x, s, params) {
break p;
let p = montgomery::Point::<Bls12, _>::get_for_x(x, s, params);
if p.is_some().into() {
break p.unwrap();
}
};
@@ -1034,8 +1035,9 @@ mod test {
let x = Fr::random(rng);
let s: bool = rng.next_u32() % 2 != 0;
if let Some(p) = montgomery::Point::<Bls12, _>::get_for_x(x, s, params) {
break p;
let p = montgomery::Point::<Bls12, _>::get_for_x(x, s, params);
if p.is_some().into() {
break p.unwrap();
}
};