Voting Encrypter

typedef struct Voting_Encrypter_s* Voting_Encrypter
struct uid

Public Members

uint64_t len
uint8_t const* bytes
struct Voting_Encrypter_new_r Voting_Encrypter_new(struct uid uid, struct joint_public_key joint_key, uint32_t num_selections)

Create a new encrypter.

Does not transfer ownership of the public key, but creates and allocates a new copy.

struct Voting_Encrypter_new_r

Public Members

Voting_Encrypter_status status
Voting_Encrypter encrypter
void Voting_Encrypter_free(Voting_Encrypter encrypter)

Free a ballot marking device.

Ballot Encryption

struct Voting_Encrypter_encrypt_ballot_r Voting_Encrypter_encrypt_ballot(Voting_Encrypter encrypter, bool const * selections)

Encrypt an unencrypted ballot, producing an encrypted ballot, a ballot tracker, and a ballot identifier.

The caller must free both when done, ie. they own them.

struct Voting_Encrypter_encrypt_ballot_r

Public Members

Voting_Encrypter_status status
struct register_ballot_message message
struct ballot_tracker tracker
struct ballot_identifier id

Status Codes

enum Voting_Encrypter_status

Values:

VOTING_ENCRYPTER_SUCCESS
VOTING_ENCRYPTER_INSUFFICIENT_MEMORY
VOTING_ENCRYPTER_SERIALIZE_ERROR
VOTING_ENCRYPTER_DESERIALIZE_ERROR