votingSystem
Class HashFunction

java.lang.Object
  extended byvotingSystem.HashFunction

public class HashFunction
extends java.lang.Object

This class implements the HashFunction used in the voting system. The standard choice of hash function in this system is the SHA-256 implementation available in the standard Java RE.

Author:
Bent K. Onshus

Constructor Summary
HashFunction(java.lang.String instance)
          Constructs the hash function
 
Method Summary
 java.math.BigInteger generateHash(java.math.BigInteger[] values, int t)
          Generates a hash from the BigIntegers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashFunction

public HashFunction(java.lang.String instance)
Constructs the hash function

Parameters:
instance - The type of hash function (i.e. SHA-1, SHA256, SHA512 etc..)
Method Detail

generateHash

public java.math.BigInteger generateHash(java.math.BigInteger[] values,
                                         int t)
Generates a hash from the BigIntegers

Parameters:
values - An array containing the BigIntegers to be hashed
Returns:
The hash.