Skip to content
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): Miller loop using direct sextic extension #608

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

yelhousni
Copy link
Collaborator

Description

This corresponds to the gnark circuit and is needed to compute the same residueWitness in- and out-circuit for Consensys/gnark#1365.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Please describe the tests that you ran or implemented to verify your changes. Provide instructions so we can reproduce.

Added tests for the new E6D struct in internal/fptower/e6_direct_test.go and pairing computation using towered and direct extensions in pairing_test.go.

How has this been benchmarked?

MillerLoopDirect is much slower than MillerLoop but it is only used in the hint computation for the gnark circuit.

benchmark                 tower ns/op   direct ns/op     delta
BenchmarkMillerLoop-8     1195105       3922503       +228.21%

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

Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small cosmetic comments, otherwise looks perfect. Didn't check fully the direct mulMontgomery equations, but as the tests check compatibility with fp2fp3 tower multiplication, then should be good.

Thanks!

ecc/bw6-761/pairing.go Outdated Show resolved Hide resolved
ecc/bw6-761/pairing.go Outdated Show resolved Hide resolved
@yelhousni yelhousni merged commit e7fd38b into master Jan 16, 2025
5 checks passed
@yelhousni yelhousni deleted the bw6/direct-E6 branch January 16, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants