part2
Class MR

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

public class MR
extends java.lang.Object
implements PrimeTester

A class to implement the Miller-Rabin Primility Test.


Constructor Summary
MR(int t, java.security.SecureRandom rnd)
          A constructor where t is the number of iterations for the Miller-Rabin 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 the Miller-Rabin Primality Test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MR

public MR(int t,
          java.security.SecureRandom rnd)
A constructor where t is the number of iterations for the Miller-Rabin 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 the Miller-Rabin Primality Test.

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