-
Notifications
You must be signed in to change notification settings - Fork 376
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 KZG gadget #866
Conversation
📦
❌
❌
|
Should work with #870. |
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.
All perfect!
And for historical note, with #749 PLONK cost is 20760085. |
Suggested edit: diff --git a/std/commitments/kzg/verifier_test.go b/std/commitments/kzg/verifier_test.go
index 2fed4f36..29d2694a 100644
--- a/std/commitments/kzg/verifier_test.go
+++ b/std/commitments/kzg/verifier_test.go
@@ -175,7 +175,7 @@ func TestKZGVerificationEmulated3(t *testing.T) {
Commitment: wCmt,
OpeningProof: wProof,
}
- assert.CheckCircuit(&KZGVerificationCircuit[sw_bw6761.Scalar, sw_bw6761.G1Affine, sw_bw6761.G2Affine, sw_bw6761.GTEl]{}, test.WithValidAssignment(&assignment), test.WithCurves(ecc.BN254))
+ assert.CheckCircuit(&KZGVerificationCircuit[sw_bw6761.Scalar, sw_bw6761.G1Affine, sw_bw6761.G2Affine, sw_bw6761.GTEl]{}, test.WithValidAssignment(&assignment))
}
func TestKZGVerificationTwoChain(t *testing.T) {
|
Should we wait for #870 to merge with the suggested edit (otherwise CI will fail) or could we merge as-is and in #870 merge master and there apply the edit? |
Yes, we can merge current as-is and then in #870 make the change. #870 is a more generic fix and not particularly blocking this one. I'm trying to keep in mind to rebase 870 and add the change there :) |
Description
Adds BW6-761 KZG according to #840 (need #846 first to me merged).
Type of change
How has this been tested?
The tests in
std/algebra/emulated/sw_emulated
andstd/commitments/kzg
are generic for all curves. But weirdly the BW6 KZG test fails when testing with any other curve than BN254 as the SNARK curve! It throws an error in the division needed to compute the slope ofdoubleStep
at exactly the iterationi=15
. I need to deeply look at this. So for now testing withtest.WithCurves(ecc.BN254)
only.Edit: the issue was identified by @ivokub to be related to field emulation (edge case in division when limbs are big e.g. bw6-761 field). Will be fixed in a separate PR (issue #867).
How has this been benchmarked?
KZG over BW6-761 in a BN254 SNARK:
Checklist:
golangci-lint
does not output errors locally