diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-10-13 23:39:17 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-10-13 23:39:17 +0200 |
commit | 79d427561926066f6e80a8c0ece87e2c218e586e (patch) | |
tree | bd1b93c6bf68726448dd29b5250e2f1aabe85b29 | |
parent | a4c883147d5d80e437bf51dea865d1191496a040 (diff) | |
download | libbrandt-79d427561926066f6e80a8c0ece87e2c218e586e.tar.gz libbrandt-79d427561926066f6e80a8c0ece87e2c218e586e.zip |
blow up k on M+1st price auctions
-rw-r--r-- | brandt.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -55,17 +55,26 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction, | |||
55 | uint16_t i, | 55 | uint16_t i, |
56 | uint16_t n) | 56 | uint16_t n) |
57 | { | 57 | { |
58 | GNUNET_assert (auction && n > 0 && i < n); | ||
59 | auction->n = n; | ||
60 | auction->i = i; | ||
61 | enum auction_type atype; | 58 | enum auction_type atype; |
62 | enum outcome_type outcome; | 59 | enum outcome_type outcome; |
63 | unsigned char *buf; | 60 | unsigned char *buf; |
64 | size_t buflen; | 61 | size_t buflen; |
65 | 62 | ||
63 | GNUNET_assert (auction && n > 0 && i < n); | ||
64 | auction->n = n; | ||
65 | auction->i = i; | ||
66 | |||
66 | atype = auction->m > 0 ? auction_mPlusFirstPrice : auction_firstPrice; | 67 | atype = auction->m > 0 ? auction_mPlusFirstPrice : auction_firstPrice; |
67 | outcome = auction->outcome_public ? outcome_public : outcome_private; | 68 | outcome = auction->outcome_public ? outcome_public : outcome_private; |
68 | 69 | ||
70 | /* On M+1st price auctions we multiply the amount of prizes by the amount of | ||
71 | * bidders and resctrict each bidder to his own distinct subset of the | ||
72 | * prices. This is done for tie breaking. An additional proof is used in the | ||
73 | * encrypt_bid round to show that the bidder has chosen a valid bid and the | ||
74 | * outcome callback will remap the result to the original k price values. */ | ||
75 | if (auction_mPlusFirstPrice == atype) | ||
76 | auction->k *= n; | ||
77 | |||
69 | if (handler_prep[atype][outcome][msg_init]) | 78 | if (handler_prep[atype][outcome][msg_init]) |
70 | handler_prep[atype][outcome][msg_init] (auction); | 79 | handler_prep[atype][outcome][msg_init] (auction); |
71 | 80 | ||
@@ -102,6 +111,14 @@ seller_start (void *arg) | |||
102 | atype = ad->m > 0 ? auction_mPlusFirstPrice : auction_firstPrice; | 111 | atype = ad->m > 0 ? auction_mPlusFirstPrice : auction_firstPrice; |
103 | outcome = ad->outcome_public ? outcome_public : outcome_private; | 112 | outcome = ad->outcome_public ? outcome_public : outcome_private; |
104 | 113 | ||
114 | /* On M+1st price auctions we multiply the amount of prizes by the amount of | ||
115 | * bidders and resctrict each bidder to his own distinct subset of the | ||
116 | * prices. This is done for tie breaking. An additional proof is used in the | ||
117 | * encrypt_bid round to show that the bidder has chosen a valid bid and the | ||
118 | * outcome callback will remap the result to the original k price values. */ | ||
119 | if (auction_mPlusFirstPrice == atype) | ||
120 | ad->k *= ad->n; | ||
121 | |||
105 | if (handler_prep[atype][outcome][msg_init]) | 122 | if (handler_prep[atype][outcome][msg_init]) |
106 | handler_prep[atype][outcome][msg_init] (ad); | 123 | handler_prep[atype][outcome][msg_init] (ad); |
107 | } | 124 | } |