bls12_381: Fix ambiguous operation clippy warnings

This commit is contained in:
Jack Grigg 2020-01-14 20:59:25 -05:00
parent e15fea2757
commit 687fff5ecf
3 changed files with 10 additions and 10 deletions

View File

@ -1046,7 +1046,7 @@ fn test_projective_addition() {
let mut d = G1Projective::generator();
for _ in 0..5 {
d = d + G1Projective::generator();
d += G1Projective::generator();
}
assert!(!bool::from(c.is_identity()));
assert!(bool::from(c.is_on_curve()));
@ -1167,7 +1167,7 @@ fn test_mixed_addition() {
let mut d = G1Projective::generator();
for _ in 0..5 {
d = d + G1Affine::generator();
d += G1Affine::generator();
}
assert!(!bool::from(c.is_identity()));
assert!(bool::from(c.is_on_curve()));

View File

@ -1208,7 +1208,7 @@ fn test_projective_addition() {
let mut d = G2Projective::generator();
for _ in 0..5 {
d = d + G2Projective::generator();
d += G2Projective::generator();
}
assert!(!bool::from(c.is_identity()));
assert!(bool::from(c.is_on_curve()));
@ -1372,7 +1372,7 @@ fn test_mixed_addition() {
let mut d = G2Projective::generator();
for _ in 0..5 {
d = d + G2Affine::generator();
d += G2Affine::generator();
}
assert!(!bool::from(c.is_identity()));
assert!(bool::from(c.is_on_curve()));

View File

@ -57,28 +57,28 @@ impl MillerLoopResult {
// For A
z0 = t0 - z0;
z0 += z0 + t0;
z0 = z0 + z0 + t0;
z1 = t1 + z1;
z1 += z1 + t1;
z1 = z1 + z1 + t1;
let (mut t0, t1) = fp4_square(z2, z3);
let (t2, t3) = fp4_square(z4, z5);
// For C
z4 = t0 - z4;
z4 += z4 + t0;
z4 = z4 + z4 + t0;
z5 = t1 + z5;
z5 += z5 + t1;
z5 = z5 + z5 + t1;
// For B
t0 = t3.mul_by_nonresidue();
z2 = t0 + z2;
z2 += z2 + t0;
z2 = z2 + z2 + t0;
z3 = t2 - z3;
z3 += z3 + t2;
z3 = z3 + z3 + t2;
Fp12 {
c0: Fp6 {