Browse Source

bls12_381: Fix ambiguous operation clippy warnings

master
Jack Grigg 5 years ago
parent
commit
687fff5ecf
  1. 4
      bls12_381/src/g1.rs
  2. 4
      bls12_381/src/g2.rs
  3. 12
      bls12_381/src/pairings.rs

4
bls12_381/src/g1.rs

@ -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()));

4
bls12_381/src/g2.rs

@ -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()));

12
bls12_381/src/pairings.rs

@ -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 {

Loading…
Cancel
Save