-
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
feat: BW6-761 emulated pairing #846
Conversation
… feat/bw6761-pairing
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.
I think almost good. I'm not understanding the thing with Ext6.Expc1, but I guess it is some ongoing optimization? Otherwise, there is still one open issue from last review (method signature to take *baseEl
instead of baseEl
for consistency)
Re-posting here for visibility #846 (comment). |
Summary✅ Passed: 5737 🚧 Skipped
|
Summary✅ Passed: 5737 🚧 Skipped
|
SCS cost when rebasing #749 on top of this:
|
Summary✅ Passed: 5737 🚧 Skipped
|
Summary✅ Passed: 5737 🚧 Skipped
|
After rebasing #749 on top of last commit cb9ff67, I get different SCS counts (e.g. 2 pairings 16713265). Normally without #749 the SCS count reduced from 44M to 39M for 2 pairings. Otherwise, I think we're good to go with this PR. |
May it be because I measured without ExpC1 call and without asserting equality to one |
hmm even with that it's 16610107 so I'm not sure if there is a regression when combined with #749 .. |
📦
❌
❌
|
Should work with Consensys/gnark-crypto#459 |
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
Yes, I'm now getting the same results you are. I guess I removed too much when I was measuring :/ Or it may also be that I had some dirty state in the tree as I was debugging the dereferences. In any case, I think the PR is good to go - we only have to merge Consensys/gnark-crypto#459 first and then update go.mod here. Great work! |
PR Consensys/gnark-crypto#459 is merged and go.mod updated here. So I'm merging and closing this. |
Description
This PR implements BW6-761 emulated pairing circuit. It is based on #589 (mainly for the tower arithmetic). It follows https://hackmd.io/@gnark/BW6-761-changes:
All these equations are implemented using similar tricks to BN254 and BLS12-381 emulated pairings (tower hints, affine coordinates, sparser lines, iterations isolation...).
I was expecting (4') to be the optimal choice, for a single pairing, in terms of constraints but it seems not. I will need to try with the optimal Tate equations.
Todo:
equation (5)equation (5')equation (6')Torus-based final exponentiation(not enough multiplications in
Expt
for torus-based FE to be worth it vs. 46 Karabina squarings in a row)Type of change
How has this been tested?
This needs to change the gnark-crypto branch to. The final chosen algorithm is the same as gnark-cryptofeat/bw6761-pairing
master
, so no nothing to do there anymore.How has this been benchmarked?
Checklist:
golangci-lint
does not output errors locally