cryptix.math
Class TestPrime

java.lang.Object
  extended bycryptix.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)

Constructor Summary
TestPrime()
           
 
Method Summary
static boolean hasSmallFactor(BigInteger n)
           
static boolean hasSmallFactor(BigInteger n, TestPrimeObserver obsrv)
           
static boolean isPrime(BigInteger p)
           
static boolean isPrime(BigInteger p, TestPrimeObserver obsrv)
           
static void main(java.lang.String[] args)
           
static void self_test(java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestPrime

public TestPrime()
Method Detail

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