Skip to content

perf(bls12-377): eliminate finalexp ~naively #1202

Closed
yelhousni wants to merge 3 commits intomasterfrom
perf/eliminate-finalExp-bls377
Closed

perf(bls12-377): eliminate finalexp ~naively #1202
yelhousni wants to merge 3 commits intomasterfrom
perf/eliminate-finalExp-bls377

Conversation

@yelhousni
Copy link
Copy Markdown
Contributor

@yelhousni yelhousni commented Jul 16, 2024

Description

Similarly to #1173, we apply theorem 1 of https://eprint.iacr.org/2024/640.pdf to check that f == c^r. We check instead that f^k == c^(q-u) where k=(u-1)^2/3 using a Frobenius map and 2 optimized addition chains. This PR implements this idea after pushing f to the cyclotomic subgroup. The exponentiations are done then using a mix of Karabina's and Granger--Scott's algorithms whenever appropriate.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Pairing tests pass.

How has this been benchmarked?

This PR saves 11,864 scs in the PairingCheck and 12,356 scs in the PLONK native aggregation circuit.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@yelhousni yelhousni added type: perf dep: linea Issues affecting Linea downstream labels Jul 16, 2024
@yelhousni yelhousni requested a review from ivokub July 16, 2024 08:01
@yelhousni yelhousni self-assigned this Jul 16, 2024
@yelhousni
Copy link
Copy Markdown
Contributor Author

superseded by #1207

@yelhousni yelhousni closed this Jul 18, 2024
@gbotrel gbotrel deleted the perf/eliminate-finalExp-bls377 branch January 17, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dep: linea Issues affecting Linea downstream type: perf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant