Make Field::double take &self and return Self

This commit is contained in:
Jack Grigg
2019-12-12 22:59:18 +00:00
parent 91c32f1c7c
commit 9dac748224
23 changed files with 87 additions and 111 deletions

View File

@@ -211,12 +211,8 @@ fn random_negation_tests<F: Field, R: RngCore>(rng: &mut R) {
fn random_doubling_tests<F: Field, R: RngCore>(rng: &mut R) {
for _ in 0..10000 {
let mut a = F::random(rng);
let mut b = a;
a.add_assign(&b);
b.double();
assert_eq!(a, b);
let a = F::random(rng);
assert_eq!(a + a, a.double());
}
}