diff --git a/constantine.nimble b/constantine.nimble index 99eb565..bc42e14 100644 --- a/constantine.nimble +++ b/constantine.nimble @@ -48,11 +48,11 @@ const testDesc: seq[tuple[path: string, useGMP: bool]] = @[ ("tests/t_finite_fields_double_width.nim", false), # Towers of extension fields # ---------------------------------------------------------- - # ("tests/t_fp2.nim", false), + ("tests/t_fp2.nim", false), ("tests/t_fp2_sqrt.nim", false), - # ("tests/t_fp6_bn254_snarks.nim", false), - # ("tests/t_fp6_bls12_377.nim", false), - # ("tests/t_fp6_bls12_381.nim", false), + ("tests/t_fp6_bn254_snarks.nim", false), + ("tests/t_fp6_bls12_377.nim", false), + ("tests/t_fp6_bls12_381.nim", false), ("tests/t_fp6_bw6_761.nim", false), ("tests/t_fp12_bn254_snarks.nim", false), ("tests/t_fp12_bls12_377.nim", false), @@ -60,8 +60,8 @@ const testDesc: seq[tuple[path: string, useGMP: bool]] = @[ ("tests/t_fp12_exponentiation.nim", false), ("tests/t_fp12_anti_regression.nim", false), - # ("tests/t_fp4_frobenius.nim", false), - # ("tests/t_fp6_frobenius.nim", false), + ("tests/t_fp4_frobenius.nim", false), + ("tests/t_fp6_frobenius.nim", false), ("tests/t_fp12_frobenius.nim", false), # Elliptic curve arithmetic G1 # ---------------------------------------------------------- diff --git a/constantine/tower_field_extensions/cubic_extensions.nim b/constantine/tower_field_extensions/cubic_extensions.nim index 5796260..091fa5b 100644 --- a/constantine/tower_field_extensions/cubic_extensions.nim +++ b/constantine/tower_field_extensions/cubic_extensions.nim @@ -183,7 +183,8 @@ func inv*(r: var CubicExt, a: CubicExt) = v3 += r.c1 v3 += r.c2 - v3.inv(v3) + let t = v3 # TODO, support aliasing in all primitives + v3.inv(t) # (a0 + a1 v + a2 v²)^-1 = (A + B v + C v²) / F r.c0 *= v3