diff --git a/src/bn256/fq2.rs b/src/bn256/fq2.rs index afd6320c..661c8c00 100644 --- a/src/bn256/fq2.rs +++ b/src/bn256/fq2.rs @@ -199,11 +199,12 @@ impl Fq2 { } pub fn mul_assign(&mut self, other: &Self) { - let mut t1 = self.c0 * other.c0; let mut t0 = self.c0 + self.c1; + let mut t1 = self.c0 * other.c0; let t2 = self.c1 * other.c1; - self.c1 = other.c0 + other.c1; + self.c0 = t1 - t2; + self.c1 = other.c0 + other.c1; t1 += t2; t0 *= self.c1; self.c1 = t0 - t1; diff --git a/src/bn256/fq6.rs b/src/bn256/fq6.rs index 75924055..8fc46578 100644 --- a/src/bn256/fq6.rs +++ b/src/bn256/fq6.rs @@ -508,7 +508,7 @@ pub const FROBENIUS_COEFF_FQ6_C1: [Fq2; 6] = [ ]; pub const FROBENIUS_COEFF_FQ6_C2: [Fq2; 6] = [ - // Fq2(u + 1)**(((2q^0) - 2) / 3) + // Fq2(u + 9)**(((2q^0) - 2) / 3) Fq2 { c0: Fq([ 0xd35d438dc58f0d9d, @@ -518,7 +518,7 @@ pub const FROBENIUS_COEFF_FQ6_C2: [Fq2; 6] = [ ]), c1: Fq([0x0, 0x0, 0x0, 0x0]), }, - // Fq2(u + 1)**(((2q^1) - 2) / 3) + // Fq2(u + 9)**(((2q^1) - 2) / 3) Fq2 { c0: Fq([ 0x7361d77f843abe92, @@ -533,7 +533,7 @@ pub const FROBENIUS_COEFF_FQ6_C2: [Fq2; 6] = [ 0x24830a9d3171f0fd, ]), }, - // Fq2(u + 1)**(((2q^2) - 2) / 3) + // Fq2(u + 9)**(((2q^2) - 2) / 3) Fq2 { c0: Fq([ 0x71930c11d782e155, @@ -543,7 +543,7 @@ pub const FROBENIUS_COEFF_FQ6_C2: [Fq2; 6] = [ ]), c1: Fq([0x0, 0x0, 0x0, 0x0]), }, - // Fq2(u + 1)**(((2q^3) - 2) / 3) + // Fq2(u + 9)**(((2q^3) - 2) / 3) Fq2 { c0: Fq([ 0x448a93a57b6762df, @@ -558,7 +558,7 @@ pub const FROBENIUS_COEFF_FQ6_C2: [Fq2; 6] = [ 0x170c812b84dda0b2, ]), }, - // Fq2(u + 1)**(((2q^4) - 2) / 3) + // Fq2(u + 9)**(((2q^4) - 2) / 3) Fq2 { c0: Fq([ 0x3350c88e13e80b9c, @@ -568,7 +568,7 @@ pub const FROBENIUS_COEFF_FQ6_C2: [Fq2; 6] = [ ]), c1: Fq([0x0, 0x0, 0x0, 0x0]), }, - // Fq2(u + 1)**(((2q^5) - 2) / 3) + // Fq2(u + 9)**(((2q^5) - 2) / 3) Fq2 { c0: Fq([ 0x843420f1d8dadbd6,