aboutsummaryrefslogtreecommitdiff
path: root/brandt.c
diff options
context:
space:
mode:
Diffstat (limited to 'brandt.c')
-rw-r--r--brandt.c20
1 files changed, 14 insertions, 6 deletions
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);