From c7344bc0a61cc073607843d3173f3f619c482235 Mon Sep 17 00:00:00 2001 From: jotabulacios Date: Mon, 4 Nov 2024 11:30:25 -0300 Subject: [PATCH] removed . clone()s --- .../curves/bls12_377/field_extension.rs | 2 +- .../short_weierstrass/curves/bls12_377/pairing.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs b/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs index 82b9b029d..c5023ac44 100644 --- a/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs +++ b/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs @@ -12,7 +12,7 @@ use crate::traits::ByteConversion; use crate::unsigned_integer::element::U384; pub const BLS12377_PRIME_FIELD_ORDER: U384 = U384::from_hex_unchecked("1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001"); -pub const FP2_RESIDUE: FieldElement =FieldElement::from_hex_unchecked("1AE3A4617C510EAC63B05C06CA1493B1A22D9F300F5138F1EF3622FBA094800170B5D44300000008508BFFFFFFFFFFC"); +pub const FP2_RESIDUE: FieldElement =FieldElement::from_hex_unchecked("0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508bffffffffffc"); // FPBLS12377 #[derive(Clone, Debug)] diff --git a/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/pairing.rs b/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/pairing.rs index 5e1ceeae6..572fffcfc 100644 --- a/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/pairing.rs +++ b/math/src/elliptic_curve/short_weierstrass/curves/bls12_377/pairing.rs @@ -256,21 +256,21 @@ pub fn cyclotomic_square(a: &Fp12E) -> Fp12E { // r00 = 3v00 - 2b0 let mut r00 = &v0.value()[0] - b0; r00 = r00.double(); - r00 += v0.value()[0].clone(); + r00 = &v0.value()[0] + r00; // r01 = 3v10 -2b1 let mut r01 = &v1.value()[0] - b1; r01 = r01.double(); - r01 += v1.value()[0].clone(); + r01 = &v1.value()[0] + r01; // r11 = 3v01 - 2b4 let mut r11 = &v0.value()[1] + b4; r11 = r11.double(); - r11 += v0.value()[1].clone(); + r11 = &v0.value()[1] + r11; // r12 = 3v11 - 2b5 let mut r12 = &v1.value()[1] + b5; r12 = r12.double(); - r12 += v1.value()[1].clone(); + r12 = &v1.value()[1] + r12; // r12 = 3v11 - 2b5 let v21 = mul_fp2_by_nonresidue(&v2.value()[1]); @@ -281,7 +281,7 @@ pub fn cyclotomic_square(a: &Fp12E) -> Fp12E { // 3 * ( u) * v20 - 2b3 let mut r02 = &v2.value()[0] - b2; r02 = r02.double(); - r02 += v2.value()[0].clone(); + r02 = &v2.value()[0] + r02; Fp12E::new([Fp6E::new([r00, r01, r02]), Fp6E::new([r10, r11, r12])]) }