votingSystem
Class ElectionProperties

java.lang.Object
  extended byvotingSystem.ElectionProperties
All Implemented Interfaces:
java.io.Serializable

public class ElectionProperties
extends java.lang.Object
implements java.io.Serializable

Class to hold the all parameters of an election

Author:
Bent K, Onshus
See Also:
Serialized Form

Constructor Summary
ElectionProperties(int k, int L, int M, int l, int w, int t, int noOfVotes, java.lang.String[] voteNames, int electionType, int[] voteWeights)
          The constructor giving all parameters needed to specify an election, as well as calculating the s to be used in the election.
 
Method Summary
static java.math.BigInteger[] generateVoteValues(int L, int M)
          Generates the values needed to vote for candidates.
 int getElectionType()
           
 int getK()
           
 int getl()
           
 int getL()
           
 int getM()
           
 int getNoOfVotes()
           
 int getS()
           
 int getT()
           
 java.lang.String[] getVoteNames()
           
 java.math.BigInteger[] getVoteValues()
           
 int[] getVoteWeights()
           
 int getW()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElectionProperties

public ElectionProperties(int k,
                          int L,
                          int M,
                          int l,
                          int w,
                          int t,
                          int noOfVotes,
                          java.lang.String[] voteNames,
                          int electionType,
                          int[] voteWeights)
The constructor giving all parameters needed to specify an election, as well as calculating the s to be used in the election.

Parameters:
k - The bitlength of the key
L - The number of candidates
M - The maximum number of voters
l - The number of decryption servers
w - The number of valid KeyShares needed for decrypting the result
t - The bitlength of the challenge used in the zero-knowledge proofs
noOfVotes - Number of votes each voter is given
voteNames - The names of the candidates
electionType - The type of election. 0 if 1-out of L, 1 if k-out-of-L, 2 if 1-out-of-L Binary, 3 if k-out-of-L Binary.
voteWeights - The weight of each vote
Method Detail

generateVoteValues

public static java.math.BigInteger[] generateVoteValues(int L,
                                                        int M)
Generates the values needed to vote for candidates.

Parameters:
L -
M -
Returns:
The values used for votes for all candidates

getK

public int getK()
Returns:
The bitlength of n

getl

public int getl()
Returns:
Number of decryption servers

getL

public int getL()
Returns:
Number of candidates in election

getM

public int getM()
Returns:
Maximum number of voters in the election

getS

public int getS()
Returns:
n^s

getT

public int getT()
Returns:
Bitlength of challenges

getW

public int getW()
Returns:
Number of decryption shares needed to decrypt result.

getVoteValues

public java.math.BigInteger[] getVoteValues()
Returns:
The values needed to vote for each candidate.

getNoOfVotes

public int getNoOfVotes()

getVoteNames

public java.lang.String[] getVoteNames()

getElectionType

public int getElectionType()

getVoteWeights

public int[] getVoteWeights()