-
Notifications
You must be signed in to change notification settings - Fork 370
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
Fix: Bandersnatch GLV scalar multiplication #1271
base: master
Are you sure you want to change the base?
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.
A remark, that probably applies to other neighbor pacakges;
I checked the call graph to see how it is tested, and it seems we just test with testData
--> with random scalars.
Should we add some edge cases tests ? (i.e. scalar at 0, p-1, 1, ...),
Yes indeed we should test edge cases. We already do so for emulated and native SW packages. Here it should be easier because formulas are complete. |
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.
Looks perfect! I only added some comments what my local linter mentioned (unused arguments in methods).
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.
Description
Fixes #268
Type of change
How has this been tested?
TestCurve
for Bandersnatch pass when usingscalarMulGLV
.How has this been benchmarked?
Bandersnatch
in R1CS:2-bit windowed double-and-add: 3,314
GLV: 2,735
Bandersnatch
in SCS:2-bit windowed double-and-add: 5,991
GLV: 6,077
So the GLV saves 579 r1cs but adds 86 scs, which is because of the non-native scalar decomposition check. In this PR we use GLV only if endomorphism + R1CS.
Checklist:
golangci-lint
does not output errors locally