-
Notifications
You must be signed in to change notification settings - Fork 256
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
Adding wNAF multiplication functionality #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR'ing this! LGTM, left some requests for comments & minor changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Minor note, can a changelog entry be added to ### features.
perhaps:
- #230 (ark-ec) Add
wnaf_mul implementation for groups
I will be making some PRs from celo-org merge which include a wNAF mul combined with GLV. I think what would be nice would be to have the GLV-compatible curve use wNAF mul with a default window size specified in parameters. I think we ought to make wNAF (+GLV if applicable) the default mul method, if it is faster. However, maintaining the underlying methods in a separate file like here is good too, to reduce the single-file bloat and for multiple impls (add_assign for proj and add_assign_mixed for affine). Unfortunately though, for the current impl, The right thing to do would be to convert an affine point into a projective point first, since Btw @ValarDragon , do you know where |
@jon-chuang how does this PR interact with your upcoming wNAF PR? |
@Pratyush it can be used as an impl in a different file, which I am for as it separates duties. |
Thanks for the PR! This looks mostly good to me, barring the concern @jon-chuang raised about using |
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
@ggkitsas I pushed some updates that should now enable working with arbitrary window sizes. Please take a look and let me know if it makes sense. |
@Pratyush LGTM, thanks! |
This LGTM, so unless folks would like further changes, I'll merge this today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Adds wNAF multiplication functionality for
Group
elements. It doesn't change the way scalar multiplication is currently performed but rather provides an option to use wNAF.Two functions are added:
wnaf_table
: generates a lookup table for a givenGroup
element andwindow
sizewnaf_mul
: performs the scalar multiplication using a lookup table and a scalar in NAF (can be obtained byfind_wnaf
)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