-
Notifications
You must be signed in to change notification settings - Fork 504
perf(ecmul): use GLV with safe handling of edge cases in EVM ecmul #976
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
Conversation
|
@ivokub just re-pinging you here |
ivokub
left a comment
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.
PR looks good. I'll accept it, but maybe I can try implementing the safe scalarmul with option instead to see how it looks. I have actually also thought about adding an option which would allow to define for MSM which inputs may be unsafe (i.e. 0 scalar or 0 point) and then these options would complement each other quite nicely.
|
@yelhousni - I implemented using an option and merged the implementations. See how it looks and feels. If seems excessive then I'm good with reverting. On one hand I do not want to overuse using options, but I still like having unified implementation. Another thing - currently the default is to use unsafe and we use option to use safe version. But I guess it would make more sense to have the defaults reversed -- i.e. without options we use safe formulas and then can optionally toggle to unsafe formulas for performance. I think we may have incoming bug reports due to the defaults being the other way. |
Description
Another tiny PR to use GLV with safe handling of edge cases in EVM
ecmulprecompile.Type of change
How has this been tested?
Tests in
bn_test.gopass.How has this been benchmarked?
ECMUL precompile cost goes from 781,437 to 673,659 SCS.
Checklist:
golangci-lintdoes not output errors locally