On Tue, 8 Aug 1995 aba@atlas.ex.ac.uk wrote:
"Rev. Ben" <samman@cs.yale.edu> writes on cpunks:
Does anyone know of where I could get source, royalty free, in the US for a good Prime Number Generator?
GNU code sounds like it would fit the royalty free bill.
Try the GNU multi-precision library: gmp-1.3.2.tar.gz from all good GNU sources. I get my stuff from ftp://src.doc.ic.ac.uk/gnu/ if you don't have a GNU ftp site to hand.
There's a function
int mpz_probab_prime_p(mpnum, SURETY)
which returns true if the prime passes SURETY probablistic prime tests.
I think if it passes say 25 tests, then there will be less than a 1/2^25 chance that it is not prime.
Also, on:
The proper thing to do is to then search for a number which demonstrates p is prime.... Nathan