aboutsummaryrefslogtreecommitdiff
path: root/test_crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'test_crypto.c')
-rw-r--r--test_crypto.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/test_crypto.c b/test_crypto.c
index c0e9740..52db0f3 100644
--- a/test_crypto.c
+++ b/test_crypto.c
@@ -257,6 +257,36 @@ test_round1 ()
}
+int
+test_round2 ()
+{
+ uint16_t i, s;
+ unsigned char *bufs[bidders];
+ size_t lens[bidders];
+
+ for (i = 0; i < bidders; i++)
+ {
+ bufs[i] = smc_compute_outcome (&ad[i], &lens[i]);
+ check (bufs[i], "failed to encrypt bid");
+ }
+
+ for (i = 0; i < bidders; i++)
+ {
+ for (s = 0; s < bidders; s++)
+ {
+ if (s == i)
+ continue;
+ check (smc_recv_outcome (&ad[i], bufs[s], lens[s], s),
+ "failed checking outcome");
+ }
+ }
+
+ for (i = 0; i < bidders; i++)
+ free (bufs[i]);
+ return 1;
+}
+
+
void
cleanup_auction_data ()
{
@@ -299,6 +329,7 @@ main (int argc, char *argv[])
run (test_setup_auction_data);
run (test_prologue);
run (test_round1);
+ run (test_round2);
cleanup_auction_data ();
}