RustCrypto / RSA

RSA implementation in pure Rust
Apache License 2.0
557 stars 154 forks source link

RSA very slow, takes 11ms in release #454

Open Snowiiii opened 1 month ago

Snowiiii commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

maybe related: https://github.com/RustCrypto/RSA/issues/29 (cannot say much otherwise, only remembered that old issue i also ran into that time :)

dignifiedquire commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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

Security: https://github.com/RustCrypto/RSA/issues/19

tarcieri commented 3 weeks ago

@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 https://github.com/entropyxyz/crypto-primes/issues/61

dignifiedquire commented 3 weeks ago

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