Crate cryptoballot[][src]

Expand description

CryptoBallot is a cryptographically secure online voting system, providing secure anonymous voting with end-to-end verifiability.

It is currenly under active development and is not production ready.

CryptoBallot is fundamentally a transaction processor and validator. When transactions are validated in order, it creates an end-to-end verifiable voting system.

Glossary:

  • Transaction 1: Election Transaction - Defines an election, created by an election authority.
  • Transaction 2: KeyGenCommitment Transaction - Trustee commitment to participate in this election.
  • Transaction 3: KeyGenShare Transaction - Trustee Key Generation Share - needed to generate Election Encryption Key.
  • Transaction 4: KeyGenPublicKey Transaction - Trustee’s computation of the Election Encryption Key.
  • Transaction 5: EncryptionKey Transaction - The Encryption Key that will be used by voters to encrypt their vote.
  • Transaction 6: Vote Transaction - Voter’s encrypted vote.
  • Transaction 7: VotingEnd Transaction - Denotes the end of voting.
  • Transaction 8: Mix Transaction - Shuffled and mixed vote for a single contest, created by a trustee.
  • Transaction 9: PartialDecryption Transaction - A partially decrypted vote from a trustee.
  • Transaction 10: Decryption Transaction - A fully decrypted vote .
  • Election Authority - Creates an Election Transaction.
  • Trustee - A group of trustees collectively create the encryption-key, decrypt votes, and run the mixnet. Generally ⅔ of trustees are required to be honest for the CryptoBallot protocol to function.
  • Authenticator - Certifies that a voter can vote an election and ballot.
  • Contest - A single question that voters are voting on.
  • Ballot - A set of contests, usually restricted to a geographic area. A single contest can exist across multiple ballots.

Re-exports

pub extern crate cryptid;
pub extern crate ed25519_dalek;
pub extern crate indexmap;
pub extern crate rand_core;
pub extern crate rsa;
pub extern crate uuid;
pub extern crate x25519_dalek;

Structs

AuthPackage

The Auth Package triplet of election-id, ballot-id, and voter public key

AuthPublicKey

RSA Public Key for blind signing

Authentication

An Authentication is returned by an authenticator, clearing the voter to vote.

Authenticator

An Authenticator is responsible for authenticating a voter as allowed to vote a specific ballot in an election.

Ballot
Candidate
Contest
DecryptionTransaction

Transaction 10: Decryption

ElectionTransaction

Transaction 1: Election

EncryptedShare
EncryptedVote
EncryptionKeyTransaction

Transaction 5: EncryptionKey

Identifier

Transaction identifier

KeyGenCommitmentTransaction

Transaction 2: KeyGenCommitment

KeyGenPublicKeyTransaction

Transaction 4: KeyGenPublicKey

KeyGenShareTransaction

Transaction 3: KeyGenShare

MemStore

A simple store that uses an in-memory BTreeMap

MixConfig
MixTransaction

Transaction 8: Mix

PartialDecryptionTransaction

Transaction 9: Partial Decryption

Signed

A generic signed transaction

TransactionNotFound
Trustee

A group of trustees collectively create the encryption-key, decrypt votes, and run the mixnet.

VoteTransaction

Transaction 6: Vote

VotingEndTransaction

Transaction 7: VotingEnd

Enums

ContestType
Error

Error types

SignedTransaction

A signed transaction

Transaction

An unsigned transaction TODO: Implment From going for specific tx to this emum and vice versa

TransactionType

A transaction type

ValidationError

Transaction Validation errors

Traits

CryptoBallotTransaction

All CryptoBallot transactions implement this trait

Store

A transaction store

Functions

decrypt_vote

Decrypt the vote from the given partial decryptions.

encrypt_vote

Encrypt a vote with the public key provided by the encryption_key transaction (EncryptionKeyTransaction.encryption_key)

encrypted_vote_from_upstream_tx

A convenience function for getting an encrypted-vote from some upstream transaction ID. The upstream transaction should either be a mixnet or a vote transaction.

generate_keypair

Generate an ed25519 keypair

mix

Do a mixnet shuffle This is an expensive and time-consuming operation, so should ideally be offloaded to it’s own thread

verify_mix

Verify mixnet shuffle