aboutsummaryrefslogtreecommitdiff
path: root/brandt.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-10-13 23:39:17 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-10-13 23:39:17 +0200
commit79d427561926066f6e80a8c0ece87e2c218e586e (patch)
treebd1b93c6bf68726448dd29b5250e2f1aabe85b29 /brandt.c
parenta4c883147d5d80e437bf51dea865d1191496a040 (diff)
blow up k on M+1st price auctions
Diffstat (limited to 'brandt.c')
-rw-r--r--brandt.c23
1 files changed, 20 insertions, 3 deletions
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);
}