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

LibCrypto: Implement a performant RSA keygen algorithm #23561

Open
ADKaster opened this issue Mar 12, 2024 · 1 comment
Open

LibCrypto: Implement a performant RSA keygen algorithm #23561

ADKaster opened this issue Mar 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ADKaster
Copy link
Member

The current implementation of Crypto::PK::RSA::generate_key is slow and inefficient. It simply generates random values of the specified modulus length and checks if they are valid key pairs.

For modulus length of 256, or 512, this works ... all right. But when we start asking for 1024, 2048 or 4096 length key pairs, things get out of hand quickly. Tens of seconds quickly.

@ADKaster ADKaster added the enhancement New feature or request label Mar 12, 2024
@alimpfard
Copy link
Member

Some more relevant bits:

  • The current keypair gen algorithm is pretty much the fastest you can go without weird hacks
  • Almost all of the performance issues are currently caused by our modpow implementation (to think this was even slower before...), a better algorithm does exist (see Karatsuba).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants