Add a parameter to probable_prime if we look for a safe prime
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 4 Jul 2019 12:52:41 +0000 (14:52 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 19 Mar 2020 02:18:13 +0000 (03:18 +0100)
commit7eccef219714366d87fe847b105260a0fc84f464
tree751c39435b2a250d854d8d5acac33d43d1854e10
parent9e1eaa4a400633409322ed843ca63be799cad341
Add a parameter to probable_prime if we look for a safe prime

Currently probable_prime makes sure that p-1 does not have
any prime factors from 3..17863, which is useful for safe primes,
but not necessarily for the general case.

Issue was initially reported here:
MIRONOV, I. Factoring RSA Moduli II.
https://windowsontheory.org/2012/05/17/factoring-rsa-moduli-part-ii/

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9387)
crypto/bn/bn_prime.c