|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoter.Voter
The class for the Client side of the election.
Constructor Summary | |
Voter(int id,
ElectionProperties ep,
PublicKey pk,
java.util.Random rand,
BulletinBoard bb)
Creates a new Voter for the election |
Method Summary | |
java.math.BigInteger[] |
encrypt(int candidate)
Unoptimized encryption algorithm |
MultipleBinaryVotes |
encryptMultipleVoteBinary(int[] candidate)
Encrypts the chosen votes using the method explained as k-out-of-L Binary encoded voting. |
MultipleVotes |
encryptMultipleVotes(int[] candidate)
Encrypts the chosen votes using the method explained as k-out-of-L voting. |
java.math.BigInteger[] |
encryptOptimized(java.math.BigInteger value)
Optimized encryption algorithm for encrypting a BigInteger. |
java.math.BigInteger[] |
encryptOptimized(int candidate)
The optimized encryption algorithm |
Vote |
encryptVote(int candidate)
The method for encrypting a Vote and creating the proof of correctness in the case of 1-out-of-L elections |
BinaryVote |
encryptVoteBinary(int candidate)
Encrypts a vote in the case of 1-out-of-L Binary Voting |
void |
postKofLVote(int[] candidate)
Method for posting a vote to the bulletin board |
void |
postKofLVoteBinary(int[] candidate)
Method for posting a vote to the bulletin board |
void |
postOneofLVote(int candidate)
Method for posting a vote to the bulletin board |
void |
postOneofLVoteBinary(int candidate)
Method for posting a vote to the bulletin board |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Voter(int id, ElectionProperties ep, PublicKey pk, java.util.Random rand, BulletinBoard bb)
id
- The Voter idep
- The ElectionProperties for the electionpk
- The PublicKey for the electionrand
- The random-number generator
IncorrectParameterException
Method Detail |
public void postOneofLVote(int candidate) throws java.rmi.RemoteException, IncorrectVoteException
candidate
-
java.rmi.RemoteException
IncorrectVoteException
public void postKofLVote(int[] candidate) throws java.rmi.RemoteException, IncorrectVoteException
candidate
- Chosen candidates
java.rmi.RemoteException
IncorrectVoteException
public void postOneofLVoteBinary(int candidate) throws java.rmi.RemoteException, IncorrectVoteException
candidate
- Chosen candidate
java.rmi.RemoteException
IncorrectVoteException
public void postKofLVoteBinary(int[] candidate) throws java.rmi.RemoteException, IncorrectVoteException
candidate
- Chosen candidates
java.rmi.RemoteException
IncorrectVoteException
public Vote encryptVote(int candidate) throws IncorrectVoteException
candidate
- The candidate the Client voted for
IncorrectVoteException
public java.math.BigInteger[] encrypt(int candidate)
candidate
-
public java.math.BigInteger[] encryptOptimized(int candidate)
candidate
-
public java.math.BigInteger[] encryptOptimized(java.math.BigInteger value)
value
-
public MultipleVotes encryptMultipleVotes(int[] candidate) throws IncorrectVoteException
candidate
- chosen candidates
IncorrectVoteException
- If any choices were out of bounds, or if incorrect number of votes were cast.public MultipleBinaryVotes encryptMultipleVoteBinary(int[] candidate) throws IncorrectVoteException
candidate
- chosen candidates
IncorrectVoteException
- If any choices were out of bounds, or if incorrect number of votes were cast.public BinaryVote encryptVoteBinary(int candidate) throws IncorrectVoteException
candidate
- The candidate that was voted for
IncorrectVoteException
- If the choice was out of bounds
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |