part4
Class DLH

java.lang.Object
  extended bypart4.DLH
All Implemented Interfaces:
HashFunction

public class DLH
extends java.lang.Object
implements HashFunction

A class that implements the Discrete Log Hash Function.


Constructor Summary
DLH(java.math.BigInteger p, java.math.BigInteger a, java.math.BigInteger b)
          A constructor that instantiates an object with prime p and generators a & b.
 
Method Summary
 java.math.BigInteger h(java.math.BigInteger x1, java.math.BigInteger x2)
          A method that implements the hash function h.
 java.math.BigInteger hash(java.lang.String str)
          A method that implements the function to hash a string to a big integer value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DLH

public DLH(java.math.BigInteger p,
           java.math.BigInteger a,
           java.math.BigInteger b)
    throws java.lang.Exception
A constructor that instantiates an object with prime p and generators a & b.

Throws:
java.lang.Exception
Method Detail

h

public java.math.BigInteger h(java.math.BigInteger x1,
                              java.math.BigInteger x2)
                       throws java.lang.Exception
A method that implements the hash function h.

Throws:
java.lang.Exception

hash

public java.math.BigInteger hash(java.lang.String str)
                          throws java.lang.Exception
A method that implements the function to hash a string to a big integer value.

Specified by:
hash in interface HashFunction
Throws:
java.lang.Exception