part2
Class ModRep

java.lang.Object
  extended bypart2.ModRep

public class ModRep
extends java.lang.Object

A class to implement modular representations of big integer values.


Constructor Summary
ModRep(java.math.BigInteger n1, java.math.BigInteger n2, java.math.BigInteger x)
          A constructor to create the modular representation of x for the moduli n1 and n2.
ModRep(java.math.BigInteger n1, java.math.BigInteger n2, java.math.BigInteger x1, java.math.BigInteger x2)
          A constructor to create the modular representation using x1 and x2 for the moduli n1 and n2.
 
Method Summary
 ModRep add(ModRep y)
          A method to perform addition on modular representations.
 ModRep expm(java.math.BigInteger d)
          A method to perform exponentiation on modular representations.
 ModRep mult(ModRep y)
          A method to perform multiplication on modular representations.
 java.math.BigInteger value()
          A method to return the big integer value represented by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModRep

public ModRep(java.math.BigInteger n1,
              java.math.BigInteger n2,
              java.math.BigInteger x)
       throws java.lang.Exception
A constructor to create the modular representation of x for the moduli n1 and n2.

Throws:
java.lang.Exception

ModRep

public ModRep(java.math.BigInteger n1,
              java.math.BigInteger n2,
              java.math.BigInteger x1,
              java.math.BigInteger x2)
       throws java.lang.Exception
A constructor to create the modular representation using x1 and x2 for the moduli n1 and n2.

Throws:
java.lang.Exception
Method Detail

value

public java.math.BigInteger value()
                           throws java.lang.Exception
A method to return the big integer value represented by this object.

Throws:
java.lang.Exception

add

public ModRep add(ModRep y)
           throws java.lang.Exception
A method to perform addition on modular representations. The object returned in the modular representation of the current object added to y.

Throws:
java.lang.Exception - if the current object and y do not use the same moduli.

mult

public ModRep mult(ModRep y)
            throws java.lang.Exception
A method to perform multiplication on modular representations. The object returned in the modular representation of the current object multiplied by y.

Throws:
java.lang.Exception - if the current object and y do not use the same moduli.

expm

public ModRep expm(java.math.BigInteger d)
            throws java.lang.Exception
A method to perform exponentiation on modular representations. The object returned in the modular representation of the current object to the power d.

Throws:
java.lang.Exception