-
Notifications
You must be signed in to change notification settings - Fork 369
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
Perf: emulated BN254 pairing #566
Conversation
Backend options were split into prover and solver options. Usually when running the prover we set the solver options using backend.WithSolverOptions. But in tests makes sense that if we set `test.WithSolverOptions` then these options are also applied to the solver when run by the prover.
There are a lot of hints in the package. The preferred way of accessing all the hints is using GetHints()
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 made some modifications to keep the interfaces similar, and didn't change anything in the computation itself.
Before merging I would just rebase on top of develop just in case to see we're not reintroducing regressions. There have been several updates to field emulation. If you are OK with it then I can do it myself and force push.
However, when I run TestPairTestSolve locally in test engine then 10% cases fail. I'll have a look to understand if it is due to field emulation. I would postpone merging until then.
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.
Very good! I only removed the test which runs the profiler.
Some R1CS stats: |
Taking into account the new range check gadget, this PR removes almost 1M R1CS constraints from the emulated BN254 pairing (verified in a BN254 SNARK). It mostly follows "Pairings in R1CS" paper.