part2
Class Fermat

java.lang.Object
  extended bypart2.Fermat
All Implemented Interfaces:
PrimeTester

public class Fermat
extends java.lang.Object
implements PrimeTester

A class to implement Fermat's Primility Test.


Constructor Summary
Fermat(int t, java.security.SecureRandom rnd)
          A constructor where t is the number of iterations for Fermat's Primality Test and rnd is a source of randomness.
 
Method Summary
 boolean isPrime(java.math.BigInteger x)
          A method to check the primility of the big integer x using Fermat's Primality Test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fermat

public Fermat(int t,
              java.security.SecureRandom rnd)
A constructor where t is the number of iterations for Fermat's Primality Test and rnd is a source of randomness.

Throws:
java.lang.Exception
Method Detail

isPrime

public boolean isPrime(java.math.BigInteger x)
                throws java.lang.Exception
A method to check the primility of the big integer x using Fermat's Primality Test.

Specified by:
isPrime in interface PrimeTester
Throws:
java.lang.Exception