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

Ed25519 / X25519 potential performance improvements (by looking at BoringSSL) #193

Open
1 of 4 tasks
hannesm opened this issue Feb 10, 2024 · 0 comments
Open
1 of 4 tasks
Labels
good first issue Good for newcomers help wanted Extra attention is needed performance (potential) performance improvements

Comments

@hannesm
Copy link
Member

hannesm commented Feb 10, 2024

I reviewed the BoringSSL codebase (and compared our 25519 implementation), and they have:

  • more tables (we have in curve25519_tables.h whatever is used if "OPENSSL_SMALL" is defined in BoringSSL), but there's as well a const uint8_t k25519Precomp[32][8][3][32]. we may want to measure performance, and size if we're keen on performance - see improvements for 25519 #196 https://github.com/hannesm/mirage-crypto/tree/25519-big-table (looks like it's not an enhancement on all CPUs -- a slowdown on AMD Ryzen 7 3700X (3.6GHz) and AMD Ryzen 9 7950X (4.5 GHz) by 0.8, a speedup on i7-5600U, 2.60GHz by 1.7)
  • ADX for base-point multiplication (according to 9d4f833eec8205e7ad257fb7e7cb321270d3e3cb there's around +25% in Ed25519 key generation and signing operations)
  • NEON (ARM) if someone cares about ARM processors
  • Simpler square-root computation for Ed25519 (commit 0fc57bef1821c163ac023a0aa96e4fb2a67c0d82) - see improvements for 25519 #196
@hannesm hannesm added good first issue Good for newcomers help wanted Extra attention is needed performance (potential) performance improvements labels Feb 10, 2024
@hannesm hannesm changed the title Ed25519 / X25519 potential performance improvements Ed25519 / X25519 potential performance improvements (by looking at BoringSSL) Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed performance (potential) performance improvements
Projects
None yet
Development

No branches or pull requests

1 participant