-
Notifications
You must be signed in to change notification settings - Fork 269
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
Introduce an explicit clear-cofactor method #420
Conversation
Allowing implementers of <SW/TE>ModelParameters to override the default implementation
multiply by h_eff instead of by cofactor in G1 of BLS12-381
The effect of these methods is to |
Not necessarily. AFAIU the point of clearing the cofactor is to return a point in the prime order subgroup, but different techniques for clearing will return different points with the same order. |
Is this PR ok to go ahead with? It's necessary for #430. |
There are faster ways to clear the cofactor that multiplying by
h
, see e.g. https://eprint.iacr.org/2021/1130.pdf.In this PR I expose a method
clear_cofactor
onAffineCurve
, which SW/TE-ModelParameters implement with a defaultmul_by_cofactor()
call, but which allows upstream implementers of these traits to override with a more efficient implementation.As an example, I've added a concrete speedup for bls12-381 G1 (see companion PR in curves) which employs multiplication by a smaller scalar than the cofactor itself.
Description
related to #308
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer