Decryption Coordinator

typedef struct Decryption_Coordinator_s* Decryption_Coordinator

Initialization and Freeing

struct Decryption_Coordinator_new_r Decryption_Coordinator_new(uint32_t num_trustees, uint32_t threshold)

Create a new decryption coordinator.

struct Decryption_Coordinator_new_r

Public Members

Decryption_Coordinator_status status
Decryption_Coordinator coordinator
void Decryption_Coordinator_free(Decryption_Coordinator c)

Free a decryption coordinator.

Anouncing

enum Decryption_Coordinator_status Decryption_Coordinator_receive_share(Decryption_Coordinator c, struct decryption_share share)
struct Decryption_Coordinator_all_shares_received_r Decryption_Coordinator_all_shares_received(Decryption_Coordinator c)

Check that at least the threshold number of trustees have sent their shares.

Return a list of share fragments to be provided by each trustee who has sent a share: for each trustee index i from 0 to num_trustees (exclusive), if request_present[i] is true, the caller must pass requests[i] to the appropriate trustee, and must free requests[i].bytes. If status is not DECRYPTION_COORDINATOR_SUCCESS, the client is not responsible for freeing anything.

struct Decryption_Coordinator_all_shares_received_r

Public Members

Decryption_Coordinator_status status
uint32_t num_trustees
bool Decryption_Coordinator_all_shares_received_r::request_present[MAX_TRUSTEES]
struct decryption_fragments_request Decryption_Coordinator_all_shares_received_r::requests[MAX_TRUSTEES]

Compensating

enum Decryption_Coordinator_status Decryption_Coordinator_receive_fragments(Decryption_Coordinator c, struct decryption_fragments fragments)

Receive the requested set of share fragments from a trustee.

enum Decryption_Coordinator_status Decryption_Coordinator_all_fragments_received(Decryption_Coordinator c, FILE * out)

Check that all trustees have sent their share fragments of the missing trustees’ shares.

Write the decrypted total to out.

Status Codes

enum Decryption_Coordinator_status

Values:

DECRYPTION_COORDINATOR_SUCCESS
DECRYPTION_COORDINATOR_INSUFFICIENT_MEMORY
DECRYPTION_COORDINATOR_INVALID_PARAMS
DECRYPTION_COORDINATOR_INVALID_TRUSTEE_INDEX
DECRYPTION_COORDINATOR_DUPLICATE_TRUSTEE_INDEX
DECRYPTION_COORDINATOR_MISSING_TRUSTEES
DECRYPTION_COORDINATOR_IO_ERROR
DECRYPTION_COORDINATOR_SERIALIZE_ERROR
DECRYPTION_COORDINATOR_DESERIALIZE_ERROR