Primality test function doesn't work on large numbers?
Elronnd via Digitalmars-d-learn Sat, 07 Jan 2017 23:56:18 -0800
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
- Primality test function doesn't wor... Elronnd via Digitalmars-d-learn
- Re: Primality test function do... Eugene Wissner via Digitalmars-d-learn
- Re: Primality test function do... Timon Gehr via Digitalmars-d-learn
- Re: Primality test functio... Elronnd via Digitalmars-d-learn
- Re: Primality test fun... Eugene Wissner via Digitalmars-d-learn
- Re: Primality test fun... Timon Gehr via Digitalmars-d-learn