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

Fuentes et al. algorithm for computing hard part of final exponentiation #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Raneet10
Copy link

This PR leverages the Fuentes et al. algorithm for computing the hard part of the final exponentiation based on the fact that f ^ d' is also a pairing and can be computed at least as efficiently as f ^ d where d' is a multiple of d and d = Φk(p)/r = (p⁴ − p² + 1)/r

goos: darwin
goarch: arm64
pkg: github.com/cloudflare/bn256
           │   old.txt   │              new.txt               │
           │   sec/op    │   sec/op     vs base               │
Pairing-10   695.0µ ± 0%   680.5µ ± 0%  -2.09% (p=0.000 n=50)

           │   old.txt    │            new.txt             │
           │     B/op     │     B/op      vs base          │
Pairing-10   38.25Ki ± 0%   38.25Ki ± 0%  ~ (p=1.000 n=50)

           │  old.txt   │            new.txt             │
           │ allocs/op  │ allocs/op   vs base            │
Pairing-10   352.0 ± 0%   352.0 ± 0%  ~ (p=1.000 n=50) ¹
¹ all samples are equal

The benchmark indicates slight improvement but I'd really love to get reviews to see whether further optimizations can be made.
Thank you!

@armfazh armfazh self-requested a review September 19, 2023 19:39
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.

1 participant