last update 12/27/2023
This is the kotlin/java code for RAVE cryptography. It builds on top of
See RAVE Cryptography Implementation for more information.
Library dependencies are summarized here.
This version is completely self-contained, by including a copy of the electionguard and verificatum jars in it. This means you dont have to install verificatum at all, since egk-rave provides wrappers around the verificatum library.
cd <install-dir>
git clone https://github.com/votingworks/egk-rave.git
cd egk-rave
If you're on a basic Linux and need to install Java and Kotlin the first time:
./scripts/install-basic.sh
To build the code:
./gradlew clean assemble
If the library has changed and you need to update it:
cd ~/dev/github/egk-rave:
git fetch origin
git rebase -i origin/main
Then rebuild the code:
./gradlew clean assemble
~/dev/github/egk-rave:$ ./scripts/runCompleteWorkflow.sh
Runs a complete test of the RAVE workflow and writes the output to the working subdirectory. Sample Output
The components of this workflow are:
- Deletes the working directory and starts fresh.
- Uses famous-names-election.json to create an electionguard manifest.json.
- Create an electiongurad configuration file with default election parameters.
- Runs the electionguard keyceremony to create private trustee keys and a public election key.
- Generates random plaintext ballots from the given manifest.
- Encrypts those ballots with the public key.
- Homomorphically accumulates encrypted ballots into an encrypted tally.
- Uses trustee keys to decrypt the tally.
- Writes encrypted ballots to the format that the verificatum mixnet requires.
- Initializes the verificatum mixnet.
- Shuffles the ballots using two shuffling phases, and writes out the shuffled ballots and their proof of shuffle.
- Copies the needed information from the working directories to the public bulletin board.
- Runs the verificatum verifier on the mixnet proofs.
- Creates a separate encoding of the plaintext ballots to simulate the paper ballot encryption.
- Uses the serial numbers to match the paper ballot encryptions to the mixnet shuffled ballots. Requires knowledge of the trustee keys.
- Compares these with the PEP (Plaintext Equivalence Proof) algorithm.
- Writes out the PEP proofs for each ballot.
- Validates the PEP proofs.
eg/
constants.json
election_config.json
election_initialized.json
encrypted_tally.json
manifest.json
tally.json
encryptedBallots/
eballot-45874.json
eballot-74766.json
...
encryptedPaperBallots/
eballot-1.json
eballot-10.json
eballot-2.json
...
pep/
pepballot-1.json
pepballot-10.json
pepballot-2.json
...
vf/
protocolInput.xml
publicKey.bt
mix1/
Ciphertexts.bt
FullPublicKey.bt
ShuffledCiphertexts.bt
proofs/
PermutationCommittment01.bt
PoSCommittment01.bt
PosReply01.bt
mix2/
Ciphertexts.bt
FullPublicKey.bt
ShuffledCiphertexts.bt
proofs/
PermutationCommittment01.bt
PoSCommittment01.bt
PosReply01.bt
Notes
- encryptedPaperBallots/ and pep/ only exist if pep-compare.sh is run.
- Note that when the "paper ballots" are encrypted, the ballot id is removed.
- John Caron (Rave Cryptography, ElectionGuard Kotlin)
- Dan S. Wallach (ElectionGuard Kotlin)
- Douglas Wikström (Verificatum Mixnet)