Algorithm used by BigInteger prime generator?

Paul Fisher rao at
Tue Apr 20 19:43:52 PDT 1999

Alexandre Oliva <oliva at> writes:

> Does anybody know what algorithm the constructor
> java.math.BigInteger.BigInteger(int bitLength, int certainty, Random
> rnd) is supposed to use?

Sun's java.math implementation uses Colin Plumb's <colin at>
BigNum library <URL:>.
You'll find the prime number generation routines there.

Implementing the algorithm for Classpath is on my TODO list.
Although, if you're interested in writing it, we'd love to include it. :)

Paul Fisher * rao at

More information about the kaffe mailing list