Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- From: Ertugrul Söylemez <es@xxxxxxxx>
- Date: Fri, 30 May 2008 11:38:14 +0200
Le Chaud Lapin <jaibuduvin@xxxxxxxxx> wrote:
The primality test itself consists of trial division by the first
few thousand primes, which are not covered by the prime sieve, and
if the number still passes, then a Miller-Rabin or some other fast
test is done.
And finally AKS, heheh. :)
The reason for the many primality tests is efficiency. If you tested
every single number using, say, Miller-Rabin, generating a key could
well take a few hours. ;)
You can substitute Miller-Rabin for AKS or ECPP, though, if you want to
make sure that the number is prime. Slower, but correct in all cases.
Some might say it is unecessary, but IMO, a function with the
following signature..
bool Big_Integer::is_prime()
should not be named as such if there is a possibility that it will
return true when false is correct.
[We still keep our ::is_probably_prime (unsigned int)]
The name "is_prime" is really inappropriate. GMP calls its function
"mpz_probab_prime_p", but OpenSSL calls its functions like
BN_generate_prime and BN_is_prime, although it uses Miller-Rabin.
Though one might argue that the probability for false negatives is
totally neglible, the function name should be clear.
Regards,
Ertugrul.
--
http://ertes.de/
.
- Follow-Ups:
- Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- From: Thomas Pornin
- Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- References:
- Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- From: Le Chaud Lapin
- Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- From: Ertugrul Söylemez
- Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- From: Le Chaud Lapin
- Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- Prev by Date: Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- Next by Date: Re: securely transfer data over insecure line when one part cannot store private key
- Previous by thread: Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- Next by thread: Re: Algorithm For Ensuring p & q Sufficiently Large For n in RSA
- Index(es):