Browse Source

Better inversion in tests (#30)

fq2_neg_nonresidue
Pratyush Mishra 4 years ago
committed by GitHub
parent
commit
72b04dbacb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      curve-tests/src/fields.rs

+ 4
- 4
curve-tests/src/fields.rs

@ -79,10 +79,10 @@ fn random_inversion_tests(rng: &mut R) {
for _ in 0..ITERATIONS { for _ in 0..ITERATIONS {
let mut a = F::rand(rng); let mut a = F::rand(rng);
let b = a.inverse().unwrap(); // probablistically nonzero
a *= &b;
assert_eq!(a, F::one());
let b = a.inverse().map(|b| {
a *= &b;
assert_eq!(a, F::one());
});
} }
} }

Loading…
Cancel
Save