paillierp.zkp
Class ZKP

java.lang.Object
  extended by paillierp.zkp.ZKP
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DecryptionZKP, EncryptionZKP, MultiplicationZKP

public abstract class ZKP
extends java.lang.Object
implements java.io.Serializable

An abstract class for non-interactive Zero Knowledge Proofs. This class gives the simple necessities for creating a Zero Knowledge Proof which uses the hash of values as inputs.

Author:
Sean Hall
See Also:
Serialized Form

Field Summary
protected  java.security.MessageDigest hashFunction
          Instance of a hash function.
private static long serialVersionUID
          This Serial ID
 
Constructor Summary
ZKP()
          Default constructor.
ZKP(java.lang.String hashFunctionName)
          Creates a ZKP with the specified function as the hash function.
 
Method Summary
abstract  java.math.BigInteger getValue()
           
protected  java.math.BigInteger hash(byte[]... byteArrays)
          Creates a hash of the given array of bytes
abstract  byte[] toByteArray()
           
abstract  byte[] toByteArrayNoKey()
           
abstract  boolean verify()
          Verifies that the rehash of the particular variables is indeed the specified hash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
This Serial ID

See Also:
Constant Field Values

hashFunction

protected java.security.MessageDigest hashFunction
Instance of a hash function.

Constructor Detail

ZKP

public ZKP()
Default constructor. Uses SHA-1 as the hash function.


ZKP

public ZKP(java.lang.String hashFunctionName)
Creates a ZKP with the specified function as the hash function.

Parameters:
hashFunctionName - Name of the hash function
Method Detail

hash

protected java.math.BigInteger hash(byte[]... byteArrays)
Creates a hash of the given array of bytes

Parameters:
byteArrays - original array of bytes
Returns:
hash of the concatenation of each element of byteArrays

verify

public abstract boolean verify()
Verifies that the rehash of the particular variables is indeed the specified hash.

Returns:
Description of this proof

toByteArray

public abstract byte[] toByteArray()

toByteArrayNoKey

public abstract byte[] toByteArrayNoKey()

getValue

public abstract java.math.BigInteger getValue()