diff --git a/precompiles/Playground.yul b/precompiles/Playground.yul index 6d4f9482..417d390c 100644 --- a/precompiles/Playground.yul +++ b/precompiles/Playground.yul @@ -535,7 +535,7 @@ object "Playground" { let tmp8, tmp9 := fp2Sub(a00, a01, a10, a11) tmp0, tmp1 := fp2Add(tmp8, tmp9, a20, a21) - let tmp10, tmp11 := fp2Mul(a00, a01, a20, a21) + let tmp10, tmp11 := fp2Mul(a10, a11, a20, a21) tmp2, tmp3 := fp2Add(tmp10, tmp11, tmp10, tmp11) tmp0, tmp1 := fp2Mul(tmp0, tmp1, tmp0, tmp1) diff --git a/scripts/fp6.py b/scripts/fp6.py index 65fd63c4..bcd0870e 100644 --- a/scripts/fp6.py +++ b/scripts/fp6.py @@ -36,7 +36,7 @@ def square(a_00, a_01, a_10, a_11, a_20, a_21): c2 = fp2.sub(*c4, *c5) c3 = fp2.exp(a_00, a_01, 2) c4 = fp2.add(*fp2.sub(a_00, a_01, a_10, a_11), a_20, a_21) - c5 = fp2.scalar_mul(*fp2.mul(a_00, a_01, a_20, a_21), monty.TWO) + c5 = fp2.scalar_mul(*fp2.mul(a_10, a_11, a_20, a_21), monty.TWO) c4 = fp2.exp(*c4, 2) c0 = fp2.add(*fp2.mul_by_xi(*c5), *c3) c2 = fp2.sub(*fp2.add(*fp2.add(*c2, *c4), *c5), *c3) @@ -125,14 +125,14 @@ def main(): # INVERSE fp6_inversed = inv(*fp2_a_0, *fp2_a_1, *fp2_a_2) - fp6_zero = mul(*fp2_a_0, *fp2_a_1, *fp2_a_2, *fp6_inversed) - - assert(fp6_zero[0] == monty.ONE) - assert(fp6_zero[1] == 0) - assert(fp6_zero[2] == 0) - assert(fp6_zero[3] == 0) - assert(fp6_zero[4] == 0) - assert(fp6_zero[5] == 0) + fp6_one = mul(*fp2_a_0, *fp2_a_1, *fp2_a_2, *fp6_inversed) + + assert(fp6_one[0] == monty.ONE) + assert(fp6_one[1] == 0) + assert(fp6_one[2] == 0) + assert(fp6_one[3] == 0) + assert(fp6_one[4] == 0) + assert(fp6_one[5] == 0) if __name__ == '__main__': main()