perf: optimize class equivalence check for BLS12 final exp #1207
Merged
perf: optimize class equivalence check for BLS12 final exp #1207
Conversation
9 tasks
ivokub
requested changes
Jul 25, 2024
Collaborator
ivokub
left a comment
There was a problem hiding this comment.
Changes good. I only now noticed that in FinalExpCheck we have indicated that we return *E12, but always return nil. I think we can change the the function signature to indicate that.
And, now after #1209 is merged, maybe it would make sense to also have methods for other curves for returning the FinalExpCheck result? Long-term this allows us to amend the std/algebra/Pairing interface so that we can also prove that final exponentiation doesn't hold.
This was referenced Aug 4, 2024
Closed
Closed
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
Instead of applying Th.1 of https://eprint.iacr.org/2024/640.pdf naively as in #1173 ans #1202 we can scale the miller loop result by some factors:
p-th root wherep=(1-u)/3p'-th root wherep'=12(u-1)and use the optimal exponent
q-uinstead ofr. This is based on a personal communication (and a lot of help) from Andrija Novakovic @akinovak: https://gist.github.com/akinovak/0db531d350b95ccec682666b2257db77Type of change
How has this been tested?
pairing tests pass.
How has this been benchmarked?
This PR saves 3,369,246 scs for a
PairingCheck.This PR saves 21,989 scs in the
PairingCheckand in the PLONK native aggregation circuit.Checklist:
golangci-lintdoes not output errors locally