This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the GCJ project. See the GCJ home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Algorithm used by BigInteger prime generator?


Alexandre Oliva <oliva@dcc.unicamp.br> 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@nyx.net>
BigNum library <URL:ftp://skip.incog.com/pub/bnlib-1.1.tar.gz>.
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@gnu.org