diff options
author | slontis <shane.lontis@oracle.com> | 2022-11-02 12:01:34 +1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-21 11:20:38 +0100 |
commit | 1136c4dc39150a89754827285787b0dd48562e0a (patch) | |
tree | f4336788db9bcd5eec382b58626265d893983dd2 /doc/man7/EVP_KDF-SS.pod | |
parent | 6f6f413312934e5ab8250741e2535293e1d7b237 (diff) |
Improve FIPS RSA keygen performance.
FIPS 186-4 has 5 different algorithms for key generation,
and all of them rely on testing GCD(a,n) == 1 many times.
Cachegrind was showing that during a RSA keygen operation,
the function BN_gcd() was taking a considerable percentage
of the total cycles.
The default provider uses multiprime keygen, which seemed to
be much faster. This is because it uses BN_mod_inverse()
instead.
For a 4096 bit key, the entropy of a key that was taking a
long time to generate was recorded and fed back into subsequent
runs. Roughly 40% of the cycle time was BN_gcd() with most of the
remainder in the prime testing. Changing to use the inverse
resulted in the cycle count being 96% in the prime testing.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19578)
(cherry picked from commit dd1d7bcb69994d81662e709b0ad838880b943870)
Diffstat (limited to 'doc/man7/EVP_KDF-SS.pod')
0 files changed, 0 insertions, 0 deletions