public firstprice auction working in test_brandt
This commit is contained in:
parent
de5ea20b55
commit
658cb96846
20
brandt.c
20
brandt.c
@ -317,10 +317,11 @@ advance_round (struct BRANDT_Auction *ad,
|
||||
unsigned char *buf;
|
||||
size_t buflen;
|
||||
|
||||
if (!ad->seller_mode && msg_decrypt == ad->cur_round)
|
||||
if (!ad->seller_mode && msg_decrypt == ad->cur_round && !outcome)
|
||||
{
|
||||
/* we are a bidder and successfully parsed the msg_decrypt from the
|
||||
* seller => we can determine the auction result */
|
||||
/* we are a bidder on a private outcome auction and
|
||||
* successfully parsed the msg_decrypt from the seller
|
||||
* => we can determine the auction result */
|
||||
report_outcome (ad, atype, outcome);
|
||||
return;
|
||||
}
|
||||
@ -330,7 +331,13 @@ advance_round (struct BRANDT_Auction *ad,
|
||||
if (!gcry_mpi_test_bit (ad->round_progress, i))
|
||||
return;
|
||||
|
||||
if (ad->seller_mode && msg_decrypt == ad->cur_round)
|
||||
if (msg_decrypt == ad->cur_round)
|
||||
{
|
||||
report_outcome (ad, atype, outcome);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ad->seller_mode && msg_decrypt == ad->cur_round && !ad->outcome_public)
|
||||
{
|
||||
/* all bidders msg_decrypt received, broadcast combined msg_decrypt */
|
||||
if (!handler_out[atype][outcome][ad->cur_round] ||
|
||||
@ -370,8 +377,9 @@ advance_round (struct BRANDT_Auction *ad,
|
||||
return;
|
||||
}
|
||||
|
||||
/* msg_decrypt unicast to seller. All other messages are broadcasted */
|
||||
if (msg_decrypt == ad->cur_round)
|
||||
/* msg_decrypt unicast to seller if private outcome mode.
|
||||
* All other messages are broadcasted */
|
||||
if (msg_decrypt == ad->cur_round && !outcome)
|
||||
ad->ucast (ad->closure, buf, buflen);
|
||||
else
|
||||
ad->bcast (ad->closure, buf, buflen);
|
||||
|
@ -154,8 +154,10 @@ struct BRANDT_Auction {
|
||||
gcry_mpi_point_t **phi2; /** phi2, for public outcome, size: n*k */
|
||||
gcry_mpi_point_t ***phi3; /** phi3, for private outcome, size: n*n*k */
|
||||
|
||||
/** proofs for the correctnes of the phi values for private outcomes,
|
||||
* size: n*n*k */
|
||||
/** proofs for the correctnes of the phi values, size: n*k */
|
||||
struct proof_2dle ***phiproofs2;
|
||||
|
||||
/** proofs for the correctnes of the phi values, size: n*n*k */
|
||||
struct proof_2dle ***phiproofs3;
|
||||
|
||||
gcry_mpi_point_t *tmpa1; /** used for temporary storage, size: k */
|
||||
|
@ -169,7 +169,7 @@ run_new_join (void *arg)
|
||||
GNUNET_TIME_UNIT_MINUTES,
|
||||
prizes, /* amount of possible prizes */
|
||||
0, /* m */
|
||||
0);
|
||||
1); /* outcome public */
|
||||
if (!ad[bidders])
|
||||
{
|
||||
weprintf ("BRANDT_new() failed.");
|
||||
|
Loading…
Reference in New Issue
Block a user