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(secp256k1): add endomorphism acceleration #444

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Jul 26, 2024

This is the first of a series of PR to bring secp256k1 performance to state-of-the-art and then beyond.

See overall steps in #285.

Benchmarks

Unfortunately the most important primitive field multiplication does not use assembly for secp256k1 (256-bit) at the moment. Hence the huge gap (~30%) with the Pallas curve (255-bit) for example.

image
image

image
image

@mratsim
Copy link
Owner Author

mratsim commented Jul 26, 2024

Bench from

image
https://github.com/RustCrypto/elliptic-curves/blob/72540f8/k256/benches/scalar.rs#L36-L43

35us vs our 46us so we need a 24% perf improvement to catchup. This should be easy by not using Montgomery domain and implementing fast reduction.

@mratsim mratsim merged commit 478c19e into master Jul 26, 2024
20 of 24 checks passed
@mratsim mratsim deleted the secp256k1-endo branch July 26, 2024 23:06
mratsim added a commit that referenced this pull request Aug 19, 2024
mratsim added a commit that referenced this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant