-
Notifications
You must be signed in to change notification settings - Fork 372
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: optimize class equivalence check for BLS12 final exp #1207
Conversation
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
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.
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.
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.
Thanks!
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)/3
p'
-th root wherep'=12(u-1)
and use the optimal exponent
q-u
instead 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
PairingCheck
and in the PLONK native aggregation circuit.Checklist:
golangci-lint
does not output errors locally