Skip to content

Slowdown after switch to crypto-bigint #490

Closed
@fjarri

Description

@fjarri

Benchmarks slowed down several times after #394. What could be the reason?

Performance improvements for boxed uints (RustCrypto/crypto-bigint#777) and the corresponding changes in crypto-primes (entropyxyz/crypto-primes#78) don't really change the results much according to my tests.

sign test time is split ~50/50 between Montgomery exponentiation (with all the time spent in almost_montgomery_mul(), the lowest level function) and BoxedUint::inv_mod(); decrypt is almost exclusively exponentiation. Both of these are the calls in RSA itself; crypto-primes calls take negligible time.

So it seems that either these two functions are somehow much slower than num-bigint (possible, yet unlikely, and straightforward to test), or somehow #394 changed the algorithm to apply them more times than necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions