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

Per-curve towering #428

Open
mratsim opened this issue Jul 13, 2024 · 0 comments
Open

Per-curve towering #428

mratsim opened this issue Jul 13, 2024 · 0 comments

Comments

@mratsim
Copy link
Owner

mratsim commented Jul 13, 2024

Currently the tower of extension fields is globally enforced:

type
NonResidue* = object
## Non-Residue
##
## Placeholder for the appropriate quadratic, cubic or sectic non-residue
QuadraticExt*[F] = object
## Quadratic Extension field
coords*: array[2, F]
CubicExt*[F] = object
## Cubic Extension field
coords*: array[3, F]
ExtensionField*[F] = QuadraticExt[F] or CubicExt[F]
Fp2*[Name: static Algebra] =
QuadraticExt[Fp[Name]]
Fp4*[Name: static Algebra] =
QuadraticExt[Fp2[Name]]
Fp6*[Name: static Algebra] =
CubicExt[Fp2[Name]]
Fp12*[Name: static Algebra] =
CubicExt[Fp4[Name]]
# QuadraticExt[Fp6[Name]]

However, ideally this config is defined per-curve as for Fp6 BW6 curves are more optimal as Fp -> Fp3 -> Fp6 while for BN and BLS12, the towering is Fp->Fp2->Fp6 (though ultimately Fp->Fp4->Fp12 is better for multiplication).

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