private static enum LongMath.MillerRabinTester extends java.lang.Enum<LongMath.MillerRabinTester>
Enum Constant and Description |
---|
LARGE
Works for all nonnegative signed longs.
|
SMALL
Works for inputs <= FLOOR_SQRT_MAX_LONG.
|
Modifier and Type | Method and Description |
---|---|
(package private) abstract long |
mulMod(long a,
long b,
long m)
Returns a * b mod m.
|
private long |
powMod(long a,
long p,
long m)
Returns a^p mod m.
|
(package private) abstract long |
squareMod(long a,
long m)
Returns a^2 mod m.
|
(package private) static boolean |
test(long base,
long n) |
private boolean |
testWitness(long base,
long n)
Returns true if n is a strong probable prime relative to the specified base.
|
static LongMath.MillerRabinTester |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LongMath.MillerRabinTester[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LongMath.MillerRabinTester SMALL
public static final LongMath.MillerRabinTester LARGE
public static LongMath.MillerRabinTester[] values()
for (LongMath.MillerRabinTester c : LongMath.MillerRabinTester.values()) System.out.println(c);
public static LongMath.MillerRabinTester valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullstatic boolean test(long base, long n)
abstract long mulMod(long a, long b, long m)
abstract long squareMod(long a, long m)
private long powMod(long a, long p, long m)
private boolean testWitness(long base, long n)