cryptix.math
Class TestPrime
java.lang.Object
cryptix.math.TestPrime
- public class TestPrime
- extends java.lang.Object
This class contains static methods to test the primality of a
cryptix.math.BigInteger.
New code should probably use java.math.BigInteger, which has an
isProbablePrime
method (and also a constructor for
generating random probable-primes).
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1.1.1 $
- Since:
- Cryptix 2.2 or earlier
- Author:
- unattributed
- See Also:
BigInteger
,
BigInteger.isProbablePrime(int)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestPrime
public TestPrime()
hasSmallFactor
public static boolean hasSmallFactor(BigInteger n)
hasSmallFactor
public static boolean hasSmallFactor(BigInteger n,
TestPrimeObserver obsrv)
isPrime
public static boolean isPrime(BigInteger p)
isPrime
public static boolean isPrime(BigInteger p,
TestPrimeObserver obsrv)
main
public static void main(java.lang.String[] args)
self_test
public static void self_test(java.io.PrintWriter out)
throws java.lang.Exception
- Throws:
java.lang.Exception