diff --git a/brandt.c b/brandt.c index b6d3466..2e6a5ed 100644 --- a/brandt.c +++ b/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); diff --git a/internals.h b/internals.h index 5290110..2b88b6f 100644 --- a/internals.h +++ b/internals.h @@ -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 */ diff --git a/test_brandt.c b/test_brandt.c index b3d9b1e..fb0f2c9 100644 --- a/test_brandt.c +++ b/test_brandt.c @@ -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.");