diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-11-22 03:17:01 +0100 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-11-22 03:17:01 +0100 |
commit | 5706e91058ff6aa4b23b6fb13871853a54a5c4d2 (patch) | |
tree | a10f6e774ff6bd9eae30410613f30b90c153ca6a /crypto.h | |
parent | a74e1503752e310fbfc8dda142c5803eff86dc88 (diff) |
add m+1st price auctions with public outcome
Diffstat (limited to 'crypto.h')
-rw-r--r-- | crypto.h | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -188,6 +188,26 @@ struct BRANDT_Result *mp_priv_determine_outcome (struct BRANDT_Auction *ad, uint16_t *len); +void mp_pub_prep_outcome (struct BRANDT_Auction *ad); +unsigned char *mp_pub_compute_outcome (struct BRANDT_Auction *ad, + size_t *buflen); +int mp_pub_recv_outcome (struct BRANDT_Auction *ad, + const unsigned char *buf, + size_t buflen, + uint16_t sender); + +void mp_pub_prep_decryption (struct BRANDT_Auction *ad); +unsigned char *mp_pub_decrypt_outcome (struct BRANDT_Auction *ad, + size_t *buflen); +int mp_pub_recv_decryption (struct BRANDT_Auction *ad, + const unsigned char *buf, + size_t buflen, + uint16_t sender); + +struct BRANDT_Result *mp_pub_determine_outcome (struct BRANDT_Auction *ad, + uint16_t *len); + + /* --- Round dictionaries --- */ typedef void @@ -245,6 +265,8 @@ static const RoundPrep handler_prep[auction_last][outcome_last][msg_last] = { [outcome_public] = { [msg_init] = &smc_prep_keyshare, [msg_bid] = &smc_prep_bid, + [msg_outcome] = &mp_pub_prep_outcome, + [msg_decrypt] = &mp_pub_prep_decryption, }, }, }; @@ -285,6 +307,8 @@ static const MsgIn handler_in[auction_last][outcome_last][msg_last] = { [outcome_public] = { [msg_init] = &smc_recv_keyshare, [msg_bid] = &smc_recv_encrypted_bid, + [msg_outcome] = &mp_pub_recv_outcome, + [msg_decrypt] = &mp_pub_recv_decryption, }, }, }; @@ -326,6 +350,8 @@ static const MsgOut handler_out[auction_last][outcome_last][msg_last] = { [outcome_public] = { [msg_init] = &smc_gen_keyshare, [msg_bid] = &smc_encrypt_bid, + [msg_outcome] = &mp_pub_compute_outcome, + [msg_decrypt] = &mp_pub_decrypt_outcome, }, }, }; @@ -342,13 +368,13 @@ 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] = &mp_priv_determine_outcome, -// [outcome_public] = , + [outcome_public] = &mp_pub_determine_outcome, }, }; |