Enhancements to java.math
The following enhancement has been made to the java.math package in version 1.4 of the Java2 SDK.Performance enhancements for prime generation in BigIntenger
New static method java.util.Random)">probablePrime has been added to class BigInteger for generating prime numbers. Previously, the sole means of generating a prime BigInteger required the caller to provide a 'certainty' (the log of the probability of compositeness that the caller was willing to tolerate). However, providing an unreasonable value for the certainty could lead to poor performance (if the certainty was too high) or serious bugs (if it was too low). The new prime-generation method provides an efficient algorithm for generating primes using an automatically determined, appropriate value for the certainty based on a draft ANSI specification (X9-80).