aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-09-23 16:31:06 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-09-23 16:31:06 +0200
commite08789c72754944f965a2e3bb4ea2c41f50fa138 (patch)
treec8605f76f0586ab1b238195c4cdec733a8d541bc /crypto.c
parentd6cdd80c8c58e6fa66f1796275616d045f16fad6 (diff)
downloadlibbrandt-e08789c72754944f965a2e3bb4ea2c41f50fa138.tar.gz
libbrandt-e08789c72754944f965a2e3bb4ea2c41f50fa138.zip
fix bug in public first price outcome determination
We have to divide out the amount of bidders to get the correct result.
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto.c b/crypto.c
index 600fbb8..b9f55db 100644
--- a/crypto.c
+++ b/crypto.c
@@ -1191,6 +1191,9 @@ fp_pub_determine_outcome (struct BRANDT_Auction *ad,
1191 dlogi = GNUNET_CRYPTO_ecc_dlog (ec_dlogctx, sum_gamma); 1191 dlogi = GNUNET_CRYPTO_ecc_dlog (ec_dlogctx, sum_gamma);
1192 brandt_assert (dlogi > 0); 1192 brandt_assert (dlogi > 0);
1193 1193
1194 /* all bidders participated with a multiplicative share */
1195 dlogi /= ad->n;
1196
1194 /* can only support up to bits(dlogi) bidders */ 1197 /* can only support up to bits(dlogi) bidders */
1195 brandt_assert (sizeof (int) * 8 - 1 >= ad->n); 1198 brandt_assert (sizeof (int) * 8 - 1 >= ad->n);
1196 for (uint16_t i = 0; i < ad->n; i++) 1199 for (uint16_t i = 0; i < ad->n; i++)