Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
currently we do
GT == e(a1,b1)*e(a2,b2)*e(a3,b3)usingPairfor the triple-pairing, which means computing the multi-Miller loop and then reducing it to a unique value withFinalExponentiationthat should matchGTfrom theVerifyingKey.In this PR I wanted to check if including
GTin the pairing computation (triple-pairing becomes quadruple) and usingFinalExponentiationCheck(insidePairingCheck) would result in less constraints (using #1143, #1155, #1207).N.B.:
QuadruplePairingCheckmethod that merges the squares of the equivalence check with the Miller loop (similar to perf: optimizeDoublePairingChecki.e. e(a,b)e(c,d) == 1 #1230 but for 4 pairs). I implemented this and it saves 5.7% but add more code to gnark that is only useful for G16 verifier circuit.GTin theVerifyingKeyand include it the triple-Miller loop to compute the hinted witness residue. This also should work but again more specialized methods and more lines of code for a single circuit that we probably don't care about much.Type of change
How has this been tested?
Tests pass.
How has this been benchmarked?
BN254-G16 verifier in a BN254 circuit:
QuadruplePairingCheck): 1,310,727 scsChecklist:
golangci-lintdoes not output errors locally