votingSystem
Class Validator

java.lang.Object
  extended byvotingSystem.Validator

public class Validator
extends java.lang.Object

This class provides the methods used for validation of Votes

Author:
Bent K. Onshus

Constructor Summary
Validator(ElectionProperties ep, PublicKey pk)
          Creates a Validator for the given ElectionProperties and PublicKey
 
Method Summary
 boolean checkBinaryVote(BinaryVote vote)
          The code for checking if a BinaryVote is of the correct form.
 boolean checkMultipleBinaryVote(MultipleBinaryVotes mVotes)
          The code for checking if the MultipleBinaryVotes are of the correct form.
 boolean checkMultipleVote(MultipleVotes mVotes)
          The code for checking if MultipleVotes is of the correct form.
 boolean checkProof(Vote v)
          The code for checking if a Vote is of the correct form.
 boolean checkShareDecryption(DecryptedShare ds)
          This method verifies the zero-knowledge proof for the decrypted shares acquired from the decryption Servers
 java.math.BigInteger encryptCheck(java.math.BigInteger value, java.math.BigInteger random)
          Optimized encryption algorithm for encrypting a BigInteger with the given random value Mainly used when checking the zero-knowledge proofs.
 java.math.BigInteger encryptCheckUnOptimized(java.math.BigInteger value, java.math.BigInteger random)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator(ElectionProperties ep,
                 PublicKey pk)
Creates a Validator for the given ElectionProperties and PublicKey

Parameters:
ep - The ElectionProperties used in the election
pk - The PublicKey for the election
Method Detail

checkBinaryVote

public boolean checkBinaryVote(BinaryVote vote)
The code for checking if a BinaryVote is of the correct form.

Parameters:
vote - The BinaryVote to be checked for correctness
Returns:
true if the proof is correct.

checkMultipleBinaryVote

public boolean checkMultipleBinaryVote(MultipleBinaryVotes mVotes)
The code for checking if the MultipleBinaryVotes are of the correct form.

Parameters:
mVotes - The MultipleBinaryVotes-object to be checked for correctness
Returns:
true if the proof is correct.

checkMultipleVote

public boolean checkMultipleVote(MultipleVotes mVotes)
The code for checking if MultipleVotes is of the correct form.

Parameters:
mVotes - The MultipleVotes to be checked for correctness
Returns:
true if the proof is correct.

checkProof

public boolean checkProof(Vote v)
The code for checking if a Vote is of the correct form.

Parameters:
v - The Vote to be checked for correctness
Returns:
true if the proof is correct.

encryptCheckUnOptimized

public java.math.BigInteger encryptCheckUnOptimized(java.math.BigInteger value,
                                                    java.math.BigInteger random)

encryptCheck

public java.math.BigInteger encryptCheck(java.math.BigInteger value,
                                         java.math.BigInteger random)
Optimized encryption algorithm for encrypting a BigInteger with the given random value Mainly used when checking the zero-knowledge proofs.

Parameters:
value -
Returns:
The ciphertext and the random value used to hide the plaintext

checkShareDecryption

public boolean checkShareDecryption(DecryptedShare ds)
This method verifies the zero-knowledge proof for the decrypted shares acquired from the decryption Servers

Parameters:
ds - The DecryptedShare to be verified
Returns:
true if the DecryptedShare is correct.