diff --git a/brandt.c b/brandt.c index d466fff..0c7b40e 100644 --- a/brandt.c +++ b/brandt.c @@ -55,17 +55,26 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction, uint16_t i, uint16_t n) { - GNUNET_assert (auction && n > 0 && i < n); - auction->n = n; - auction->i = i; enum auction_type atype; enum outcome_type outcome; unsigned char *buf; size_t buflen; + GNUNET_assert (auction && n > 0 && i < n); + auction->n = n; + auction->i = i; + atype = auction->m > 0 ? auction_mPlusFirstPrice : auction_firstPrice; outcome = auction->outcome_public ? outcome_public : outcome_private; + /* On M+1st price auctions we multiply the amount of prizes by the amount of + * bidders and resctrict each bidder to his own distinct subset of the + * prices. This is done for tie breaking. An additional proof is used in the + * encrypt_bid round to show that the bidder has chosen a valid bid and the + * outcome callback will remap the result to the original k price values. */ + if (auction_mPlusFirstPrice == atype) + auction->k *= n; + if (handler_prep[atype][outcome][msg_init]) handler_prep[atype][outcome][msg_init] (auction); @@ -102,6 +111,14 @@ seller_start (void *arg) atype = ad->m > 0 ? auction_mPlusFirstPrice : auction_firstPrice; outcome = ad->outcome_public ? outcome_public : outcome_private; + /* On M+1st price auctions we multiply the amount of prizes by the amount of + * bidders and resctrict each bidder to his own distinct subset of the + * prices. This is done for tie breaking. An additional proof is used in the + * encrypt_bid round to show that the bidder has chosen a valid bid and the + * outcome callback will remap the result to the original k price values. */ + if (auction_mPlusFirstPrice == atype) + ad->k *= ad->n; + if (handler_prep[atype][outcome][msg_init]) handler_prep[atype][outcome][msg_init] (ad); }