From 5ce71329cfa5540aa8bb7091df292fc133bcf8fa Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Sat, 15 Oct 2016 20:33:21 +0200 Subject: add M+1st price private outcome implementation --- crypto.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'crypto.h') diff --git a/crypto.h b/crypto.h index b4344da..35e98a6 100644 --- a/crypto.h +++ b/crypto.h @@ -182,6 +182,12 @@ struct BRANDT_Result *fp_pub_determine_outcome (struct BRANDT_Auction *ad, uint16_t *len); +void mp_priv_prep_outcome (struct BRANDT_Auction *ad); + +struct BRANDT_Result *mp_priv_determine_outcome (struct BRANDT_Auction *ad, + uint16_t *len); + + /* --- Round dictionaries --- */ typedef void @@ -233,6 +239,8 @@ static const RoundPrep handler_prep[auction_last][outcome_last][msg_last] = { [outcome_private] = { [msg_init] = &smc_prep_keyshare, [msg_bid] = &smc_prep_bid, + [msg_outcome] = &mp_priv_prep_outcome, + [msg_decrypt] = &fp_priv_prep_decryption, }, [outcome_public] = { [msg_init] = &smc_prep_keyshare, @@ -271,6 +279,8 @@ static const MsgIn handler_in[auction_last][outcome_last][msg_last] = { [outcome_private] = { [msg_init] = &smc_recv_keyshare, [msg_bid] = &smc_recv_encrypted_bid, + [msg_outcome] = &fp_priv_recv_outcome, + [msg_decrypt] = &fp_priv_recv_decryption, }, [outcome_public] = { [msg_init] = &smc_recv_keyshare, @@ -310,6 +320,8 @@ static const MsgOut handler_out[auction_last][outcome_last][msg_last] = { [outcome_private] = { [msg_init] = &smc_gen_keyshare, [msg_bid] = &smc_encrypt_bid, + [msg_outcome] = &fp_priv_compute_outcome, + [msg_decrypt] = &fp_priv_decrypt_outcome, }, [outcome_public] = { [msg_init] = &smc_gen_keyshare, @@ -330,14 +342,14 @@ static const MsgOut handler_out[auction_last][outcome_last][msg_last] = { * of 0 means a private outcome, while a value of 1 means public outcome. */ static const Result handler_res[auction_last][outcome_last] = { - [auction_firstPrice] = { + [auction_firstPrice] = { [outcome_private] = &fp_priv_determine_outcome, [outcome_public] = &fp_pub_determine_outcome, }, -// [auction_mPlusFirstPrice] = { -// [outcome_private] = , -// [outcome_public] = , -// }, + [auction_mPlusFirstPrice] = { + [outcome_private] = &mp_priv_determine_outcome, +// [outcome_public] = , + }, }; -- cgit v1.2.3