aboutsummaryrefslogtreecommitdiff
path: root/test_brandt.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-12-02 12:53:54 +0100
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-12-02 12:53:54 +0100
commite66cbbe44f3708e6d6a30b216035bcccfc8e7207 (patch)
tree5329f963c2eee3af18976862cdfdf9e344dfd109 /test_brandt.c
parent64689a9083fd11a1e482cc86c0417183cdc76ece (diff)
downloadlibbrandt-e66cbbe44f3708e6d6a30b216035bcccfc8e7207.tar.gz
libbrandt-e66cbbe44f3708e6d6a30b216035bcccfc8e7207.zip
move ecdlogctx passing to _join()/_new() functions
Diffstat (limited to 'test_brandt.c')
-rw-r--r--test_brandt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/test_brandt.c b/test_brandt.c
index 47f3711..afc178a 100644
--- a/test_brandt.c
+++ b/test_brandt.c
@@ -50,7 +50,8 @@ struct testcase {
50}; 50};
51 51
52 52
53static struct testcase tcase; 53static struct testcase tcase;
54static struct GNUNET_CRYPTO_EccDlogContext *edc;
54 55
55 56
56static struct BRANDT_Result * 57static struct BRANDT_Result *
@@ -330,7 +331,8 @@ run_auction (void *arg)
330 GNUNET_TIME_UNIT_MINUTES, 331 GNUNET_TIME_UNIT_MINUTES,
331 tcase.k, /* number of prizes */ 332 tcase.k, /* number of prizes */
332 tcase.m, /* m */ 333 tcase.m, /* m */
333 tcase.outcome_public); /* outcome public */ 334 tcase.outcome_public, /* outcome public */
335 tcase.outcome_public ? edc : NULL);
334 if (!tcase.ad[tcase.n]) 336 if (!tcase.ad[tcase.n])
335 { 337 {
336 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "BRANDT_new() failed.\n"); 338 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "BRANDT_new() failed.\n");
@@ -345,7 +347,8 @@ run_auction (void *arg)
345 &tcase.id[i], 347 &tcase.id[i],
346 desc, 348 desc,
347 desc_len, 349 desc_len,
348 tcase.bids[i]); /* bid */ 350 tcase.bids[i], /* bid */
351 tcase.outcome_public ? edc : NULL);
349 if (!tcase.ad[i]) 352 if (!tcase.ad[i])
350 { 353 {
351 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "BRANDT_join() failed.\n"); 354 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "BRANDT_join() failed.\n");
@@ -439,14 +442,13 @@ test_auction (uint16_t n,
439int 442int
440main (int argc, char *argv[]) 443main (int argc, char *argv[])
441{ 444{
442 int ret = 0; 445 int ret = 0;
443 struct GNUNET_CRYPTO_EccDlogContext *edc;
444 446
445 if (GNUNET_OK != GNUNET_log_setup ("test_brandt", "WARNING", NULL)) 447 if (GNUNET_OK != GNUNET_log_setup ("test_brandt", "WARNING", NULL))
446 return 1; 448 return 1;
447 449
448 edc = GNUNET_CRYPTO_ecc_dlog_prepare (1024, 16); 450 edc = GNUNET_CRYPTO_ecc_dlog_prepare (1024, 16);
449 BRANDT_init (edc); 451 BRANDT_init ();
450 452
451 ret |= 0 || 453 ret |= 0 ||
452 // zero bidders 454 // zero bidders