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

BW6-761 and BW6-633 Miller loops #77

Merged
merged 4 commits into from
Oct 13, 2021
Merged

BW6-761 and BW6-633 Miller loops #77

merged 4 commits into from
Oct 13, 2021

Conversation

yelhousni
Copy link
Collaborator

@yelhousni yelhousni commented Oct 13, 2021

For BW6-761, explanation is here: https://hackmd.io/@gnark/BW6-761-changes
For BW6-633, it follows the same logic.

I chose to port here an optimal Tate (Alg.2 in HG21) because it is the fastest for both single pairing and multi-pairing and also for both BW6-761 (over BLS12) and BW6-633 (over BLS24). The result of BW6-761 pairing is not the same as previously but it's not a problem since we are using pairings as a a product check (e.g. e([]A, []B)==1 rather than exact values.

Benchmarks:
BW6-761

benchmark                      old ns/op     new ns/op     delta
BenchmarkMillerLoop-2          1620328       1283479       -20.79%
BenchmarkMultiMillerLoop-2     3809277       2966886       -22.11%

BW6-633

benchmark                  old ns/op     new ns/op     delta
BenchmarkMillerLoop-2      913504        806004        -11.77%
BenchmarkMultiMiller-2     2185513       1876721       -14.13%

l0.r1.Mul(&l0.r1, &q[k].X)
l0.r0.Mul(&l0.r0, &q[k].Y)

switch j {
Copy link
Collaborator

Choose a reason for hiding this comment

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

😅

@gbotrel gbotrel merged commit ed90352 into develop Oct 13, 2021
@gbotrel gbotrel deleted the BW6 branch October 13, 2021 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants