aboutsummaryrefslogtreecommitdiff
path: root/crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto.h')
-rw-r--r--crypto.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/crypto.h b/crypto.h
index 4c06b4a..8291bc2 100644
--- a/crypto.h
+++ b/crypto.h
@@ -188,6 +188,26 @@ struct BRANDT_Result *mp_priv_determine_outcome (struct BRANDT_Auction *ad,
188 uint16_t *len); 188 uint16_t *len);
189 189
190 190
191void mp_pub_prep_outcome (struct BRANDT_Auction *ad);
192unsigned char *mp_pub_compute_outcome (struct BRANDT_Auction *ad,
193 size_t *buflen);
194int mp_pub_recv_outcome (struct BRANDT_Auction *ad,
195 const unsigned char *buf,
196 size_t buflen,
197 uint16_t sender);
198
199void mp_pub_prep_decryption (struct BRANDT_Auction *ad);
200unsigned char *mp_pub_decrypt_outcome (struct BRANDT_Auction *ad,
201 size_t *buflen);
202int mp_pub_recv_decryption (struct BRANDT_Auction *ad,
203 const unsigned char *buf,
204 size_t buflen,
205 uint16_t sender);
206
207struct BRANDT_Result *mp_pub_determine_outcome (struct BRANDT_Auction *ad,
208 uint16_t *len);
209
210
191/* --- Round dictionaries --- */ 211/* --- Round dictionaries --- */
192 212
193typedef void 213typedef void
@@ -245,6 +265,8 @@ static const RoundPrep handler_prep[auction_last][outcome_last][msg_last] = {
245 [outcome_public] = { 265 [outcome_public] = {
246 [msg_init] = &smc_prep_keyshare, 266 [msg_init] = &smc_prep_keyshare,
247 [msg_bid] = &smc_prep_bid, 267 [msg_bid] = &smc_prep_bid,
268 [msg_outcome] = &mp_pub_prep_outcome,
269 [msg_decrypt] = &mp_pub_prep_decryption,
248 }, 270 },
249 }, 271 },
250}; 272};
@@ -285,6 +307,8 @@ static const MsgIn handler_in[auction_last][outcome_last][msg_last] = {
285 [outcome_public] = { 307 [outcome_public] = {
286 [msg_init] = &smc_recv_keyshare, 308 [msg_init] = &smc_recv_keyshare,
287 [msg_bid] = &smc_recv_encrypted_bid, 309 [msg_bid] = &smc_recv_encrypted_bid,
310 [msg_outcome] = &mp_pub_recv_outcome,
311 [msg_decrypt] = &mp_pub_recv_decryption,
288 }, 312 },
289 }, 313 },
290}; 314};
@@ -326,6 +350,8 @@ static const MsgOut handler_out[auction_last][outcome_last][msg_last] = {
326 [outcome_public] = { 350 [outcome_public] = {
327 [msg_init] = &smc_gen_keyshare, 351 [msg_init] = &smc_gen_keyshare,
328 [msg_bid] = &smc_encrypt_bid, 352 [msg_bid] = &smc_encrypt_bid,
353 [msg_outcome] = &mp_pub_compute_outcome,
354 [msg_decrypt] = &mp_pub_decrypt_outcome,
329 }, 355 },
330 }, 356 },
331}; 357};
@@ -342,13 +368,13 @@ static const MsgOut handler_out[auction_last][outcome_last][msg_last] = {
342 * of 0 means a private outcome, while a value of 1 means public outcome. 368 * of 0 means a private outcome, while a value of 1 means public outcome.
343 */ 369 */
344static const Result handler_res[auction_last][outcome_last] = { 370static const Result handler_res[auction_last][outcome_last] = {
345 [auction_firstPrice] = { 371 [auction_firstPrice] = {
346 [outcome_private] = &fp_priv_determine_outcome, 372 [outcome_private] = &fp_priv_determine_outcome,
347 [outcome_public] = &fp_pub_determine_outcome, 373 [outcome_public] = &fp_pub_determine_outcome,
348 }, 374 },
349 [auction_mPlusFirstPrice] = { 375 [auction_mPlusFirstPrice] = {
350 [outcome_private] = &mp_priv_determine_outcome, 376 [outcome_private] = &mp_priv_determine_outcome,
351// [outcome_public] = , 377 [outcome_public] = &mp_pub_determine_outcome,
352 }, 378 },
353}; 379};
354 380