Skip to content

Commit 9721b3e

Browse files
committed
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).
1 parent ecdf897 commit 9721b3e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/rsa/rsa_i15_keygen.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ mkprime(const br_prng_class **rng, uint16_t *x, uint32_t esize,
318318
continue;
319319
}
320320
if ((pubexp == 3 && m3 == 1)
321-
|| (pubexp == 5 && m5 == 5)
322-
|| (pubexp == 7 && m5 == 7)
323-
|| (pubexp == 11 && m5 == 11))
321+
|| (pubexp == 5 && m5 == 1)
322+
|| (pubexp == 7 && m7 == 1)
323+
|| (pubexp == 11 && m11 == 1))
324324
{
325325
continue;
326326
}

src/rsa/rsa_i31_keygen_inner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ mkprime(const br_prng_class **rng, uint32_t *x, uint32_t esize,
340340
continue;
341341
}
342342
if ((pubexp == 3 && m3 == 1)
343-
|| (pubexp == 5 && m5 == 5)
344-
|| (pubexp == 7 && m5 == 7)
345-
|| (pubexp == 11 && m5 == 11))
343+
|| (pubexp == 5 && m5 == 1)
344+
|| (pubexp == 7 && m7 == 1)
345+
|| (pubexp == 11 && m11 == 1))
346346
{
347347
continue;
348348
}

0 commit comments

Comments
 (0)