- use proper signedness
[oweals/gnunet.git] / src / regex / regex_internal_dht.c
index 55ca426cbd3331aca2ce31fb870f75af77a1964e..f7d383406d9a5361a2fd0fd7b03333fe568d9945 100644 (file)
@@ -62,7 +62,7 @@ struct REGEX_INTERNAL_Announcement
   /**
    * Our private key.
    */
-  const struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  const struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
 
   /**
    * Optional statistics handle to report usage. Can be NULL.
@@ -121,10 +121,10 @@ regex_iterator (void *cls,
     ab.purpose.purpose = ntohl (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT);
     ab.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_DHT_MAX_EXPIRATION));
     ab.key = *key;
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (h->priv,
+    GNUNET_CRYPTO_eddsa_key_get_public (h->priv,
                                                    &ab.peer.public_key);
     GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CRYPTO_ecc_sign (h->priv,
+                   GNUNET_CRYPTO_eddsa_sign (h->priv,
                                            &ab.purpose,
                                            &ab.signature));
 
@@ -179,7 +179,7 @@ regex_iterator (void *cls,
  */
 struct REGEX_INTERNAL_Announcement *
 REGEX_INTERNAL_announce (struct GNUNET_DHT_Handle *dht,
-                        const struct GNUNET_CRYPTO_EccPrivateKey *priv,
+                        const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
                         const char *regex,
                         uint16_t compression,
                         struct GNUNET_STATISTICS_Handle *stats)
@@ -187,7 +187,7 @@ REGEX_INTERNAL_announce (struct GNUNET_DHT_Handle *dht,
   struct REGEX_INTERNAL_Announcement *h;
 
   GNUNET_assert (NULL != dht);
-  h = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Announcement));
+  h = GNUNET_new (struct REGEX_INTERNAL_Announcement);
   h->regex = regex;
   h->dht = dht;
   h->stats = stats;
@@ -614,7 +614,7 @@ regex_next_edge (const struct RegexBlock *block,
   }
 
   hash = &ctx->hash;
-  new_ctx = GNUNET_malloc (sizeof (struct RegexSearchContext));
+  new_ctx = GNUNET_new (struct RegexSearchContext);
   new_ctx->info = info;
   new_ctx->position = ctx->position + ctx->longest_match;
   GNUNET_array_append (info->contexts, info->n_contexts, new_ctx);
@@ -693,7 +693,7 @@ REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht,
   LOG (GNUNET_ERROR_TYPE_INFO, "REGEX_INTERNAL_search: %s\n", string);
   GNUNET_assert (NULL != dht);
   GNUNET_assert (NULL != callback);
-  h = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Search));
+  h = GNUNET_new (struct REGEX_INTERNAL_Search);
   h->dht = dht;
   h->description = GNUNET_strdup (string);
   h->callback = callback;
@@ -708,7 +708,7 @@ REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht,
   LOG (GNUNET_ERROR_TYPE_INFO,
        "  initial key for %s: %s (%.*s)\n",
        string, GNUNET_h2s (&key), size, string);
-  ctx = GNUNET_malloc (sizeof (struct RegexSearchContext));
+  ctx = GNUNET_new (struct RegexSearchContext);
   ctx->position = size;
   ctx->info = h;
   GNUNET_array_append (h->contexts, h->n_contexts, ctx);