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

RSA very slow, takes 11ms in release #454

Open
Snowiiii opened this issue Oct 14, 2024 · 10 comments
Open

RSA very slow, takes 11ms in release #454

Snowiiii opened this issue Oct 14, 2024 · 10 comments

Comments

@Snowiiii
Copy link

Hello, I noticed that RSA key generation takes a long time, Like the README says release build do reduce the time, But 11ms for a 1024 Key is still a lot. I would love if there where some efforts going on to reduce generation time

@tarcieri
Copy link
Member

tarcieri commented Oct 15, 2024

When #394 lands we will switch to crypto-primes for key generation.

I would expect that to be faster but haven't benchmarked myself yet.

@r10s
Copy link

r10s commented Oct 15, 2024

maybe related: #29 (cannot say much otherwise, only remembered that old issue i also ran into that time :)

@dignifiedquire
Copy link
Member

The current crypto-primes branch has a rough slow down of 2x last time I benchmarked, see the PR for a description of why

@Snowiiii
Copy link
Author

Snowiiii commented Nov 6, 2024

The current crypto-primes branch has a rough slow down of 2x last time I benchmarked, see the PR for a description of why

I don't see the Slower benchmarks, In the PR description are only a bunch of checkboxes.
I also wonder what the point of this PR is when it brings a 2 times slow down

@dignifiedquire
Copy link
Member

I also wonder what the point of this PR is when it comes 2 times slower

Security: #19

@tarcieri
Copy link
Member

tarcieri commented Nov 6, 2024

@dignifiedquire they've recently added a number of improvements including parallel prime generation which haven't made it into a release yet.

Also, this seems relevant entropyxyz/crypto-primes#61

@dignifiedquire
Copy link
Member

Glad to hear that, the slowdown I was referring to was not key generation but signing & verification operations

@fjarri
Copy link

fjarri commented Dec 5, 2024

@tarcieri, relevant in what way? We're thinking now in what way it should be exposed, so it's useful to know potential use cases.

@tarcieri
Copy link
Member

@fjarri I was curious if it could be used to ensure certain properties of the generated primes, like non-adjacency of p and q, and ensuring the high bits are set so the bit lengths of the primes, when added, are always the intended key size

@fjarri
Copy link

fjarri commented Dec 10, 2024

like non-adjacency of p and q,

That's probably best ensured by just starting the search from random positions for either?

and ensuring the high bits are set so the bit lengths of the primes, when added, are always the intended key size

This is already the case by default. Perhaps it should be stated clearly in the docs.

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

No branches or pull requests

5 participants