| Modifier and Type | Field and Description |
|---|---|
| private static final BigInteger | |
| private static final BigInteger |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static boolean | Returns: true if the candidate is found to have any small factors,
false otherwise.the candidate)BigInteger instance to test for division by small factors.A fast check for small divisors, up to some implementation-specific limit. |
| private static boolean | |
| private static boolean | |
| public static boolean | Returns: false if any witness to compositeness is found amongst the chosen bases
(so candidate is definitely NOT prime), or else true
(indicating primality with some probability dependent on the number of iterations
that were performed).the candidate, SecureRandom BigInteger instance to test for primality.the source of randomness to use to choose bases. random, int the number of randomly-chosen bases to perform the test for. iterations)FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. |
| ONE | back to summary |
|---|---|
| private static final BigInteger ONE | |
| TWO | back to summary |
|---|---|
| private static final BigInteger TWO | |
| Primes | back to summary |
|---|---|
| pack-priv Primes() | |
| checkCandidate | back to summary |
|---|---|
| private static void checkCandidate(BigInteger n, String name) | |
| hasAnySmallFactors | back to summary |
|---|---|
| public static boolean hasAnySmallFactors(BigInteger candidate) A fast check for small divisors, up to some implementation-specific limit.
| |
| implHasAnySmallFactors | back to summary |
|---|---|
| private static boolean implHasAnySmallFactors(BigInteger x) | |
| implMRProbablePrimeToBase | back to summary |
|---|---|
| private static boolean implMRProbablePrimeToBase(BigInteger w, BigInteger wSubOne, BigInteger m, int a, BigInteger b) | |
| isMRProbablePrime | back to summary |
|---|---|
| public static boolean isMRProbablePrime(BigInteger candidate, SecureRandom random, int iterations) FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases.
| |