Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fuzzing] Implement a Fp12 serializer to canonical serialization #454

Open
mratsim opened this issue Aug 7, 2024 · 1 comment
Open

[Fuzzing] Implement a Fp12 serializer to canonical serialization #454

mratsim opened this issue Aug 7, 2024 · 1 comment

Comments

@mratsim
Copy link
Owner

mratsim commented Aug 7, 2024

To fix https://github.com/guidovranken/el-fuzzers/issues/7 we need a serializer to canonical representation similar to BLST: supranational/blst#101.

This would allow merging into Geth fuzzer as well.

Note we have a towering switcher:

func asFpk*[Fpkdiv6, Fpk](
a: var Fpk,
g0, g1: Fpkdiv6,
g: G2345[Fpkdiv6]) =
## Convert from a sextic extension to the Karabina g₂₃₄₅
## representation.
when a is CubicExt:
when a.c0 is QuadraticExt:
a.c0.c0 = g0
a.c0.c1 = g1
a.c1.c0 = g.g2
a.c1.c1 = g.g3
a.c2.c0 = g.g4
a.c2.c1 = g.g5
else:
{.error: "a must be a sextic extension field".}
elif a is QuadraticExt:
when a.c0 is CubicExt:
a.c0.c0 = g0
a.c0.c1 = g.g4
a.c0.c2 = g.g3
a.c1.c0 = g.g2
a.c1.c1 = g1
a.c1.c2 = g.g5
else:
{.error: "a must be a sextic extension field".}
else:
{.error: "𝔽pᵏᐟ⁶ -> 𝔽pᵏ towering (direct sextic) is not implemented.".}

We might want to special-case this in a "fuzzing.nim" file as it might be that in the future Fp12 serialization is specified for the Whisk protocol that uses Fp12: https://ethresear.ch/t/the-return-of-torus-based-cryptography-whisk-and-curdleproof-in-the-target-group/16678

@mratsim
Copy link
Owner Author

mratsim commented Aug 7, 2024

Also check the discrepancy mentioned with libff:

  • possibly change the cofactor clearing
  • change the towering
  • recheck vs Milagro/Miracl/AMCL which also use the same towering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant