aboutsummaryrefslogtreecommitdiff
path: root/brandt.c
diff options
context:
space:
mode:
Diffstat (limited to 'brandt.c')
-rw-r--r--brandt.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/brandt.c b/brandt.c
index 1af19b9..03337c4 100644
--- a/brandt.c
+++ b/brandt.c
@@ -20,7 +20,8 @@
* @author Markus Teich
*/
-#include "brandt_config.h"
+#include "platform.h"
+
#include "crypto.h"
#include "internals.h"
#include "util.h"
@@ -52,7 +53,7 @@ BRANDT_init (struct GNUNET_CRYPTO_EccDlogContext *dlogctx)
static void
start_auction (void *arg)
{
- struct BRANDT_Auction *ad = (struct BRANDT_Auction *)arg;
+// struct BRANDT_Auction *ad = (struct BRANDT_Auction *)arg;
/* \todo: broadcast start message to all participants */
}
@@ -64,18 +65,18 @@ BRANDT_new (BRANDT_CbBroadcast broadcast,
void *auction_closure,
void **auction_desc,
size_t *auction_desc_len,
+ const void *description,
+ uint32_t description_len,
struct GNUNET_TIME_Absolute time_start,
struct GNUNET_TIME_Relative time_round,
- void *description,
- uint32_t description_len,
uint16_t num_prices,
uint16_t m,
int outcome_public)
{
struct BRANDT_Auction *ret = GNUNET_new (struct BRANDT_Auction);
struct BRANDT_DescrP *desc = GNUNET_new (struct BRANDT_DescrP);
- struct GNUNET_TIME_Relative until_start;
struct GNUNET_HashContext *hc = GNUNET_CRYPTO_hash_context_start ();
+ struct GNUNET_TIME_Relative until_start;
desc->time_start = GNUNET_TIME_absolute_hton (time_start);
desc->time_round = GNUNET_TIME_relative_hton (time_round);
@@ -220,7 +221,22 @@ BRANDT_join (BRANDT_CbBroadcast broadcast,
void
BRANDT_destroy (struct BRANDT_Auction *auction)
{
- GNUNET_SCHEDULER_cancel (auction->task);
+ if (auction->task)
+ GNUNET_SCHEDULER_cancel (auction->task);
+ gcry_mpi_release (auction->round_progress);
+ gcry_mpi_release (auction->x);
+ smc_free1 (auction->y, auction->n);
+ gcry_mpi_point_release (auction->Y);
+ smc_free2 (auction->alpha, auction->n, auction->k);
+ smc_free2 (auction->beta, auction->n, auction->k);
+ smc_free2 (auction->gamma2, auction->n, auction->k);
+ smc_free3 (auction->gamma3, auction->n, auction->n, auction->k);
+ smc_free2 (auction->delta2, auction->n, auction->k);
+ smc_free3 (auction->delta3, auction->n, auction->n, auction->k);
+ smc_free2 (auction->phi2, auction->n, auction->k);
+ smc_free3 (auction->phi3, auction->n, auction->n, auction->k);
+ smc_free1 (auction->tmpa1, auction->k);
+ smc_free1 (auction->tmpb1, auction->k);
}