Primality test function doesn't work on large numbers?

Elronnd via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 7 23:52:33 PST 2017


I'm working on writing an RSA implementation, but I've run into a 
roadblock generating primes.  With a more than 9 bits, my program 
either hangs for a long time (utilizing %100 CPU!) or returns a 
composite number.  With 9 or fewer bits, I get primes, but I have 
to run with a huge number of iterations to actually _get_ a 
random number.  It runs fast, though.  Why might this be?  Code: 
http://lpaste.net/1034777940820230144


More information about the Digitalmars-d-learn mailing list