From: Thomas Pornin Date: Wed, 17 Apr 2019 15:52:29 +0000 (+0200) Subject: Fixed efficiency pre-test on RSA prime generation (no security issue, but RSA key... X-Git-Url: https://bearssl.org/gitweb//home/git/?a=commitdiff_plain;h=9721b3e7566693128a5923cc1f481216b7853466;p=BearSSL Fixed efficiency pre-test on RSA prime generation (no security issue, but RSA key generation with pubexp 5, 7 or 11 may be slightly more efficient). --- diff --git a/src/rsa/rsa_i15_keygen.c b/src/rsa/rsa_i15_keygen.c index 1c011fe..e8da419 100644 --- a/src/rsa/rsa_i15_keygen.c +++ b/src/rsa/rsa_i15_keygen.c @@ -318,9 +318,9 @@ mkprime(const br_prng_class **rng, uint16_t *x, uint32_t esize, continue; } if ((pubexp == 3 && m3 == 1) - || (pubexp == 5 && m5 == 5) - || (pubexp == 7 && m5 == 7) - || (pubexp == 11 && m5 == 11)) + || (pubexp == 5 && m5 == 1) + || (pubexp == 7 && m7 == 1) + || (pubexp == 11 && m11 == 1)) { continue; } diff --git a/src/rsa/rsa_i31_keygen_inner.c b/src/rsa/rsa_i31_keygen_inner.c index 9ec881b..98df445 100644 --- a/src/rsa/rsa_i31_keygen_inner.c +++ b/src/rsa/rsa_i31_keygen_inner.c @@ -340,9 +340,9 @@ mkprime(const br_prng_class **rng, uint32_t *x, uint32_t esize, continue; } if ((pubexp == 3 && m3 == 1) - || (pubexp == 5 && m5 == 5) - || (pubexp == 7 && m5 == 7) - || (pubexp == 11 && m5 == 11)) + || (pubexp == 5 && m5 == 1) + || (pubexp == 7 && m7 == 1) + || (pubexp == 11 && m11 == 1)) { continue; }