votingSystem
Class ElectionProperties
java.lang.Object
votingSystem.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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 keyL
- The number of candidatesM
- The maximum number of votersl
- The number of decryption serversw
- The number of valid KeyShares needed for decrypting the resultt
- The bitlength of the challenge used in the zero-knowledge proofsnoOfVotes
- Number of votes each voter is givenvoteNames
- The names of the candidateselectionType
- 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
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()