Key Ceremony Coordinator

typedef struct KeyCeremony_Coordinator_s* KeyCeremony_Coordinator

Responsible for coordinating communication between the trustees during the key ceremony.

Initialization and Freeing

struct KeyCeremony_Coordinator_new_r KeyCeremony_Coordinator_new(uint32_t num_trustees, uint32_t threshold)

Create a new coordinator.

struct KeyCeremony_Coordinator_new_r
void KeyCeremony_Coordinator_free(KeyCeremony_Coordinator c)

Free a coordinator.

Key Generation

enum KeyCeremony_Coordinator_status KeyCeremony_Coordinator_receive_key_generated(KeyCeremony_Coordinator c, struct key_generated_message message)

Receive a message indicating that a trustee has generated its key-pair, which contains the trustee’s public key.

Checks the NIZKP of possession of the private key.

struct KeyCeremony_Coordinator_all_keys_received_r KeyCeremony_Coordinator_all_keys_received(KeyCeremony_Coordinator c)

Assert that exactly one key_generated_message from each trustee has been received, and generate an all_keys_generated_message containing all of the public keys.

struct KeyCeremony_Coordinator_all_keys_received_r

Public Members

KeyCeremony_Coordinator_status status
struct all_keys_received_message message

Share Generation

enum KeyCeremony_Coordinator_status KeyCeremony_Coordinator_receive_shares_generated(KeyCeremony_Coordinator c, struct shares_generated_message message)

Receive a message containing a trustees encrypted shares of its private key.

struct KeyCeremony_Coordinator_all_shares_received_r KeyCeremony_Coordinator_all_shares_received(KeyCeremony_Coordinator c)

Assert that exactly one shares_generated_message from each trustee has been received, and generate an all_shares_received_message containing all of the encrypted key shares.

struct KeyCeremony_Coordinator_all_shares_received_r

Verification

enum KeyCeremony_Coordinator_status KeyCeremony_Coordinator_receive_shares_verified(KeyCeremony_Coordinator c, struct shares_verified_message message)

Receive a message indicating that a trustee has verified that the key shares it has received are consistent with the commitments in the public keys of each trustee.

struct KeyCeremony_Coordinator_publish_joint_key_r KeyCeremony_Coordinator_publish_joint_key(KeyCeremony_Coordinator c)

Assert that exactly one shares_verified_message from each trustee has been received, and generate the joint public key to be used to encrypt votes in the election.

struct KeyCeremony_Coordinator_publish_joint_key_r

Public Members

KeyCeremony_Coordinator_status status
struct joint_public_key key

Status Codes

enum KeyCeremony_Coordinator_status

Values:

KEYCEREMONY_COORDINATOR_SUCCESS
KEYCEREMONY_COORDINATOR_INSUFFICIENT_MEMORY
KEYCEREMONY_COORDINATOR_INVALID_PARAMS
KEYCEREMONY_COORDINATOR_DUPLICATE_TRUSTEE_INDEX
KEYCEREMONY_COORDINATOR_INVALID_TRUSTEE_INDEX
KEYCEREMONY_COORDINATOR_MISSING_TRUSTEES
KEYCEREMONY_COORDINATOR_TRUSTEE_INVALIDATION
KEYCEREMONY_COORDINATOR_SERIALIZE_ERROR
KEYCEREMONY_COORDINATOR_DESERIALIZE_ERROR