aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-10-14 23:40:38 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-10-14 23:57:15 +0200
commitda43b9311a53daa9c120735c60e9ba9e1955990c (patch)
treeb5e36fe47b246e270cc862a38b8c3556ed27f3f1
parentfc9fdd313bc08a4f290780dfa1cf9133eddf3bf3 (diff)
downloadlibbrandt-da43b9311a53daa9c120735c60e9ba9e1955990c.tar.gz
libbrandt-da43b9311a53daa9c120735c60e9ba9e1955990c.zip
fix preparation for M+1st price auctions
-rw-r--r--brandt.c3
-rw-r--r--crypto.c4
-rw-r--r--tex-stuff/math.tex20
3 files changed, 18 insertions, 9 deletions
diff --git a/brandt.c b/brandt.c
index 0c7b40e..337de57 100644
--- a/brandt.c
+++ b/brandt.c
@@ -73,7 +73,10 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction,
73 * encrypt_bid round to show that the bidder has chosen a valid bid and the 73 * encrypt_bid round to show that the bidder has chosen a valid bid and the
74 * outcome callback will remap the result to the original k price values. */ 74 * outcome callback will remap the result to the original k price values. */
75 if (auction_mPlusFirstPrice == atype) 75 if (auction_mPlusFirstPrice == atype)
76 {
76 auction->k *= n; 77 auction->k *= n;
78 auction->b = auction->b * n + n - i - 1;
79 }
77 80
78 if (handler_prep[atype][outcome][msg_init]) 81 if (handler_prep[atype][outcome][msg_init])
79 handler_prep[atype][outcome][msg_init] (auction); 82 handler_prep[atype][outcome][msg_init] (auction);
diff --git a/crypto.c b/crypto.c
index 1d0dae3..3e4991d 100644
--- a/crypto.c
+++ b/crypto.c
@@ -741,7 +741,7 @@ smc_encrypt_bid (struct BRANDT_Auction *ad, size_t *buflen)
741 gcry_mpi_addm (r_sum, r_sum, r_part, ec_n); 741 gcry_mpi_addm (r_sum, r_sum, r_part, ec_n);
742 742
743 /* prepare sum for additional M+1st price auction proof (see below) */ 743 /* prepare sum for additional M+1st price auction proof (see below) */
744 if (0 < ad->m && j >= ad->i && 0 == (j - ad->i) % ad->n) 744 if (0 < ad->m && 1 == (ad->k - j - ad->i) % ad->n)
745 gcry_mpi_addm (r_sum2, r_sum2, r_part, ec_n); 745 gcry_mpi_addm (r_sum2, r_sum2, r_part, ec_n);
746 746
747 cur += 2 * sizeof (struct ec_mpi) + sizeof (struct proof_0og); 747 cur += 2 * sizeof (struct ec_mpi) + sizeof (struct proof_0og);
@@ -809,7 +809,7 @@ smc_recv_encrypted_bid (struct BRANDT_Auction *ad,
809 809
810 /* precalculate ciphertext sums for second 2dle proof needed in M+1st 810 /* precalculate ciphertext sums for second 2dle proof needed in M+1st
811 * price auctions */ 811 * price auctions */
812 if (0 < ad->m && j >= ad->i && 0 == (j - ad->i) % ad->n) 812 if (0 < ad->m && 1 == (ad->k - j - sender) % ad->n)
813 { 813 {
814 gcry_mpi_ec_add (alpha_sum2, alpha_sum2, ct[0][j], ec_ctx); 814 gcry_mpi_ec_add (alpha_sum2, alpha_sum2, ct[0][j], ec_ctx);
815 gcry_mpi_ec_add (beta_sum2, beta_sum2, ct[1][j], ec_ctx); 815 gcry_mpi_ec_add (beta_sum2, beta_sum2, ct[1][j], ec_ctx);
diff --git a/tex-stuff/math.tex b/tex-stuff/math.tex
index ae66608..60568cf 100644
--- a/tex-stuff/math.tex
+++ b/tex-stuff/math.tex
@@ -192,13 +192,19 @@ M+1st Price Auction schemes. We took the simplest one, interlacing the bids, so
192that no two bidders are allowed to bid the same price. On the application level 192that no two bidders are allowed to bid the same price. On the application level
193we will still handle $k_{\text{app}}$ different prices, but within libbrandt we 193we will still handle $k_{\text{app}}$ different prices, but within libbrandt we
194will multiply that by a factor of $n$ to get $k_{\text{lib}}=nk_{\text{app}}$. 194will multiply that by a factor of $n$ to get $k_{\text{lib}}=nk_{\text{app}}$.
195Then each bidder $i$ is only allowed to place his bid $b$ on prices $p$ with 195
196$\exists a\in{[1,k_{\text{app}}]}:b=an-i+1$. This condition will be checked by 196The bids are scaled up as well by the mapping $\forall
197an additional proof in the first round of the protocol and ensures that the 197i\in{[1,n]}:b_{i,\text{lib}}=b_{i,\text{app}}n-i+1$. Therefore the set of
198bidders with a lower index win in case of ties. This expansion will be done 198allowed bids for bidder $i$ is defined as $\{j|k_{\text{lib}}-j+1\equiv
199right at the beginning of an auction by libbrandt. In the remaining part about 199i\pmod{n}\}$.
200the M+1st Price Auction Protocols we will use $k$ instead of $k_{\text{lib}}$, 200
201so $k$ will be divisible by $n$ without remainder. 201This restriction will be checked by an additional proof in the first round of
202the protocol and ensures that the bidders with a lower index win in case of
203ties. The expansion will be done right at the beginning of an auction by
204libbrandt and the reverse mapping is applied before reporting the auction
205outcome to the application, so this expansion is transparent to the application.
206In the remaining part about the M+1st Price Auction Protocols we will use $k$
207instead of $k_{\text{lib}}$, so $k$ will be divisible by $n$ without remainder.
202 208
203Unfortunately this tie breaking simplification has the downside of revealing the 209Unfortunately this tie breaking simplification has the downside of revealing the
204identity and bid of the bidder who had the highest bid amongst the losing 210identity and bid of the bidder who had the highest bid amongst the losing