Better inversion in tests (#30)

This commit is contained in:
Pratyush Mishra
2020-12-15 21:17:28 -08:00
committed by GitHub
parent 9654fb6513
commit 72b04dbacb

View File

@@ -79,10 +79,10 @@ fn random_inversion_tests<F: Field, R: Rng>(rng: &mut R) {
for _ in 0..ITERATIONS {
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());
});
}
}