fix bug in public first price outcome determination

We have to divide out the amount of bidders to get the correct result.
This commit is contained in:
Markus Teich 2016-09-23 16:31:06 +02:00
parent d6cdd80c8c
commit e08789c727

View File

@ -1191,6 +1191,9 @@ fp_pub_determine_outcome (struct BRANDT_Auction *ad,
dlogi = GNUNET_CRYPTO_ecc_dlog (ec_dlogctx, sum_gamma); dlogi = GNUNET_CRYPTO_ecc_dlog (ec_dlogctx, sum_gamma);
brandt_assert (dlogi > 0); brandt_assert (dlogi > 0);
/* all bidders participated with a multiplicative share */
dlogi /= ad->n;
/* can only support up to bits(dlogi) bidders */ /* can only support up to bits(dlogi) bidders */
brandt_assert (sizeof (int) * 8 - 1 >= ad->n); brandt_assert (sizeof (int) * 8 - 1 >= ad->n);
for (uint16_t i = 0; i < ad->n; i++) for (uint16_t i = 0; i < ad->n; i++)