separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA
authorChristian Grothoff <christian@grothoff.org>
Thu, 10 Oct 2013 14:38:55 +0000 (14:38 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 10 Oct 2013 14:38:55 +0000 (14:38 +0000)
131 files changed:
src/ats-tool/gnunet-ats.c
src/core/gnunet-service-core.c
src/core/gnunet-service-core_kx.c
src/core/gnunet-service-core_kx.h
src/dns/plugin_block_dns.c
src/exit/gnunet-daemon-exit.c
src/fs/fs_api.c
src/fs/fs_api.h
src/fs/fs_namespace.c
src/fs/fs_publish.c
src/fs/fs_publish_ksk.c
src/fs/fs_publish_ublock.c
src/fs/fs_publish_ublock.h
src/fs/fs_search.c
src/fs/fs_unindex.c
src/fs/fs_uri.c
src/fs/gnunet-publish.c
src/fs/plugin_block_fs.c
src/fs/test_fs_namespace.c
src/fs/test_fs_namespace_list_updateable.c
src/fs/test_fs_uri.c
src/gns/gns.h
src/gns/gns_api.c
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-helper-service-w32.c
src/gns/gnunet-gns-proxy.c
src/gns/gnunet-gns.c
src/gns/gnunet-service-gns.c
src/gns/gnunet-service-gns_interceptor.c
src/gns/gnunet-service-gns_interceptor.h
src/gns/gnunet-service-gns_resolver.c
src/gns/gnunet-service-gns_resolver.h
src/gns/gnunet-service-gns_shorten.c
src/gns/gnunet-service-gns_shorten.h
src/gns/plugin_block_gns.c
src/gns/test_gns_proxy.c
src/gns/test_gns_pseu_shorten.c
src/gns/test_gns_revocation.c
src/gns/test_gns_simple_shorten.c
src/gns/test_gns_simple_srv_lookup.c
src/gns/test_gns_simple_zkey_lookup.c
src/hello/gnunet-hello.c
src/hello/hello.c
src/hello/test_friend_hello.c
src/hello/test_hello.c
src/identity/gnunet-identity.c
src/identity/gnunet-service-identity.c
src/identity/identity.h
src/identity/identity_api.c
src/include/block_dns.h
src/include/block_fs.h
src/include/block_regex.h
src/include/gnunet_crypto_lib.h
src/include/gnunet_fs_service.h
src/include/gnunet_gns_service.h
src/include/gnunet_hello_lib.h
src/include/gnunet_identity_service.h
src/include/gnunet_multicast_service.h
src/include/gnunet_namestore_plugin.h
src/include/gnunet_namestore_service.h
src/include/gnunet_psyc_service.h
src/include/gnunet_psycstore_plugin.h
src/include/gnunet_psycstore_service.h
src/include/gnunet_revocation_service.h
src/include/gnunet_testing_lib.h
src/mesh/gnunet-mesh.c
src/mesh/gnunet-service-mesh-enc.c
src/mesh/gnunet-service-mesh.c
src/mesh/gnunet-service-mesh_dht.c
src/mesh/gnunet-service-mesh_tunnel.c
src/mesh/gnunet-service-mesh_tunnel.h
src/namestore/gnunet-namestore-fcfsd.c
src/namestore/gnunet-namestore.c
src/namestore/gnunet-service-namestore.c
src/namestore/namestore.h
src/namestore/namestore_api.c
src/namestore/namestore_api_common.c
src/namestore/namestore_api_monitor.c
src/namestore/plugin_namestore_postgres.c
src/namestore/plugin_namestore_sqlite.c
src/namestore/test_namestore_api_blocks.c
src/namestore/test_namestore_api_cache_block.c
src/namestore/test_namestore_api_lookup_public.c
src/namestore/test_namestore_api_monitoring.c
src/namestore/test_namestore_api_monitoring_existing.c
src/namestore/test_namestore_api_put.c
src/namestore/test_namestore_api_remove.c
src/namestore/test_namestore_api_remove_not_existing_record.c
src/namestore/test_namestore_api_store.c
src/namestore/test_namestore_api_store_update.c
src/namestore/test_namestore_api_zone_iteration.c
src/namestore/test_namestore_api_zone_iteration_specific_zone.c
src/namestore/test_namestore_api_zone_iteration_stop.c
src/namestore/test_namestore_api_zone_to_name.c
src/namestore/test_plugin_namestore.c
src/nse/gnunet-service-nse.c
src/peerinfo-tool/gnunet-peerinfo.c
src/peerinfo/gnunet-service-peerinfo.c
src/psycstore/plugin_psycstore_sqlite.c
src/psycstore/psycstore.h
src/psycstore/psycstore_api.c
src/psycstore/test_plugin_psycstore.c
src/psycstore/test_psycstore.c
src/regex/gnunet-daemon-regexprofiler.c
src/regex/gnunet-service-regex.c
src/regex/plugin_block_regex.c
src/regex/regex_internal_dht.c
src/regex/regex_internal_lib.h
src/revocation/gnunet-revocation.c
src/revocation/gnunet-service-revocation.c
src/revocation/revocation.h
src/revocation/revocation_api.c
src/testing/gnunet-testing.c
src/testing/testing.c
src/topology/friends.c
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport.h
src/transport/gnunet-service-transport_blacklist.c
src/transport/gnunet-service-transport_hello.c
src/transport/gnunet-service-transport_hello.h
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_validation.c
src/transport/gnunet-service-transport_validation.h
src/transport/gnunet-transport.c
src/transport/plugin_transport_http_server.c
src/transport/test_plugin_transport.c
src/util/Makefile.am
src/util/common_logging.c
src/util/crypto_ecc.c
src/util/gnunet-ecc.c
src/vpn/gnunet-vpn.c

index 90523652d64efc454bb31ff8fc604f7cdf33ede8..a873ab0f2c66444d31df09eebe3251f7f8504f07 100644 (file)
@@ -352,7 +352,7 @@ testservice_ats (void *cls,
 
   if (NULL != pid_str)
   {
-    if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_sign_key_from_string (pid_str,
+    if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (pid_str,
                                                                    strlen (pid_str),
                                                                    &pid.public_key))
     {
index ada9b7bd99a5b359f12f696aef3035374ebff407..c6eeb070b813903dff2940bd18079c9d6f1a0f62 100644 (file)
@@ -91,7 +91,7 @@ static void
 run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
   char *keyfile;
 
   GSC_cfg = c;
@@ -111,7 +111,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
                                 NULL);
   GNUNET_SERVER_suspend (server);
   GSC_TYPEMAP_init ();
-  pk = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   GNUNET_assert (NULL != pk);
   if ((GNUNET_OK != GSC_KX_init (pk)) ||
index a74b3ae7427379d3b0c808ca11585c40f749639b..25db9c7505b4727a328cec496cb396e2babf35ed 100644 (file)
@@ -90,7 +90,7 @@ struct EphemeralKeyMessage
    * An ECC signature of the 'origin' asserting the validity of
    * the given ephemeral key.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 
   /**
    * Information about what is being signed.
@@ -111,7 +111,7 @@ struct EphemeralKeyMessage
    * Ephemeral public ECC key (always for NIST P-521) encoded in a format suitable
    * for network transmission as created using 'gcry_sexp_sprint'.
    */
-  struct GNUNET_CRYPTO_EccPublicEncryptKey ephemeral_key;
+  struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key;
 
   /**
    * Public key of the signing peer (persistent version, not the ephemeral public key).
@@ -377,12 +377,12 @@ struct GSC_KeyExchangeInfo
 /**
  * Our private key.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 /**
  * Our ephemeral private key.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_ephemeral_key;
+static struct GNUNET_CRYPTO_EcdhePrivateKey *my_ephemeral_key;
 
 /**
  * Current message we send for a key exchange.
@@ -675,7 +675,7 @@ GSC_KX_start (const struct GNUNET_PeerIdentity *pid)
                               kx);
   GNUNET_CRYPTO_hash (pid, sizeof (struct GNUNET_PeerIdentity), &h1);
   GNUNET_CRYPTO_hash (&GSC_my_identity, sizeof (struct GNUNET_PeerIdentity), &h2);
-               
+
   if (0 < GNUNET_CRYPTO_hash_cmp (&h1,
                                  &h2))
   {
@@ -785,10 +785,10 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
        sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
        sizeof (struct GNUNET_TIME_AbsoluteNBO) +
        sizeof (struct GNUNET_TIME_AbsoluteNBO) +
-       sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-       sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) ||
+       sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
+       sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)) ||
       (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY,
+       GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY,
                                 &m->purpose,
                                  &m->signature, &m->origin_identity.public_key)))
   {
@@ -810,7 +810,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
   }
   if (GNUNET_OK !=
       GNUNET_CRYPTO_ecc_ecdh (my_ephemeral_key,
-                             &m->ephemeral_key,                        
+                             &m->ephemeral_key,
                              &key_material))
   {
     GNUNET_break (0);
@@ -1478,8 +1478,8 @@ sign_ephemeral_key ()
   current_ekm.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
                                    sizeof (struct GNUNET_TIME_AbsoluteNBO) +
                                    sizeof (struct GNUNET_TIME_AbsoluteNBO) +
-                                   sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-                                   sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+                                   sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
+                                   sizeof (struct GNUNET_CRYPTO_EddsaPublicKey));
   current_ekm.creation_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
   if (GNUNET_YES ==
       GNUNET_CONFIGURATION_get_value_yesno (GSC_cfg,
@@ -1493,11 +1493,11 @@ sign_ephemeral_key ()
   {
     current_ekm.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_UNIT_FOREVER_ABS);
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_encryption (my_ephemeral_key,
-                                                  &current_ekm.ephemeral_key);
+  GNUNET_CRYPTO_ecdhe_key_get_public (my_ephemeral_key,
+                                      &current_ekm.ephemeral_key);
   current_ekm.origin_identity = GSC_my_identity;
   GNUNET_assert (GNUNET_OK ==
-                GNUNET_CRYPTO_ecc_sign (my_private_key,
+                GNUNET_CRYPTO_eddsa_sign (my_private_key,
                                         &current_ekm.purpose,
                                         &current_ekm.signature));
 }
@@ -1520,7 +1520,7 @@ do_rekey (void *cls,
                                             NULL);
   if (NULL != my_ephemeral_key)
     GNUNET_free (my_ephemeral_key);
-  my_ephemeral_key = GNUNET_CRYPTO_ecc_key_create ();
+  my_ephemeral_key = GNUNET_CRYPTO_ecdhe_key_create ();
   GNUNET_assert (NULL != my_ephemeral_key);
   sign_ephemeral_key ();
   for (pos = kx_head; NULL != pos; pos = pos->next)
@@ -1535,38 +1535,27 @@ do_rekey (void *cls,
  * Initialize KX subsystem.
  *
  * @param pk private key to use for the peer
- * @return GNUNET_OK on success, GNUNET_SYSERR on failure
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
  */
 int
-GSC_KX_init (struct GNUNET_CRYPTO_EccPrivateKey *pk)
+GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
 {
   GNUNET_assert (NULL != pk);
   my_private_key = pk;
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (my_private_key,
                                                  &GSC_my_identity.public_key);
-  if (GNUNET_YES ==
-      GNUNET_CONFIGURATION_get_value_yesno (GSC_cfg,
-                                           "core",
-                                           "USE_EPHEMERAL_KEYS"))
+  my_ephemeral_key = GNUNET_CRYPTO_ecdhe_key_create ();
+  if (NULL == my_ephemeral_key)
   {
-    my_ephemeral_key = GNUNET_CRYPTO_ecc_key_create ();
-    if (NULL == my_ephemeral_key)
-    {
-      GNUNET_break (0);
-      GNUNET_free (my_private_key);
-      my_private_key = NULL;
-      return GNUNET_SYSERR;
-    }
-    sign_ephemeral_key ();
-    rekey_task = GNUNET_SCHEDULER_add_delayed (REKEY_FREQUENCY,
-                                              &do_rekey,
-                                              NULL);
-  }
-  else
-  {
-    my_ephemeral_key = my_private_key;
-    sign_ephemeral_key ();
+    GNUNET_break (0);
+    GNUNET_free (my_private_key);
+    my_private_key = NULL;
+    return GNUNET_SYSERR;
   }
+  sign_ephemeral_key ();
+  rekey_task = GNUNET_SCHEDULER_add_delayed (REKEY_FREQUENCY,
+                                             &do_rekey,
+                                             NULL);
   mst = GNUNET_SERVER_mst_create (&deliver_message, NULL);
   return GNUNET_OK;
 }
@@ -1583,8 +1572,7 @@ GSC_KX_done ()
     GNUNET_SCHEDULER_cancel (rekey_task);
     rekey_task = GNUNET_SCHEDULER_NO_TASK;
   }
-  if ( (NULL != my_ephemeral_key) &&
-       (my_ephemeral_key != my_private_key) )
+  if (NULL != my_ephemeral_key)
   {
     GNUNET_free (my_ephemeral_key);
     my_ephemeral_key = NULL;
index e1b860919d965113c28d09a242b76aea2a840376..4c99669b26b450ce0acf25e0d6519cda92020408 100644 (file)
@@ -121,7 +121,7 @@ GSC_KX_stop (struct GSC_KeyExchangeInfo *kx);
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
 int
-GSC_KX_init (struct GNUNET_CRYPTO_EccPrivateKey *pk);
+GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk);
 
 
 /**
index a8846944eb7ccaea89c9f8c66185aa011b5a96c7..fd76d0ce02973fb007f66773cd2873ac2f4c965e 100644 (file)
@@ -76,7 +76,7 @@ block_plugin_dns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
 
     if (ntohl (ad->purpose.size) !=
         sizeof (struct GNUNET_DNS_Advertisement) -
-        sizeof (struct GNUNET_CRYPTO_EccSignature))
+        sizeof (struct GNUNET_CRYPTO_EddsaSignature))
     {
       GNUNET_break_op (0);
       return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
@@ -90,7 +90,7 @@ block_plugin_dns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
       return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
     }
     if (GNUNET_OK !=
-        GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD,
+        GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD,
                                  &ad->purpose,
                                  &ad->signature,
                                  &ad->peer.public_key))
index f4d656f3ce0da23032e41d8d8a76403faf40496d..5b1f5b6811f608742089942d1d6e10f7a16893f2 100644 (file)
@@ -438,7 +438,7 @@ static struct GNUNET_HashCode dht_put_key;
 /**
  * Private key for this peer.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *peer_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *peer_key;
 
 /**
  * Are we an IPv4-exit?
@@ -3415,7 +3415,7 @@ do_dht_put (void *cls,
     expiration = GNUNET_TIME_relative_to_absolute (DNS_ADVERTISEMENT_TIMEOUT);
     dns_advertisement.expiration_time = GNUNET_TIME_absolute_hton (expiration);
     GNUNET_assert (GNUNET_OK ==
-                  GNUNET_CRYPTO_ecc_sign (peer_key,
+                  GNUNET_CRYPTO_eddsa_sign (peer_key,
                                           &dns_advertisement.purpose,
                                           &dns_advertisement.signature));
   }
@@ -3572,11 +3572,11 @@ run (void *cls, char *const *args GNUNET_UNUSED,
   if (NULL != dns_exit)
   {
     dht = GNUNET_DHT_connect (cfg, 1);
-    peer_key = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (peer_key,
+    peer_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
+    GNUNET_CRYPTO_eddsa_key_get_public (peer_key,
                                                    &dns_advertisement.peer.public_key);
     dns_advertisement.purpose.size = htonl (sizeof (struct GNUNET_DNS_Advertisement) -
-                                           sizeof (struct GNUNET_CRYPTO_EccSignature));
+                                           sizeof (struct GNUNET_CRYPTO_EddsaSignature));
     dns_advertisement.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD);
     GNUNET_CRYPTO_hash ("dns",
                        strlen ("dns"),
index 04057bc9881575e0584e1918f179a46ba9312778..688bdf282c8b49f660200c86e84cbf441c393593 100644 (file)
@@ -1477,7 +1477,7 @@ deserialize_publish_file (void *cls, const char *filename)
   int32_t all_done;
   int32_t have_ns;
   char *fi_root;
-  struct GNUNET_CRYPTO_EccPrivateKey ns;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey ns;
   char *fi_pos;
   char *emsg;
 
@@ -1522,7 +1522,7 @@ deserialize_publish_file (void *cls, const char *filename)
   }
   if (GNUNET_YES == have_ns)
   {
-    pc->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+    pc->ns = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
     *pc->ns = ns;
   }
   if ((0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) &&
@@ -1637,7 +1637,7 @@ GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc)
       ( (NULL != pc->ns) &&
        (GNUNET_OK != GNUNET_BIO_write (wh,
                                        pc->ns,
-                                       sizeof (struct GNUNET_CRYPTO_EccPrivateKey)) ) ))
+                                       sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)) ) ))
   {
     GNUNET_break (0);
     goto cleanup;
index 5858c916c4ee1a8468ea29fca8de60f5dca40245..4b0965f150f7a224e39f35388a3935e80a97e36e 100644 (file)
@@ -128,10 +128,10 @@ struct Location
   struct GNUNET_TIME_Absolute expirationTime;
 
   /**
-   * RSA signature over the GNUNET_EC_FileIdentifier,
-   * GNUNET_hash of the peer and expiration time.
+   * Signature over the GNUNET_EC_FileIdentifier,
+   * peer identity and expiration time.
    */
-  struct GNUNET_CRYPTO_EccSignature contentSignature;
+  struct GNUNET_CRYPTO_EddsaSignature contentSignature;
 
 };
 
@@ -140,24 +140,24 @@ struct Location
  */
 enum GNUNET_FS_UriType
 {
-    /**
-     * Content-hash-key (simple file).
-     */
+  /**
+   * Content-hash-key (simple file).
+   */
   GNUNET_FS_URI_CHK,
 
-    /**
-     * Signed key space (file in namespace).
-     */
+  /**
+   * Signed key space (file in namespace).
+   */
   GNUNET_FS_URI_SKS,
 
-    /**
-     * Keyword search key (query with keywords).
-     */
+  /**
+   * Keyword search key (query with keywords).
+   */
   GNUNET_FS_URI_KSK,
 
-    /**
-     * Location (chk with identity of hosting peer).
-     */
+  /**
+   * Location (chk with identity of hosting peer).
+   */
   GNUNET_FS_URI_LOC
 };
 
@@ -198,7 +198,7 @@ struct GNUNET_FS_Uri
       /**
        * Identifier of the namespace.
        */
-      struct GNUNET_CRYPTO_EccPublicSignKey ns;
+      struct GNUNET_CRYPTO_EcdsaPublicKey ns;
 
       /**
        * Human-readable identifier chosen for this entry in the
@@ -1171,7 +1171,7 @@ struct GNUNET_FS_PublishContext
   /**
    * Namespace that we are publishing in, NULL if we have no namespace.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey *ns;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *ns;
 
   /**
    * ID of the content in the namespace, NULL if we have no namespace.
@@ -1461,7 +1461,7 @@ struct SearchRequestEntry
   /**
    * Derived public key, hashes to 'uquery'.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey dpub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey dpub;
 
   /**
    * The original keyword, used to derive the
index f4cd82978178629003ec7f22b86303cc36aafa4d..39bb397017e4c151ca82de2199caf04beb9456e7 100644 (file)
@@ -92,7 +92,7 @@ struct GNUNET_FS_UpdateInformationGraph
   /**
    * Private key for the namespace.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey ns;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey ns;
 
   /**
    * Hash map mapping identifiers of update nodes
@@ -127,11 +127,11 @@ struct GNUNET_FS_UpdateInformationGraph
  */
 static char *
 get_update_information_directory (struct GNUNET_FS_Handle *h,
-                                 const struct GNUNET_CRYPTO_EccPrivateKey *ns)
+                                 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns)
 {
   char *dn;
   char *ret;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
   struct GNUNET_HashCode hc;
   struct GNUNET_CRYPTO_HashAsciiEncoded enc;
 
@@ -143,7 +143,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h,
                               "fs", "UPDATE_DIR");
     return NULL;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &pub);
+  GNUNET_CRYPTO_ecdsa_key_get_public (ns, &pub);
   GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc);
   GNUNET_CRYPTO_hash_to_enc (&hc,
                             &enc);
@@ -241,7 +241,7 @@ END:
  */
 static struct GNUNET_FS_UpdateInformationGraph *
 read_update_information_graph (struct GNUNET_FS_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPrivateKey *ns)
+                              const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns)
 {
   struct GNUNET_FS_UpdateInformationGraph *uig;
   char *fn;
@@ -346,7 +346,7 @@ struct GNUNET_FS_PublishSksContext
   /**
    * Namespace we're publishing to.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey ns;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey ns;
 
   /**
    * Handle to the datastore.
@@ -434,7 +434,7 @@ sks_publish_cont (void *cls,
  */
 struct GNUNET_FS_PublishSksContext *
 GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
-                       const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                       const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                        const char *identifier, const char *update,
                        const struct GNUNET_CONTAINER_MetaData *meta,
                        const struct GNUNET_FS_Uri *uri,
@@ -448,7 +448,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
   sks_uri = GNUNET_new (struct GNUNET_FS_Uri);
   sks_uri->type = GNUNET_FS_URI_SKS;
   sks_uri->data.sks.identifier = GNUNET_strdup (identifier);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns,
+  GNUNET_CRYPTO_ecdsa_key_get_public (ns,
                                    &sks_uri->data.sks.ns);
 
   psc = GNUNET_new (struct GNUNET_FS_PublishSksContext);
@@ -679,7 +679,7 @@ find_trees (void *cls,
  */
 void
 GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h,
-                                    const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                                      const char *next_id,
                                      GNUNET_FS_IdentifierProcessor ip,
                                      void *ip_cls)
index 387ede6a158f52701c5b8b012246e6630ade96d3..05645f0ab1135023ad8bdfcf1a4abceb91d1fd9d 100644 (file)
@@ -1152,7 +1152,7 @@ finish_reserve (void *cls, int success,
 struct GNUNET_FS_PublishContext *
 GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
                          struct GNUNET_FS_FileInformation *fi,
-                         const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                         const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                         const char *nid,
                          const char *nuid,
                          enum GNUNET_FS_PublishOptions options)
@@ -1177,7 +1177,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
   ret->fi = fi;
   if (NULL != ns)
   {
-    ret->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+    ret->ns = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
     *ret->ns = *ns;
     GNUNET_assert (NULL != nid);
     ret->nid = GNUNET_strdup (nid);
index 6aac94011fec62d78c5997f68ba72137ce495c43..67157f408bfe64175a6b0148cc1951715ad27239 100644 (file)
@@ -170,7 +170,7 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                       pkc->dsh,
                                       keyword + 1 /* skip '+' */,
                                       NULL,
-                                      GNUNET_CRYPTO_ecc_key_get_anonymous (),
+                                      GNUNET_CRYPTO_ecdsa_key_get_anonymous (),
                                       pkc->meta,
                                       pkc->uri,
                                       &pkc->bo,
index 18f4804d17f0f82053c959fd710001063e3f5313..79136607396e05e8ec036842a838761f9bb46bf6 100644 (file)
@@ -46,7 +46,7 @@ static void
 derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
                              struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
                              const char *label,
-                             const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+                             const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
 {
   struct GNUNET_HashCode key;
 
@@ -73,7 +73,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
 void
 GNUNET_FS_ublock_decrypt_ (const void *input,
                           size_t input_len,
-                          const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
+                          const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
                           const char *label,
                           void *output)
 {
@@ -158,7 +158,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
                           struct GNUNET_DATASTORE_Handle *dsh,
                           const char *label,
                           const char *ulabel,
-                          const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                          const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                           const struct GNUNET_CONTAINER_MetaData *meta,
                           const struct GNUNET_FS_Uri *uri,
                           const struct GNUNET_FS_BlockOptions *bo,
@@ -169,8 +169,8 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
   struct GNUNET_HashCode query;
   struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
   struct GNUNET_CRYPTO_SymmetricSessionKey skey;
-  struct GNUNET_CRYPTO_EccPrivateKey *nsd;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *nsd;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
   char *uris;
   size_t size;
   char *kbe;
@@ -225,7 +225,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
              "Publishing under identifier `%s'\n",
               label);
   /* get public key of the namespace */
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns,
+  GNUNET_CRYPTO_ecdsa_key_get_public (ns,
                                    &pub);
   derive_ublock_encryption_key (&skey, &iv,
                                label, &pub);
@@ -238,15 +238,15 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
                              &ub_enc[1]);
   ub_enc->purpose.size = htonl (ulen + slen + mdsize +
                                sizeof (struct UBlock)
-                               - sizeof (struct GNUNET_CRYPTO_EccSignature));
+                               - sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
   ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK);
 
   /* derive signing-key from 'label' and public key of the namespace */
-  nsd = GNUNET_CRYPTO_ecc_key_derive (ns, label, "fs-ublock");
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (nsd,
+  nsd = GNUNET_CRYPTO_ecdsa_private_key_derive (ns, label, "fs-ublock");
+  GNUNET_CRYPTO_ecdsa_key_get_public (nsd,
                                    &ub_enc->verification_key);
   GNUNET_assert (GNUNET_OK ==
-                GNUNET_CRYPTO_ecc_sign (nsd,
+                GNUNET_CRYPTO_ecdsa_sign (nsd,
                                         &ub_enc->purpose,
                                         &ub_enc->signature));
   GNUNET_CRYPTO_hash (&ub_enc->verification_key,
index ed8d599a872262a1f52234ccf70bed838a4dff08..0b22366d54250f648794197ca7358f15939f1913 100644 (file)
@@ -46,7 +46,7 @@
 void
 GNUNET_FS_ublock_decrypt_ (const void *input,
                           size_t input_len,
-                          const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
+                          const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
                           const char *label,
                           void *output);
 
@@ -89,7 +89,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
                           struct GNUNET_DATASTORE_Handle *dsh,
                           const char *label,
                           const char *ulabel,
-                          const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                          const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                           const struct GNUNET_CONTAINER_MetaData *meta,
                           const struct GNUNET_FS_Uri *uri,
                           const struct GNUNET_FS_BlockOptions *bo,
index 11af03646d5c73c905cd785f5a4ded6c7dbde00a..bc35618563e1939185721fc8747e7e872dcd226e 100644 (file)
@@ -679,20 +679,20 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update,
  */
 static int
 decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc,
-                           const struct GNUNET_CRYPTO_EccPublicSignKey *dpub,
+                           const struct GNUNET_CRYPTO_EcdsaPublicKey *dpub,
                            const void *edata,
                            size_t edata_size,
                            char *data)
 {
-  const struct GNUNET_CRYPTO_EccPrivateKey *anon;
-  struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
+  const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon;
+  struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub;
   unsigned int i;
 
   /* find key */
   for (i = 0; i < sc->uri->data.ksk.keywordCount; i++)
     if (0 == memcmp (dpub,
                     &sc->requests[i].dpub,
-                    sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))
+                    sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
       break;
   if (i == sc->uri->data.ksk.keywordCount)
   {
@@ -701,8 +701,8 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc,
     return GNUNET_SYSERR;
   }
   /* decrypt */
-  anon = GNUNET_CRYPTO_ecc_key_get_anonymous ();
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub);
+  anon = GNUNET_CRYPTO_ecdsa_key_get_anonymous ();
+  GNUNET_CRYPTO_ecdsa_key_get_public (anon, &anon_pub);
   GNUNET_FS_ublock_decrypt_ (edata, edata_size,
                             &anon_pub,
                             sc->requests[i].keyword,
@@ -1035,7 +1035,7 @@ transmit_search_request (void *cls, size_t size, void *buf)
   struct MessageBuilderContext mbc;
   size_t msize;
   struct SearchMessage *sm;
-  struct GNUNET_CRYPTO_EccPublicSignKey dpub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey dpub;
   unsigned int sqms;
   uint32_t options;
 
@@ -1102,7 +1102,7 @@ transmit_search_request (void *cls, size_t size, void *buf)
     sm->type = htonl (GNUNET_BLOCK_TYPE_FS_UBLOCK);
     sm->anonymity_level = htonl (sc->anonymity);
     memset (&sm->target, 0, sizeof (struct GNUNET_HashCode));
-    GNUNET_CRYPTO_ecc_public_key_derive (&sc->uri->data.sks.ns,
+    GNUNET_CRYPTO_ecdsa_public_key_derive (&sc->uri->data.sks.ns,
                                         sc->uri->data.sks.identifier,
                                         "fs-ublock",
                                         &dpub);
@@ -1271,16 +1271,16 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc)
 {
   unsigned int i;
   const char *keyword;
-  const struct GNUNET_CRYPTO_EccPrivateKey *anon;
-  struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
+  const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon;
+  struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub;
   struct SearchRequestEntry *sre;
 
   GNUNET_assert (NULL == sc->client);
   if (GNUNET_FS_uri_test_ksk (sc->uri))
   {
     GNUNET_assert (0 != sc->uri->data.ksk.keywordCount);
-    anon = GNUNET_CRYPTO_ecc_key_get_anonymous ();
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub);
+    anon = GNUNET_CRYPTO_ecdsa_key_get_anonymous ();
+    GNUNET_CRYPTO_ecdsa_key_get_public (anon, &anon_pub);
     sc->requests =
         GNUNET_malloc (sizeof (struct SearchRequestEntry) *
                        sc->uri->data.ksk.keywordCount);
@@ -1289,12 +1289,12 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc)
       keyword = &sc->uri->data.ksk.keywords[i][1];
       sre = &sc->requests[i];
       sre->keyword = GNUNET_strdup (keyword);
-      GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub,
+      GNUNET_CRYPTO_ecdsa_public_key_derive (&anon_pub,
                                           keyword,
                                           "fs-ublock",
                                           &sre->dpub);
       GNUNET_CRYPTO_hash (&sre->dpub,
-                         sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                          &sre->uquery);
       sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+');
       if (sre->mandatory)
index 7e189d69711ac5923b0f0223d473cde84d8bf18f..14ab0fd691044d148b7ab5c62817737d7794304b 100644 (file)
@@ -490,10 +490,10 @@ process_kblock_for_unindex (void *cls,
   }
   {
     char pt[size - sizeof (struct UBlock)];
-    struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
+    struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub;
     const char *keyword;
 
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (),
+    GNUNET_CRYPTO_ecdsa_key_get_public (GNUNET_CRYPTO_ecdsa_key_get_anonymous (),
                                                    &anon_pub);
     keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
     GNUNET_FS_ublock_decrypt_ (&ub[1], size - sizeof (struct UBlock),
@@ -550,9 +550,9 @@ void
 GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
 {
   const char *keyword;
-  const struct GNUNET_CRYPTO_EccPrivateKey *anon;
-  struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
-  struct GNUNET_CRYPTO_EccPublicSignKey dpub;
+  const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon;
+  struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey dpub;
 
   if (NULL == uc->dsh)
     uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg);
@@ -570,10 +570,10 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
     unindex_finish (uc);
     return;
   }
-  anon = GNUNET_CRYPTO_ecc_key_get_anonymous ();
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub);
+  anon = GNUNET_CRYPTO_ecdsa_key_get_anonymous ();
+  GNUNET_CRYPTO_ecdsa_key_get_public (anon, &anon_pub);
   keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
-  GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub,
+  GNUNET_CRYPTO_ecdsa_public_key_derive (&anon_pub,
                                       keyword,
                                       "fs-ublock",
                                       &dpub);
index e64fabeba3b7b9d40352176fdc7bc7faf897b3a2..578fc6820cdbcd1962e8870040d9abc9229397ab 100644 (file)
@@ -118,7 +118,7 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
   case GNUNET_FS_URI_LOC:
     GNUNET_CRYPTO_hash (&uri->data.loc.fi,
                         sizeof (struct FileIdentifier) +
-                        sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                        sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                         key);
     break;
   default:
@@ -357,7 +357,7 @@ static struct GNUNET_FS_Uri *
 uri_sks_parse (const char *s, char **emsg)
 {
   struct GNUNET_FS_Uri *ret;
-  struct GNUNET_CRYPTO_EccPublicSignKey ns;
+  struct GNUNET_CRYPTO_EcdsaPublicKey ns;
   size_t pos;
   char *end;
 
@@ -559,7 +559,7 @@ uri_loc_parse (const char *s, char **emsg)
   unsigned long long exptime;
   unsigned long long flen;
   struct GNUNET_TIME_Absolute et;
-  struct GNUNET_CRYPTO_EccSignature sig;
+  struct GNUNET_CRYPTO_EddsaSignature sig;
   struct LocUriAssembly ass;
   int ret;
   size_t slen;
@@ -604,7 +604,7 @@ uri_loc_parse (const char *s, char **emsg)
   npos++;
   ret =
       enc2bin (&s[npos], &ass.peer,
-               sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+               sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
   if (ret == -1)
   {
     *emsg =
@@ -617,7 +617,7 @@ uri_loc_parse (const char *s, char **emsg)
     *emsg = GNUNET_strdup (_("SKS URI malformed (could not find signature)"));
     goto ERR;
   }
-  ret = enc2bin (&s[npos], &sig, sizeof (struct GNUNET_CRYPTO_EccSignature));
+  ret = enc2bin (&s[npos], &sig, sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
   if (ret == -1)
   {
     *emsg = GNUNET_strdup (_("SKS URI malformed (could not decode signature)"));
@@ -641,8 +641,8 @@ uri_loc_parse (const char *s, char **emsg)
   et.abs_value_us = exptime * 1000LL * 1000LL;
   ass.exptime = GNUNET_TIME_absolute_hton (et);
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT,
-                                &ass.purpose, &sig, &ass.peer.public_key))
+      GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT,
+                                  &ass.purpose, &sig, &ass.peer.public_key))
   {
     *emsg =
         GNUNET_strdup (_("SKS URI malformed (signature failed validation)"));
@@ -894,8 +894,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
                           struct GNUNET_TIME_Absolute expiration_time)
 {
   struct GNUNET_FS_Uri *uri;
-  struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
-  struct GNUNET_CRYPTO_EccPublicSignKey my_public_key;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey my_public_key;
   char *keyfile;
   struct LocUriAssembly ass;
   struct GNUNET_TIME_Absolute et;
@@ -910,7 +910,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
                 _("Lacking key configuration settings.\n"));
     return NULL;
   }
-  if (NULL == (my_private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile)))
+  if (NULL == (my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Could not access hostkey file `%s'.\n"), keyfile);
@@ -920,7 +920,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
   GNUNET_free (keyfile);
   /* we round expiration time to full seconds for SKS URIs */
   et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL;
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, &my_public_key);
   ass.purpose.size = htonl (sizeof (struct LocUriAssembly));
   ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT);
   ass.exptime = GNUNET_TIME_absolute_hton (et);
@@ -932,8 +932,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
   uri->data.loc.expirationTime = et;
   uri->data.loc.peer.public_key = my_public_key;
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_CRYPTO_ecc_sign (my_private_key, &ass.purpose,
-                                         &uri->data.loc.contentSignature));
+                 GNUNET_CRYPTO_eddsa_sign (my_private_key, &ass.purpose,
+                                           &uri->data.loc.contentSignature));
   GNUNET_free (my_private_key);
   return uri;
 }
@@ -947,7 +947,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
  * @return an FS URI for the given namespace and identifier
  */
 struct GNUNET_FS_Uri *
-GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
+GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
                          const char *id)
 {
   struct GNUNET_FS_Uri *ns_uri;
@@ -1258,7 +1258,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
   case GNUNET_FS_URI_SKS:
     if ((0 ==
          memcmp (&u1->data.sks.ns, &u2->data.sks.ns,
-                 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) &&
+                 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) &&
         (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier)))
 
       return GNUNET_YES;
@@ -1285,7 +1285,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
     if (memcmp
         (&u1->data.loc, &u2->data.loc,
          sizeof (struct FileIdentifier) +
-         sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
+         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
          sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) +
          sizeof (unsigned short)) != 0)
       return GNUNET_NO;
@@ -1319,7 +1319,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri)
  */
 int
 GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
-                                 struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym)
+                                 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym)
 {
   if (!GNUNET_FS_uri_test_sks (uri))
   {
@@ -1927,7 +1927,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri)
   if (GNUNET_FS_URI_SKS != uri->type)
     return NULL;
   ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns,
-                                      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                                      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                                       buf,
                                       sizeof (buf));
   GNUNET_assert (NULL != ret);
@@ -2032,10 +2032,10 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri)
   GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash);
   peerId =
       bin2enc (&uri->data.loc.peer,
-               sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+               sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
   peerSig =
       bin2enc (&uri->data.loc.contentSignature,
-               sizeof (struct GNUNET_CRYPTO_EccSignature));
+               sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
   GNUNET_asprintf (&ret,
                   "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX,
                    GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash,
index 83dd45a28535e67ec2238bd85e1ed583d31f7aec..7f7423ae5e670d6b7ff7d729b2fb0c1c82a3aca3 100644 (file)
@@ -438,7 +438,7 @@ static void
 uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri,
                       const char *emsg)
 {
-  const struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv;
 
   if (NULL != emsg)
   {
@@ -520,7 +520,7 @@ static void
 directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result)
 {
   struct GNUNET_FS_FileInformation *fi;
-  const struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv;
 
   fi = get_file_information (directory_scan_result);
   GNUNET_FS_share_tree_free (directory_scan_result);
index 9f6791bb5bc16f8718237dd8cf00cbc3561f58f3..36e7f07968897664a3be9cd7ec920f2221657e01 100644 (file)
@@ -105,13 +105,13 @@ block_plugin_fs_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
       GNUNET_break_op (0);
       return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
     }
-    if (reply_block_size != ntohl (ub->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature))
+    if (reply_block_size != ntohl (ub->purpose.size) + sizeof (struct GNUNET_CRYPTO_EcdsaSignature))
     {
       GNUNET_break_op (0);
       return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
     }
     if (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK,
+       GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK,
                                  &ub->purpose,
                                  &ub->signature,
                                  &ub->verification_key))
index b0358e8093adbc373f7e025ddb2ddf8b4cc26a56..c7800812229fbacb6ac173c16e9a2dee7c7a64ac 100644 (file)
@@ -29,7 +29,7 @@
 #include "gnunet_fs_service.h"
 
 
-static struct GNUNET_CRYPTO_EccPublicSignKey nsid;
+static struct GNUNET_CRYPTO_EcdsaPublicKey nsid;
 
 static struct GNUNET_FS_Uri *sks_expect_uri;
 
@@ -237,7 +237,7 @@ static void
 adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
 {
   struct GNUNET_CONTAINER_MetaData *meta;
-  struct GNUNET_CRYPTO_EccPrivateKey *ns;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *ns;
   struct GNUNET_FS_BlockOptions bo;
 
   if (NULL != emsg)
@@ -247,7 +247,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
     GNUNET_FS_stop (fs);
     return;
   }
-  ns = GNUNET_CRYPTO_ecc_key_create ();
+  ns = GNUNET_CRYPTO_ecdsa_key_create ();
   meta = GNUNET_CONTAINER_meta_data_create ();
   sks_expect_uri = GNUNET_FS_uri_dup (uri);
   bo.content_priority = 1;
@@ -255,7 +255,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
   bo.replication_level = 0;
   bo.expiration_time =
       GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &nsid);
+  GNUNET_CRYPTO_ecdsa_key_get_public (ns, &nsid);
   GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri,
                          &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL);
   GNUNET_CONTAINER_meta_data_destroy (meta);
@@ -266,13 +266,13 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
 static void
 testNamespace ()
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *ns;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *ns;
   struct GNUNET_FS_BlockOptions bo;
   struct GNUNET_CONTAINER_MetaData *meta;
   struct GNUNET_FS_Uri *ksk_uri;
   struct GNUNET_FS_Uri *sks_uri;
 
-  ns = GNUNET_CRYPTO_ecc_key_create ();
+  ns = GNUNET_CRYPTO_ecdsa_key_create ();
   meta = GNUNET_CONTAINER_meta_data_create ();
   ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL);
   bo.content_priority = 1;
index 69fc6542c3d876a4a09341e219b91ee70d6e9411..e8cfb2b77b40983446e4defaea1e4ddcc608935d 100644 (file)
@@ -33,7 +33,7 @@ static struct GNUNET_FS_Handle *fs;
 
 static int err;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *ns;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *ns;
 
 static struct GNUNET_CONTAINER_MetaData *meta;
 
@@ -127,7 +127,7 @@ sks_cont_this (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
 static void
 testNamespace ()
 {
-  ns = GNUNET_CRYPTO_ecc_key_create ();
+  ns = GNUNET_CRYPTO_ecdsa_key_create ();
   GNUNET_assert (NULL != ns);
   bo.content_priority = 1;
   bo.anonymity_level = 1;
index 1e1bd8fb8d3deea64491cb1784ba89666549c7d5..2fc5b2a2d4649673ab82b6d2a92b3b215397ad14 100644 (file)
@@ -163,8 +163,8 @@ testNamespace (int i)
   char *uri;
   struct GNUNET_FS_Uri *ret;
   char *emsg;
-  struct GNUNET_CRYPTO_EccPrivateKey *ph;
-  struct GNUNET_CRYPTO_EccPublicSignKey id;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *ph;
+  struct GNUNET_CRYPTO_EcdsaPublicKey id;
   char buf[1024];
   char ubuf[1024];
   char *sret;
@@ -193,8 +193,8 @@ testNamespace (int i)
     GNUNET_assert (0);
   }
   GNUNET_free (emsg);
-  ph = GNUNET_CRYPTO_ecc_key_create ();
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (ph, &id);
+  ph = GNUNET_CRYPTO_ecdsa_key_create ();
+  GNUNET_CRYPTO_ecdsa_key_get_public (ph, &id);
   sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id),
                                        ubuf, sizeof (ubuf) - 1);
   GNUNET_assert (NULL != sret);
index 571b62dc7006fd40cc4695a7d7dc4e098eb6b99e..17a7c7323c243a7709d40a86f2ee6d9e762c8596 100644 (file)
@@ -63,7 +63,7 @@ struct GNUNET_GNS_ClientLookupMessage
   /**
    * Zone that is to be used for lookup
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey zone;
+  struct GNUNET_CRYPTO_EcdsaPublicKey zone;
 
   /**
    * Only check cached results
@@ -83,7 +83,7 @@ struct GNUNET_GNS_ClientLookupMessage
   /**
    * The key for shorten, if @e have_key is set
    */
-  struct GNUNET_CRYPTO_EccPrivateKey shorten_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_key;
 
   /* Followed by the name to look up */
 };
index 75c2f95301cecb05366b23f521f18d5b3e295216..3d58922adbaf0fba8a442303b214c04aba8cd071 100644 (file)
@@ -527,10 +527,10 @@ GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr)
 struct GNUNET_GNS_LookupRequest*
 GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
                   const char *name,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *zone,
+                  const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
                   int type,
                   int only_cached,
-                  const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key,
+                  const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key,
                   GNUNET_GNS_LookupResultProcessor proc,
                   void *proc_cls)
 {
index 42d5ef0e240ee55cdae06771138039d07aa31d0b..6b7afdb59a22824973d4c62ad8069d56d5ce080d 100644 (file)
@@ -143,7 +143,7 @@ static unsigned int listen_port = 53;
 /**
  * Which GNS zone do we translate incoming DNS requests to?
  */
-static struct GNUNET_CRYPTO_EccPublicSignKey my_zone;
+static struct GNUNET_CRYPTO_EcdsaPublicKey my_zone;
 
 /**
  * '-z' option with the main zone to use.
@@ -741,7 +741,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     }
   if ( (NULL == gns_zone_str) ||
        (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_public_sign_key_from_string (gns_zone_str,
+       GNUNET_CRYPTO_ecdsa_public_key_from_string (gns_zone_str,
                                                  strlen (gns_zone_str),
                                                  &my_zone)) )
   {
index 26a3f688ab18dea75c3c7cb8ba415f51da89351e..78eb1e0a3aca1d2389d8715111893c2f81ecb43b 100644 (file)
@@ -61,9 +61,9 @@ struct request
  */
 static struct GNUNET_GNS_Handle *gns;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey *zone = NULL;
+static struct GNUNET_CRYPTO_EcdsaPublicKey *zone = NULL;
 static struct GNUNET_HashCode user_zone;
-struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL;
+struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key = NULL;
 
 
 /**
@@ -662,8 +662,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   };
 
   char* keyfile;
-  struct GNUNET_CRYPTO_EccPrivateKey *key = NULL;
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *key = NULL;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
   struct GNUNET_CRYPTO_HashAsciiEncoded zonename;
 
   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
@@ -677,9 +677,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   {
     if (GNUNET_YES == GNUNET_DISK_file_test (keyfile))
     {
-      key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
-      GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey);
-      GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+      key = GNUNET_CRYPTO_ecdsa_key_create_from_file (keyfile);
+      GNUNET_CRYPTO_ecdsa_key_get_public (key, &pkey);
+      GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
                           &user_zone);
       GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -700,7 +700,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   {
     if (GNUNET_YES == GNUNET_DISK_file_test (keyfile))
     {
-      shorten_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+      shorten_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (keyfile);
     }
     GNUNET_free(keyfile);
   }
index a67f7356eb8348bf6658b9ad21d4270a45adff74..276ea70b0567faf1506231b3f952da738505e311 100644 (file)
@@ -623,12 +623,12 @@ static struct Socks5Request *s5r_tail;
 /**
  * The users local GNS master zone
  */
-static struct GNUNET_CRYPTO_EccPublicSignKey local_gns_zone;
+static struct GNUNET_CRYPTO_EcdsaPublicKey local_gns_zone;
 
 /**
  * The users local shorten zone
  */
-static struct GNUNET_CRYPTO_EccPrivateKey local_shorten_zone;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey local_shorten_zone;
 
 /**
  * Is shortening enabled?
@@ -2864,7 +2864,7 @@ main (int argc, char *const *argv)
                            &run, NULL)) ? 0 : 1;
   MHD_destroy_response (curl_failure_response);
   GNUNET_free_non_null ((char *) argv);
-  GNUNET_CRYPTO_ecc_key_clear (&local_shorten_zone);
+  GNUNET_CRYPTO_ecdsa_key_clear (&local_shorten_zone);
   return ret;
 }
 
index 713f94b92e25a1b54a77ed858ff2a8d6651172ad..0a4275f0d58b60d4f90d76adb145cf3eb9aa9409 100644 (file)
@@ -191,8 +191,8 @@ process_lookup_result (void *cls, uint32_t rd_count,
  * @param shorten_key private key used for shortening, can be NULL
  */
 static void
-lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey,
-                 const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key)
+lookup_with_keys (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey,
+                 const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key)
 {
   if (NULL != lookup_type)
     rtype = GNUNET_NAMESTORE_typename_to_number (lookup_type);
@@ -238,7 +238,7 @@ identity_shorten_cb (void *cls,
                     void **ctx,
                     const char *name)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey *pkeym = cls;
+  struct GNUNET_CRYPTO_EcdsaPublicKey *pkeym = cls;
 
   id_op = NULL;
   if (NULL == ego)
@@ -257,12 +257,12 @@ identity_shorten_cb (void *cls,
  * @param pkey public key to use for the zone
  */
 static void
-lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey)
+lookup_with_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey *pkeym;
+  struct GNUNET_CRYPTO_EcdsaPublicKey *pkeym;
 
   GNUNET_assert (NULL != pkey);
-  pkeym = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey);
+  pkeym = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
   *pkeym = *pkey;
   id_op = GNUNET_IDENTITY_get (identity,
                               "gns-short",
@@ -287,7 +287,7 @@ static void
 identity_zone_cb (void *cls,
                  const struct GNUNET_IDENTITY_Ego *ego)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
 
   el = NULL;
   if (NULL == ego)
@@ -325,7 +325,7 @@ identity_master_cb (void *cls,
                    void **ctx,
                    const char *name)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
 
   id_op = NULL;
   if (NULL == ego)
@@ -352,7 +352,7 @@ static void
 run (void *cls, char *const *args, const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
 
   cfg = c;
   gns = GNUNET_GNS_connect (cfg);
@@ -368,7 +368,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   if (NULL != public_key)
   {
     if (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_public_sign_key_from_string (public_key,
+       GNUNET_CRYPTO_ecdsa_public_key_from_string (public_key,
                                                  strlen (public_key),
                                                  &pkey))
     {
@@ -395,7 +395,7 @@ run (void *cls, char *const *args, const char *cfgfile,
                     &lookup_name[strlen (lookup_name) - 4])) )
   {
     /* no zone required, use 'anonymous' zone */
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (),
+    GNUNET_CRYPTO_ecdsa_key_get_public (GNUNET_CRYPTO_ecdsa_key_get_anonymous (),
                                      &pkey);
     lookup_with_public_key (&pkey);
   }
index 8fcd75e7c37ddf637b99aa10aaec4a5fa6703e6c..d3728ee00ec20bf2da86805cd391ea950dfc970f 100644 (file)
@@ -318,7 +318,7 @@ dht_put_continuation (void *cls,
  */
 static void
 put_gns_record (void *cls,
-                const struct GNUNET_CRYPTO_EccPrivateKey *key,
+                const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
                 const char *name,
                 unsigned int rd_count,
                 const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -414,8 +414,8 @@ put_gns_record (void *cls,
                                         rd_public,
                                         rd_public_count);
   block_size = ntohl (block->purpose.size)
-    + sizeof (struct GNUNET_CRYPTO_EccSignature)
-    + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey);
+    + sizeof (struct GNUNET_CRYPTO_EcdsaSignature)
+    + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
   GNUNET_NAMESTORE_query_from_private_key (key,
                                           name,
                                           &query);
@@ -528,7 +528,7 @@ handle_lookup (void *cls,
   struct ClientLookupHandle *clh;
   char *nameptr = name;
   const char *utf_in;
-  const struct GNUNET_CRYPTO_EccPrivateKey *key;
+  const struct GNUNET_CRYPTO_EcdsaPrivateKey *key;
   uint16_t msg_size;
   const struct GNUNET_GNS_ClientLookupMessage *sh_msg;
 
@@ -630,7 +630,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     { &handle_lookup, NULL, GNUNET_MESSAGE_TYPE_GNS_LOOKUP, 0},
     {NULL, NULL, 0, 0}
   };
-  struct GNUNET_CRYPTO_EccPublicSignKey dns_root;
+  struct GNUNET_CRYPTO_EcdsaPublicKey dns_root;
   unsigned long long max_parallel_bg_queries = 0;
   char *dns_root_name;
 
@@ -683,7 +683,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
                                             &dns_root_name))
   {
     if (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_public_sign_key_from_string (dns_root_name,
+       GNUNET_CRYPTO_ecdsa_public_key_from_string (dns_root_name,
                                                  strlen (dns_root_name),
                                                  &dns_root))
     {
index 8cb1951bf77996be6d0c3a8f6b4df7a58bda9d5f..61568c438615a21739f137fa3890b9b29d296cfb 100644 (file)
@@ -75,7 +75,7 @@ static struct GNUNET_DNS_Handle *dns_handle;
 /**
  * Key of the zone we start lookups in.
  */
-static struct GNUNET_CRYPTO_EccPublicSignKey zone;
+static struct GNUNET_CRYPTO_EcdsaPublicKey zone;
 
 /**
  * Head of the DLL.
@@ -353,7 +353,7 @@ handle_dns_request (void *cls,
  * @return #GNUNET_OK on success
  */
 int
-GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone,
+GNS_interceptor_init (const struct GNUNET_CRYPTO_EcdsaPublicKey *gnu_zone,
                      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
index 5098756458df67e928058d63c3643e9a15c5fbd9..bfcc54017a57078a12f8805b618e4159cec6e2c6 100644 (file)
@@ -36,7 +36,7 @@
  * @return GNUNET_YES on success GNUNET_SYSERR on error
  */
 int
-GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone,
+GNS_interceptor_init (const struct GNUNET_CRYPTO_EcdsaPublicKey *gnu_zone,
                      const struct GNUNET_CONFIGURATION_Handle *c);
 
 /**
index 43d50aed54204615c4be4e0991ac82de381b447f..4b26803ff0c3918c71f0cc4caa403c0ae5cca0f4 100644 (file)
@@ -112,7 +112,7 @@ struct AuthorityChain
     /**
      * The zone of the GNS authority
      */
-    struct GNUNET_CRYPTO_EccPublicSignKey gns_authority;
+    struct GNUNET_CRYPTO_EcdsaPublicKey gns_authority;
 
     struct
     {
@@ -230,7 +230,7 @@ struct GNS_ResolverHandle
   /**
    * The top-level GNS authoritative zone to query
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey authority_zone;
+  struct GNUNET_CRYPTO_EcdsaPublicKey authority_zone;
 
   /**
    * called when resolution phase finishes
@@ -286,7 +286,7 @@ struct GNS_ResolverHandle
   /**
    * Private key of the shorten zone, NULL to not shorten.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey *shorten_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key;
 
   /**
    * ID of a task associated with the resolution process.
@@ -1421,9 +1421,9 @@ handle_gns_resolution_result (void *cls,
        /* tigger shortening */
        if (NULL != rh->shorten_key)
        {
-         struct GNUNET_CRYPTO_EccPublicSignKey pub;
+         struct GNUNET_CRYPTO_EcdsaPublicKey pub;
        
-         if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))
+         if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))
          {
            GNUNET_break_op (0);
            break;
@@ -1454,7 +1454,7 @@ handle_gns_resolution_result (void *cls,
     {
     case GNUNET_NAMESTORE_TYPE_PKEY:
       /* delegation to another zone */
-      if (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) !=
+      if (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) !=
          rd[i].data_size)
       {
        GNUNET_break_op (0);
@@ -1468,7 +1468,7 @@ handle_gns_resolution_result (void *cls,
       ac->gns_authority = GNUNET_YES;
       memcpy (&ac->authority_info.gns_authority,
              rd[i].data,
-             sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+             sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
       ac->label = resolver_lookup_get_next_label (rh);
       /* tigger shortening */
       if (NULL != rh->shorten_key)
@@ -1719,8 +1719,8 @@ handle_dht_response (void *cls,
   block = data;
   if (size !=
       ntohl (block->purpose.size) +
-      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-      sizeof (struct GNUNET_CRYPTO_EccSignature))
+      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+      sizeof (struct GNUNET_CRYPTO_EcdsaSignature))
   {
     /* how did this pass DHT block validation!? */
     GNUNET_break (0);
@@ -1768,7 +1768,7 @@ handle_namestore_block_response (void *cls,
   struct GNS_ResolverHandle *rx;
   struct AuthorityChain *ac = rh->ac_tail;
   const char *label = ac->label;
-  const struct GNUNET_CRYPTO_EccPublicSignKey *auth = &ac->authority_info.gns_authority;
+  const struct GNUNET_CRYPTO_EcdsaPublicKey *auth = &ac->authority_info.gns_authority;
   struct GNUNET_HashCode query;
 
   GNUNET_NAMESTORE_query_from_public_key (auth,
@@ -1947,7 +1947,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh)
     if ( (NULL == x) ||
         (NULL == y) ||
         (GNUNET_OK !=
-         GNUNET_CRYPTO_ecc_public_sign_key_from_string (pkey,
+         GNUNET_CRYPTO_ecdsa_public_key_from_string (pkey,
                                                    strlen (pkey),
                                                    &rh->authority_zone)) )
     {
@@ -1995,10 +1995,10 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh)
  * @return handle to cancel operation
  */
 struct GNS_ResolverHandle *
-GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone,
+GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
                     uint32_t record_type,
                     const char *name,
-                    const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key,
+                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key,
                     int only_cached,
                     GNS_ResultProcessor proc, void *proc_cls)
 {
@@ -2022,7 +2022,7 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone,
   rh->name_resolution_pos = strlen (name);
   if (NULL != shorten_key)
   {
-    rh->shorten_key = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+    rh->shorten_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
     *rh->shorten_key = *shorten_key;
   }
   start_resolver_lookup (rh);
index e9916c77832831c4d2a761d572c13a029a4f517c..06273766a66f1603173a979d3a7a0ee2db0a30d0 100644 (file)
@@ -83,10 +83,10 @@ typedef void (*GNS_ResultProcessor)(void *cls,
  * @return handle to cancel operation
  */
 struct GNS_ResolverHandle *
-GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone,
+GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
                     uint32_t record_type,
                     const char *name,
-                    const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key,
+                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key,
                     int only_cached,
                     GNS_ResultProcessor proc,
                     void *proc_cls);
index ff2cab09739fcfd754de47bdca8675fe76a18e35..f0c96716ae0581e2c1eb2ec935ee30261be8a2b1 100644 (file)
@@ -65,7 +65,7 @@ struct GetPseuAuthorityHandle
    * Private key of the (shorten) zone to store the resulting
    * pseudonym in.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey shorten_zone_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_zone_key;
 
   /**
    * Original label (used if no PSEU record is found).
@@ -80,7 +80,7 @@ struct GetPseuAuthorityHandle
   /**
    * The zone for which we are trying to find the PSEU record.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey target_zone;
+  struct GNUNET_CRYPTO_EcdsaPublicKey target_zone;
 
   /**
    * Handle for DHT lookups. Should be NULL if no lookups are in progress
@@ -195,7 +195,7 @@ process_pseu_block_ns (void *cls,
                       const struct GNUNET_NAMESTORE_Block *block)
 {
   struct GetPseuAuthorityHandle *gph = cls;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
   gph->namestore_task = NULL;
   if (NULL == block)
@@ -203,7 +203,7 @@ process_pseu_block_ns (void *cls,
     process_pseu_lookup_ns (gph, 0, NULL);
     return;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key,
+  GNUNET_CRYPTO_ecdsa_key_get_public (&gph->shorten_zone_key,
                                    &pub);
   if (GNUNET_OK !=
       GNUNET_NAMESTORE_block_decrypt (block,
@@ -229,10 +229,10 @@ static void
 perform_pseu_lookup (struct GetPseuAuthorityHandle *gph,
                     const char *label)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
   struct GNUNET_HashCode query;
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key,
+  GNUNET_CRYPTO_ecdsa_key_get_public (&gph->shorten_zone_key,
                                    &pub);
   GNUNET_free_non_null (gph->current_label);
   gph->current_label = GNUNET_strdup (label);
@@ -287,7 +287,7 @@ process_pseu_lookup_ns (void *cls,
              GNUNET_NAMESTORE_z2s (&gph->target_zone),
              gph->current_label);
   new_pkey.expiration_time = UINT64_MAX;
-  new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey);
+  new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
   new_pkey.data = &gph->target_zone;
   new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   new_pkey.flags = GNUNET_NAMESTORE_RF_NONE
@@ -437,8 +437,8 @@ process_auth_discovery_dht_result (void* cls,
   block = data;
   if (size !=
       ntohl (block->purpose.size) +
-      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-      sizeof (struct GNUNET_CRYPTO_EccSignature))
+      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+      sizeof (struct GNUNET_CRYPTO_EcdsaSignature))
   {
     /* how did this pass DHT block validation!? */
     GNUNET_break (0);
@@ -472,7 +472,7 @@ process_auth_discovery_dht_result (void* cls,
  */
 static void
 process_zone_to_name_discover (void *cls,
-                              const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                              const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                               const char *name,
                               unsigned int rd_len,
                               const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -519,8 +519,8 @@ process_zone_to_name_discover (void *cls,
  */
 void
 GNS_shorten_start (const char *original_label,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
-                  const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone)
+                  const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
+                  const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone)
 {
   struct GetPseuAuthorityHandle *gph;
 
index ed3bdf11fb583d8d12ebd168ad6087059021b6c6..5f583eeb55c321073e1b57feae70eecf73176254 100644 (file)
@@ -59,8 +59,8 @@ GNS_shorten_done (void);
  */
 void
 GNS_shorten_start (const char *original_label,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
-                  const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone);
+                  const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
+                  const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone);
 
 
 #endif
index 9329009100cc974ece9a3d01713f30272c54f43b..ad2e6594e6e6f3b6f592fcc375f3310c36518f93 100644 (file)
@@ -85,7 +85,7 @@ block_plugin_gns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
       return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
     }
   block = reply_block;
-  if (ntohl (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) !=
+  if (ntohl (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EcdsaSignature) + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) !=
       reply_block_size)
     {
       GNUNET_break_op (0);
index 8563eda2fb850a6b78bec394302e88912889406a..66a2eb091de72dd5684449731dc155158088276c 100644 (file)
@@ -364,7 +364,7 @@ run (void *cls,
      struct GNUNET_TESTING_Peer *peer)
 {
   enum MHD_FLAG flags;
-  struct GNUNET_CRYPTO_EccPrivateKey *host_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *host_key;
   struct GNUNET_NAMESTORE_RecordData rd;
   char *zone_keyfile;
 
@@ -421,7 +421,7 @@ run (void *cls,
     return;
   }
 
-  host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile);
+  host_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (zone_keyfile);
   rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
   GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_DNSPARSER_TYPE_A,
                                                                "127.0.0.1",
index a4c337067f47c838ec2ed2266e02dad3de978f38..f4c628cb0198acb75432856c0a88d948cf488e94 100644 (file)
@@ -69,16 +69,16 @@ static struct GNUNET_DHT_Handle *dht_handle;
 
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
-static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
-static struct GNUNET_CRYPTO_EccPublicSignKey our_pkey;
-static struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey;
-static struct GNUNET_CRYPTO_EccPublicSignKey short_pkey;
-static struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *our_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *priv_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *short_key;
+static struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey our_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey priv_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey short_pkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *our_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *short_key;
 static struct GNUNET_CRYPTO_ShortHashCode alice_hash;
 static struct GNUNET_CRYPTO_ShortHashCode bob_hash;
 static struct GNUNET_CRYPTO_ShortHashCode our_zone;
@@ -265,7 +265,7 @@ put_pseu_dht (void *cls, int success)
   struct GNUNET_HashCode zone_hash_double;
   uint32_t rd_payload_length;
   char* nrb_data = NULL;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   struct GNUNET_NAMESTORE_RecordData rd;
 
   memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData));
@@ -316,7 +316,7 @@ put_pseu_dht (void *cls, int success)
   }
   GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash);
   GNUNET_CRYPTO_short_hash(&alice_pkey,
-                     sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+                     sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
                      &zone_hash);
 
   GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
@@ -353,7 +353,7 @@ put_www_dht (void *cls, int success)
   struct GNUNET_HashCode zone_hash_double;
   uint32_t rd_payload_length;
   char* nrb_data = NULL;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   struct GNUNET_NAMESTORE_RecordData rd;
   char* ip = TEST_IP;
   struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
@@ -405,7 +405,7 @@ put_www_dht (void *cls, int success)
   }
   GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash);
   GNUNET_CRYPTO_short_hash(&alice_pkey,
-                     sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+                     sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
                      &zone_hash);
   GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
   GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
@@ -441,7 +441,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg)
   struct GNUNET_HashCode zone_hash_double;
   uint32_t rd_payload_length;
   char* nrb_data = NULL;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   struct GNUNET_NAMESTORE_RecordData rd;
 
   rd.expiration_time = UINT64_MAX;
@@ -488,7 +488,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg)
   GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE,
                            strlen (TEST_AUTHORITY_ALICE), &name_hash);
   GNUNET_CRYPTO_short_hash (&bob_pkey,
-                           sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+                           sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
                            &zone_hash);
   GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
   GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
@@ -616,21 +616,21 @@ do_check (void *cls,
     GNUNET_free (private_keyfile);
     return;
   }
-  our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile);
-  priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile);
-  short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile);
-  bob_key = GNUNET_CRYPTO_ecc_key_create ();
-  alice_key = GNUNET_CRYPTO_ecc_key_create ();
+  our_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (our_keyfile);
+  priv_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (private_keyfile);
+  short_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (shorten_keyfile);
+  bob_key = GNUNET_CRYPTO_ecdsa_key_create ();
+  alice_key = GNUNET_CRYPTO_ecdsa_key_create ();
 
   GNUNET_free (our_keyfile);
   GNUNET_free (shorten_keyfile);
   GNUNET_free (private_keyfile);
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (our_key, &our_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &priv_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (short_key, &short_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey);
   GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash);
   GNUNET_CRYPTO_short_hash (&alice_pkey, sizeof(alice_pkey), &alice_hash);
   GNUNET_CRYPTO_short_hash (&our_pkey, sizeof(our_pkey), &our_zone);
index 30fe5eb664903220ea2d0cac57b599f4e699af85..5be15759a6628d2bf32caed0758e0252e0e95d1e 100644 (file)
@@ -181,12 +181,12 @@ do_check (void *cls,
           const struct GNUNET_CONFIGURATION_Handle *ccfg,
           struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
-  struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
-  struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
-  struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key;
   struct GNUNET_CRYPTO_ShortHashCode bob_hash;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   char* alice_keyfile;
 
   cfg = ccfg;
@@ -210,11 +210,11 @@ do_check (void *cls,
       return;
   }
 
-  alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile);
-  bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB);
+  alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (alice_keyfile);
+  bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB);
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey);
 
   struct GNUNET_NAMESTORE_RecordData rd;
   char* ip = TEST_IP;
index 1b383a0bd242b20f1ba2f97b03873dc80f09beca..a4cfa26dc1ed81eb5f2e569794037c52acb6da45 100644 (file)
@@ -61,10 +61,10 @@ static struct GNUNET_GNS_Handle *gns_handle;
 
 const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey;
-struct GNUNET_CRYPTO_EccPublicSignKey short_pkey;
-struct GNUNET_CRYPTO_EccPrivateKey *priv_key;
-struct GNUNET_CRYPTO_EccPrivateKey *short_key;
+struct GNUNET_CRYPTO_EcdsaPublicKey priv_pkey;
+struct GNUNET_CRYPTO_EcdsaPublicKey short_pkey;
+struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key;
+struct GNUNET_CRYPTO_EcdsaPrivateKey *short_key;
 
 struct GNUNET_CRYPTO_ShortHashCode priv_zone;
 struct GNUNET_CRYPTO_ShortHashCode short_zone;
@@ -170,15 +170,15 @@ void do_check (void *cls,
               const struct GNUNET_CONFIGURATION_Handle *ccfg,
               struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey our_pkey;
-  struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
-  struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
-  struct GNUNET_CRYPTO_EccPrivateKey *our_key;
-  struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
-  struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey our_pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *our_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key;
   struct GNUNET_CRYPTO_ShortHashCode bob_hash;
   struct GNUNET_CRYPTO_ShortHashCode alice_hash;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   char* our_keyfile;
   char* private_keyfile;
   char* shorten_keyfile;
@@ -226,22 +226,22 @@ void do_check (void *cls,
     return;
   }
 
-  our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile);
+  our_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (our_keyfile);
   GNUNET_free(our_keyfile);
 
-  bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB);
-  alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_ALICE);
-  priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile);
-  short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile);
+  bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB);
+  alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_ALICE);
+  priv_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (private_keyfile);
+  short_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (shorten_keyfile);
 
   GNUNET_free(shorten_keyfile);
   GNUNET_free(private_keyfile);
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (our_key, &our_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &priv_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (short_key, &short_pkey);
 
   GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone);
   GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone);
index 76e564f41872c74dc318abe4bf1911e5aba3a8e3..f31ae6daad5853f1be6df2ec0a4a6c05c806eb1b 100644 (file)
@@ -182,12 +182,12 @@ do_check (void *cls,
           const struct GNUNET_CONFIGURATION_Handle *ccfg,
           struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
-  struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
-  struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
-  struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key;
   struct GNUNET_CRYPTO_ShortHashCode bob_hash;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   char* alice_keyfile;
   struct GNUNET_TUN_DnsSrvRecord *srv_data;
   struct GNUNET_TIME_Absolute et;
@@ -213,11 +213,11 @@ do_check (void *cls,
     return;
   }
 
-  alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile);
-  bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB);
+  alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (alice_keyfile);
+  bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB);
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey);
 
   struct GNUNET_NAMESTORE_RecordData rd;
   char* ip = TEST_IP;
index 52a550ebf072df613c3308641d8c11e4a5336f06..a808d2d9dbc9080e95f758c9e32e6041cd64cb40 100644 (file)
@@ -199,11 +199,11 @@ do_check (void *cls,
           const struct GNUNET_CONFIGURATION_Handle *ccfg,
           struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
-  struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
-  struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
-  struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
-  struct GNUNET_CRYPTO_EccSignature *sig;
+  struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key;
+  struct GNUNET_CRYPTO_EcdsaSignature *sig;
   char* alice_keyfile;
 
   cfg = ccfg;
@@ -227,11 +227,11 @@ do_check (void *cls,
     return;
   }
 
-  alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile);
-  bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB);
+  alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (alice_keyfile);
+  bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB);
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey);
 
   struct GNUNET_NAMESTORE_RecordData rd;
   char* ip = TEST_IP;
index 795f4f29b0aaba0e3cd11ca247fa05cd67bf224e..e857bde267681ca67620612ab4a49f83d660116a 100644 (file)
@@ -111,7 +111,7 @@ main (int argc, char *argv[])
   struct GNUNET_DISK_FileHandle *fh;
   struct GNUNET_HELLO_Message *orig;
   struct GNUNET_HELLO_Message *result;
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EddsaPublicKey pk;
   uint64_t fsize;
   address_count = 0;
 
index 6261dcb6bd87ba619c1ff6dcd9c26f5b02a3c51c..37acc599677bf2a62c70f727385bd89d553645bd 100644 (file)
@@ -59,7 +59,7 @@ struct GNUNET_HELLO_Message
   /**
    * The public key of the peer.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
+  struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
 
 };
 GNUNET_NETWORK_STRUCT_END
@@ -218,7 +218,7 @@ get_hello_address_size (const char *buf,
  * @return the hello message
  */
 struct GNUNET_HELLO_Message *
-GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey,
+GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *publicKey,
                      GNUNET_HELLO_GenerateAddressListCallback addrgen,
                      void *addrgen_cls,
                      int friend_only)
@@ -249,7 +249,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey,
   hello->friend_only = htonl (friend_only);
 
   memcpy (&hello->publicKey, publicKey,
-          sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+          sizeof (struct GNUNET_CRYPTO_EddsaPublicKey));
   memcpy (&hello[1], buffer, used);
   return hello;
 }
@@ -530,7 +530,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello)
  */
 int
 GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
-                      struct GNUNET_CRYPTO_EccPublicSignKey *publicKey)
+                      struct GNUNET_CRYPTO_EddsaPublicKey *publicKey)
 {
   uint16_t ret = ntohs (hello->header.size);
 
@@ -669,7 +669,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
 
   if (0 !=
       memcmp (&h1->publicKey, &h2->publicKey,
-              sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))
+              sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
     return GNUNET_TIME_UNIT_ZERO_ABS;
   ec.expiration_limit = now;
   ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -871,7 +871,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello,
   struct GNUNET_HELLO_ComposeUriContext ctx;
   ctx.plugins_find = plugins_find;
 
-  char *pkey = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&(hello->publicKey));
+  char *pkey = GNUNET_CRYPTO_eddsa_public_key_to_string (&(hello->publicKey));
 
   GNUNET_asprintf (&(ctx.uri),
                    "%s%s",
@@ -1044,7 +1044,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer)
  */
 int
 GNUNET_HELLO_parse_uri (const char *uri,
-                        struct GNUNET_CRYPTO_EccPublicSignKey *pubkey,
+                        struct GNUNET_CRYPTO_EddsaPublicKey *pubkey,
                         struct GNUNET_HELLO_Message **hello,
                         GNUNET_HELLO_TransportPluginsFind plugins_find)
 {
index d5f75c824c8c6bb48474871ec10c96fbf96e2b93..019bf4b9a08b3a6daf216addec5a1f67f5cd052e 100644 (file)
@@ -93,8 +93,8 @@ main (int argc, char *argv[])
   struct GNUNET_HELLO_Message *msg1;
   struct GNUNET_HELLO_Message *msg2;
   struct GNUNET_HELLO_Message *msg3;
-  struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
+  struct GNUNET_CRYPTO_EddsaPublicKey pk;
   struct GNUNET_TIME_Absolute startup_time;
   unsigned int i;
 
index f1fa8234af0b2954e3b2f1067a8364985426f5fe..ff80f18896d926f7751181fb6370d7fd7c1bc8b1 100644 (file)
@@ -93,8 +93,8 @@ main (int argc, char *argv[])
   struct GNUNET_HELLO_Message *msg1;
   struct GNUNET_HELLO_Message *msg2;
   struct GNUNET_HELLO_Message *msg3;
-  struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
+  struct GNUNET_CRYPTO_EddsaPublicKey pk;
   struct GNUNET_TIME_Absolute startup_time;
   unsigned int i;
 
index c2c3816047f2436aebd4bc83868767e10dda09d8..8304a707dcd0c822304d28ebf440ec976ab3d1e0 100644 (file)
@@ -226,7 +226,7 @@ print_ego (void *cls,
           void **ctx,
           const char *identifier)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pk;
   char *s;
 
   if ( (NULL != set_ego) &&
@@ -267,7 +267,7 @@ print_ego (void *cls,
   if (NULL == ego)
     return;
   GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
-  s = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pk);
+  s = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
   if ( (monitor) || (NULL != identifier) )
     fprintf (stdout, "%s - %s\n", identifier, s);
   GNUNET_free (s);
index c61286bd51c163be5940089284affc9c5d262274..e0c0bd783a667fc73ec323336bdbc15de841d59d 100644 (file)
@@ -58,7 +58,7 @@ struct Ego
   /**
    * Private key of the ego.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
 
   /**
    * String identifier for the ego.
@@ -370,10 +370,10 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client,
  * @return 0 if the keys are equal
  */
 static int
-key_cmp (const struct GNUNET_CRYPTO_EccPrivateKey *pk1,
-        const struct GNUNET_CRYPTO_EccPrivateKey *pk2)
+key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1,
+        const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2)
 {
-  return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EccPrivateKey));
+  return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
 }
 
 
@@ -517,7 +517,7 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client,
     }
   }
   ego = GNUNET_new (struct Ego);
-  ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+  ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
   *ego->pk = crm->private_key;
   ego->identifier = GNUNET_strdup (str);
   GNUNET_CONTAINER_DLL_insert (ego_head,
@@ -526,10 +526,10 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client,
   send_result_code (client, 0, NULL);
   fn = get_ego_filename (ego);
   (void) GNUNET_DISK_directory_create_for_file (fn);
-  if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) !=
+  if (sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey) !=
       GNUNET_DISK_fn_write (fn,
                            &crm->private_key,
-                           sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+                           sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
                            GNUNET_DISK_PERM_USER_READ |
                            GNUNET_DISK_PERM_USER_WRITE))
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
@@ -819,7 +819,7 @@ process_ego_file (void *cls,
     return GNUNET_OK;
   }
   ego = GNUNET_new (struct Ego);
-  ego->pk = GNUNET_CRYPTO_ecc_key_create_from_file (filename);
+  ego->pk = GNUNET_CRYPTO_ecdsa_key_create_from_file (filename);
   if (NULL == ego->pk)
     {
       GNUNET_free (ego);
index 5e965b2c723039e7d94234dacf07884417a43684..206f08f2a0b9b16217e171a870daa21769290f55 100644 (file)
@@ -81,7 +81,7 @@ struct GNUNET_IDENTITY_UpdateMessage
   /**
    * The private key
    */
-  struct GNUNET_CRYPTO_EccPrivateKey private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
 
   /* followed by 0-terminated identity name */
 
@@ -140,7 +140,7 @@ struct GNUNET_IDENTITY_SetDefaultMessage
   /**
    * The private key
    */
-  struct GNUNET_CRYPTO_EccPrivateKey private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
 
   /* followed by 0-terminated service name */
 
@@ -171,7 +171,7 @@ struct GNUNET_IDENTITY_CreateRequestMessage
   /**
    * The private key
    */
-  struct GNUNET_CRYPTO_EccPrivateKey private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
 
   /* followed by 0-terminated identity name */
 
index dc4613cdb3f93bf0b4fb8490ba2423b487295e5b..931deb509f707bb2f6a86e260bfabd9bb2ceebd3 100644 (file)
@@ -40,7 +40,7 @@ struct GNUNET_IDENTITY_Ego
   /**
    * Private key associated with this ego.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
 
   /**
    * Current name associated with this ego.
@@ -179,12 +179,12 @@ const struct GNUNET_IDENTITY_Ego *
 GNUNET_IDENTITY_ego_get_anonymous ()
 {
   static struct GNUNET_IDENTITY_Ego anon;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
   if (NULL != anon.pk)
     return &anon;
-  anon.pk = (struct GNUNET_CRYPTO_EccPrivateKey *) GNUNET_CRYPTO_ecc_key_get_anonymous ();
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon.pk,
+  anon.pk = (struct GNUNET_CRYPTO_EcdsaPrivateKey *) GNUNET_CRYPTO_ecdsa_key_get_anonymous ();
+  GNUNET_CRYPTO_ecdsa_key_get_public (anon.pk,
                                    &pub);
   GNUNET_CRYPTO_hash (&pub, sizeof (pub), &anon.id);
   return &anon;
@@ -249,7 +249,7 @@ message_handler (void *cls,
   const struct GNUNET_IDENTITY_ResultCodeMessage *rcm;
   const struct GNUNET_IDENTITY_UpdateMessage *um;
   const struct GNUNET_IDENTITY_SetDefaultMessage *sdm;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
   struct GNUNET_HashCode id;
   const char *str;
   uint16_t size;
@@ -326,7 +326,7 @@ message_handler (void *cls,
        h->cb (h->cb_cls, NULL, NULL, NULL);
       break;
     }
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (&um->private_key,
+    GNUNET_CRYPTO_ecdsa_key_get_public (&um->private_key,
                                      &pub);
     GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id);
     if (0 == name_len)
@@ -346,7 +346,7 @@ message_handler (void *cls,
        return;
       }
       ego = GNUNET_new (struct GNUNET_IDENTITY_Ego);
-      ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+      ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
       *ego->pk = um->private_key;
       ego->name = GNUNET_strdup (str);
       ego->id = id;
@@ -406,7 +406,7 @@ message_handler (void *cls,
     }
     /* Note: we know which service this should be for, so we're not
        really using 'str' henceforth */
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (&sdm->private_key,
+    GNUNET_CRYPTO_ecdsa_key_get_public (&sdm->private_key,
                                      &pub);
     GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id);
     ego = GNUNET_CONTAINER_multihashmap_get (h->egos,
@@ -591,7 +591,7 @@ GNUNET_IDENTITY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
  * @param ego the ego
  * @return associated ECC key, valid as long as the ego is valid
  */
-const struct GNUNET_CRYPTO_EccPrivateKey *
+const struct GNUNET_CRYPTO_EcdsaPrivateKey *
 GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego)
 {
   return ego->pk;
@@ -606,9 +606,9 @@ GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego)
  */
 void
 GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego,
-                                   struct GNUNET_CRYPTO_EccPublicSignKey *pk)
+                                   struct GNUNET_CRYPTO_EcdsaPublicKey *pk)
 {
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (ego->pk,
+  GNUNET_CRYPTO_ecdsa_key_get_public (ego->pk,
                                    pk);
 }
 
@@ -730,11 +730,11 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id,
 {
   struct GNUNET_IDENTITY_Operation *op;
   struct GNUNET_IDENTITY_CreateRequestMessage *crm;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
   size_t slen;
 
   slen = strlen (name) + 1;
-  pk = GNUNET_CRYPTO_ecc_key_create ();
+  pk = GNUNET_CRYPTO_ecdsa_key_create ();
 
   if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct GNUNET_IDENTITY_CreateRequestMessage))
   {
index 650b3bc140c98c37b067395246a7e160fdd78552..9bfaac1c65d95141178b10119e996ea637dfdab6 100644 (file)
@@ -37,7 +37,7 @@ struct GNUNET_DNS_Advertisement
   /**
    * Signature of the peer affirming that he is offering the service.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 
   /**
    * Beginning of signed portion of the record, signs everything until
index 3a0afba149ada727a42f8ce08a60b98466ca05fb..3f904caeb7619fa09b2cecade08e6844e07fbdb6 100644 (file)
@@ -48,7 +48,7 @@ struct UBlock
   /**
    * Signature using pseudonym and search keyword / identifier.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
 
   /**
    * What is being signed and why?
@@ -58,7 +58,7 @@ struct UBlock
   /**
    * Public key used to sign this block.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey verification_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey verification_key;
 
   /* rest of the data is encrypted */
 
index 77f778c95a1d0a7b50d51e484489220bc152ffe9..326183d567082bb6580cf50b51939ab6e74b2477 100644 (file)
@@ -72,7 +72,7 @@ struct RegexAcceptBlock
   /**
    * The signature.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 };
 
 
index bd1a2f3bf1f676ef1f08c87186380b8a3e2cdeac..da4de4c878f5b7e370529abb4326987ad08cf827 100644 (file)
@@ -148,9 +148,10 @@ struct GNUNET_CRYPTO_EccSignaturePurpose
 
 
 /**
- * @brief an ECC signature
+ * @brief an ECC signature using EdDSA.
+ * See https://gnunet.org/ed25519
  */
-struct GNUNET_CRYPTO_EccSignature
+struct GNUNET_CRYPTO_EddsaSignature
 {
 
   /**
@@ -166,11 +167,54 @@ struct GNUNET_CRYPTO_EccSignature
 };
 
 
+
 /**
- * Public ECC key (always for NIST P-521) encoded in a format suitable
- * for network transmission and signatures (ECDSA/EdDSA).
+ * @brief an ECC signature using ECDSA
  */
-struct GNUNET_CRYPTO_EccPublicSignKey
+struct GNUNET_CRYPTO_EcdsaSignature
+{
+
+  /**
+   * R value.
+   */
+  unsigned char r[256 / 8];
+
+  /**
+   * S value.
+   */
+  unsigned char s[256 / 8];
+
+};
+
+
+/**
+ * Public ECC key (always for Curve25519) encoded in a format suitable
+ * for network transmission and EdDSA signatures.
+ */
+struct GNUNET_CRYPTO_EddsaPublicKey
+{
+  /**
+   * Q consists of an x- and a y-value, each mod p (256 bits),
+   * given here in affine coordinates.
+   *
+   * FIXME: this coordinate will be removed in the future (compressed point!).
+   */
+  unsigned char q_x[256 / 8];
+
+  /**
+   * Q consists of an x- and a y-value, each mod p (256 bits),
+   * given here in affine coordinates.
+   */
+  unsigned char q_y[256 / 8];
+
+};
+
+
+/**
+ * Public ECC key (always for Curve25519) encoded in a format suitable
+ * for network transmission and ECDSA signatures.
+ */
+struct GNUNET_CRYPTO_EcdsaPublicKey
 {
   /**
    * Q consists of an x- and a y-value, each mod p (256 bits),
@@ -194,15 +238,16 @@ struct GNUNET_CRYPTO_EccPublicSignKey
  */
 struct GNUNET_PeerIdentity
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey public_key;
 };
 
 
 /**
- * Public ECC key (always for NIST P-521) encoded in a format suitable
- * for network transmission and encryption (ECDH).
+ * Public ECC key (always for Curve25519) encoded in a format suitable
+ * for network transmission and encryption (ECDH),
+ * See http://cr.yp.to/ecdh.html
  */
-struct GNUNET_CRYPTO_EccPublicEncryptKey
+struct GNUNET_CRYPTO_EcdhePublicKey
 {
   /**
    * Q consists of an x- and a y-value, each mod p (256 bits),
@@ -222,9 +267,36 @@ struct GNUNET_CRYPTO_EccPublicEncryptKey
 
 
 /**
- * Private ECC key encoded for transmission.
+ * Private ECC key encoded for transmission.  To be used only for ECDH
+ * key exchange (ECDHE to be precise).
  */
-struct GNUNET_CRYPTO_EccPrivateKey
+struct GNUNET_CRYPTO_EcdhePrivateKey
+{
+  /**
+   * d is a value mod n, where n has at most 256 bits.
+   */
+  unsigned char d[256 / 8];
+
+};
+
+/**
+ * Private ECC key encoded for transmission.  To be used only for ECDSA
+ * signatures.
+ */
+struct GNUNET_CRYPTO_EcdsaPrivateKey
+{
+  /**
+   * d is a value mod n, where n has at most 256 bits.
+   */
+  unsigned char d[256 / 8];
+
+};
+
+/**
+ * Private ECC key encoded for transmission.  To be used only for EdDSA
+ * signatures.
+ */
+struct GNUNET_CRYPTO_EddsaPrivateKey
 {
   /**
    * d is a value mod n, where n has at most 256 bits.
@@ -743,11 +815,11 @@ GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
  * @param xtr_algo hash algorithm for the extraction phase, GCRY_MD_...
  * @param prf_algo hash algorithm for the expansion phase, GCRY_MD_...
  * @param xts salt
- * @param xts_len length of xts
+ * @param xts_len length of @a xts
  * @param skm source key material
- * @param skm_len length of skm
+ * @param skm_len length of @a skm
  * @param ... pair of void * & size_t for context chunks, terminated by NULL
- * @return GNUNET_YES on success
+ * @return #GNUNET_YES on success
  */
 int
 GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
@@ -763,11 +835,11 @@ GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
  * @param xtr_algo hash algorithm for the extraction phase, GCRY_MD_...
  * @param prf_algo hash algorithm for the expansion phase, GCRY_MD_...
  * @param xts salt
- * @param xts_len length of xts
+ * @param xts_len length of @a xts
  * @param skm source key material
- * @param skm_len length of skm
+ * @param skm_len length of @a skm
  * @param argp va_list of void * & size_t pairs for context chunks
- * @return GNUNET_YES on success
+ * @return #GNUNET_YES on success
  */
 int
 GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo,
@@ -780,11 +852,11 @@ GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo,
  * @param result buffer for the derived key, allocated by caller
  * @param out_len desired length of the derived key
  * @param xts salt
- * @param xts_len length of xts
+ * @param xts_len length of @a xts
  * @param skm source key material
- * @param skm_len length of skm
+ * @param skm_len length of @a skm
  * @param argp va_list of void * & size_t pairs for context chunks
- * @return GNUNET_YES on success
+ * @return #GNUNET_YES on success
  */
 int
 GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
@@ -798,9 +870,9 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
  * @param result buffer for the derived key, allocated by caller
  * @param out_len desired length of the derived key
  * @param xts salt
- * @param xts_len length of xts
+ * @param xts_len length of @a xts
  * @param skm source key material
- * @param skm_len length of skm
+ * @param skm_len length of @a skm
  * @param ... void * & size_t pairs for context chunks
  * @return #GNUNET_YES on success
  */
@@ -810,16 +882,15 @@ GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
 
 
 /**
- * Function called upon completion of 'GNUNET_CRYPTO_ecc_key_create_async'.
+ * @ingroup crypto
+ * Extract the public key for the given private key.
  *
- * @param cls closure
- * @param pk NULL on error, otherwise the private key (which must be free'd by the callee)
- * @param emsg NULL on success, otherwise an error message
+ * @param priv the private key
+ * @param pub where to write the public key
  */
-typedef void (*GNUNET_CRYPTO_EccKeyCallback)(void *cls,
-                                            struct GNUNET_CRYPTO_EccPrivateKey *pk,
-                                            const char *emsg);
-
+void
+GNUNET_CRYPTO_ecdsa_key_get_public (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+                                    struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
 
 /**
  * @ingroup crypto
@@ -829,9 +900,8 @@ typedef void (*GNUNET_CRYPTO_EccKeyCallback)(void *cls,
  * @param pub where to write the public key
  */
 void
-GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                                               struct GNUNET_CRYPTO_EccPublicSignKey *pub);
-
+GNUNET_CRYPTO_eddsa_key_get_public (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
+                                    struct GNUNET_CRYPTO_EddsaPublicKey *pub);
 
 
 /**
@@ -842,8 +912,18 @@ GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPr
  * @param pub where to write the public key
  */
 void
-GNUNET_CRYPTO_ecc_key_get_public_for_encryption (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                                                struct GNUNET_CRYPTO_EccPublicEncryptKey *pub);
+GNUNET_CRYPTO_ecdhe_key_get_public (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
+                                    struct GNUNET_CRYPTO_EcdhePublicKey *pub);
+
+
+/**
+ * Convert a public key to a string.
+ *
+ * @param pub key to convert
+ * @return string representing @a pub
+ */
+char *
+GNUNET_CRYPTO_ecdsa_public_key_to_string (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
 
 
 /**
@@ -853,7 +933,7 @@ GNUNET_CRYPTO_ecc_key_get_public_for_encryption (const struct GNUNET_CRYPTO_EccP
  * @return string representing @a pub
  */
 char *
-GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPublicSignKey *pub);
+GNUNET_CRYPTO_eddsa_public_key_to_string (const struct GNUNET_CRYPTO_EddsaPublicKey *pub);
 
 
 /**
@@ -865,20 +945,9 @@ GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPubli
  * @return #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc,
-                                              size_t enclen,
-                                              struct GNUNET_CRYPTO_EccPublicSignKey *pub);
-
-
-
-/**
- * Convert a public key to a string.
- *
- * @param pub key to convert
- * @return string representing @a pub
- */
-char *
-GNUNET_CRYPTO_ecc_public_encrypt_key_to_string (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub);
+GNUNET_CRYPTO_ecdsa_public_key_from_string (const char *enc,
+                                            size_t enclen,
+                                            struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
 
 
 /**
@@ -890,9 +959,28 @@ GNUNET_CRYPTO_ecc_public_encrypt_key_to_string (const struct GNUNET_CRYPTO_EccPu
  * @return #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_public_encrypt_key_from_string (const char *enc,
-                                                 size_t enclen,
-                                                 struct GNUNET_CRYPTO_EccPublicEncryptKey *pub);
+GNUNET_CRYPTO_eddsa_public_key_from_string (const char *enc,
+                                            size_t enclen,
+                                            struct GNUNET_CRYPTO_EddsaPublicKey *pub);
+
+
+/**
+ * @ingroup crypto
+ * Create a new private key by reading it from a file.  If the
+ * files does not exist, create a new key and write it to the
+ * file.  Caller must free return value.  Note that this function
+ * can not guarantee that another process might not be trying
+ * the same operation on the same file at the same time.
+ * If the contents of the file
+ * are invalid the old file is deleted and a fresh key is
+ * created.
+ *
+ * @param filename name of file to use to store the key
+ * @return new private key, NULL on error (for example,
+ *   permission denied); free using #GNUNET_free
+ */
+struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename);
 
 
 /**
@@ -910,8 +998,8 @@ GNUNET_CRYPTO_ecc_public_encrypt_key_from_string (const char *enc,
  * @return new private key, NULL on error (for example,
  *   permission denied); free using #GNUNET_free
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename);
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename);
 
 
 /**
@@ -923,8 +1011,28 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename);
  * @return new private key, NULL on error (for example,
  *   permission denied); free using #GNUNET_free
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg);
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg);
+
+
+/**
+ * @ingroup crypto
+ * Create a new private key. Caller must free return value.
+ *
+ * @return fresh private key; free using #GNUNET_free
+ */
+struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_create (void);
+
+
+/**
+ * @ingroup crypto
+ * Create a new private key. Caller must free return value.
+ *
+ * @return fresh private key; free using #GNUNET_free
+ */
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create (void);
 
 
 /**
@@ -933,8 +1041,8 @@ GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATI
  *
  * @return fresh private key; free using #GNUNET_free
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create (void);
+struct GNUNET_CRYPTO_EcdhePrivateKey *
+GNUNET_CRYPTO_ecdhe_key_create (void);
 
 
 /**
@@ -944,7 +1052,26 @@ GNUNET_CRYPTO_ecc_key_create (void);
  * @param pk location of the key
  */
 void
-GNUNET_CRYPTO_ecc_key_clear (struct GNUNET_CRYPTO_EccPrivateKey *pk);
+GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk);
+
+
+/**
+ * @ingroup crypto
+ * Clear memory that was used to store a private key.
+ *
+ * @param pk location of the key
+ */
+void
+GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk);
+
+/**
+ * @ingroup crypto
+ * Clear memory that was used to store a private key.
+ *
+ * @param pk location of the key
+ */
+void
+GNUNET_CRYPTO_ecdhe_key_clear (struct GNUNET_CRYPTO_EcdhePrivateKey *pk);
 
 
 /**
@@ -953,8 +1080,8 @@ GNUNET_CRYPTO_ecc_key_clear (struct GNUNET_CRYPTO_EccPrivateKey *pk);
  *
  * @return "anonymous" private key; do not free
  */
-const struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_get_anonymous (void);
+const struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_get_anonymous (void);
 
 
 /**
@@ -967,7 +1094,7 @@ GNUNET_CRYPTO_ecc_key_get_anonymous (void);
  * @param cfg_name name of the configuration file to use
  */
 void
-GNUNET_CRYPTO_ecc_setup_hostkey (const char *cfg_name);
+GNUNET_CRYPTO_eddsa_setup_hostkey (const char *cfg_name);
 
 
 /**
@@ -989,19 +1116,34 @@ GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
  * Derive key material from a public and a private ECC key.
  *
  * @param priv private key to use for the ECDH (x)
- * @param pub public key to use for the ECDY (yG)
+ * @param pub public key to use for the ECDH (yG)
  * @param key_material where to write the key material (xyG)
  * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                        const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub,
+GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
+                        const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
                         struct GNUNET_HashCode *key_material);
 
 
 /**
  * @ingroup crypto
- * Sign a given block.
+ * EdDSA sign a given block.
+ *
+ * @param priv private key to use for the signing
+ * @param purpose what to sign (size, purpose)
+ * @param sig where to write the signature
+ * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
+ */
+int
+GNUNET_CRYPTO_eddsa_sign (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
+                          const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+                          struct GNUNET_CRYPTO_EddsaSignature *sig);
+
+
+/**
+ * @ingroup crypto
+ * ECDSA Sign a given block.
  *
  * @param priv private key to use for the signing
  * @param purpose what to sign (size, purpose)
@@ -1009,14 +1151,31 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
  * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                        const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
-                        struct GNUNET_CRYPTO_EccSignature *sig);
+GNUNET_CRYPTO_ecdsa_sign (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+                          const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+                          struct GNUNET_CRYPTO_EcdsaSignature *sig);
+
+/**
+ * @ingroup crypto
+ * Verify EdDSA signature.
+ *
+ * @param purpose what is the purpose that the signature should have?
+ * @param validate block to validate (size, purpose, data)
+ * @param sig signature that is being validated
+ * @param pub public key of the signer
+ * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
+ */
+int
+GNUNET_CRYPTO_eddsa_verify (uint32_t purpose,
+                            const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
+                            const struct GNUNET_CRYPTO_EddsaSignature *sig,
+                            const struct GNUNET_CRYPTO_EddsaPublicKey *pub);
+
 
 
 /**
  * @ingroup crypto
- * Verify signature.
+ * Verify ECDSA signature.
  *
  * @param purpose what is the purpose that the signature should have?
  * @param validate block to validate (size, purpose, data)
@@ -1025,10 +1184,10 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
  * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
  */
 int
-GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
-                          const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
-                          const struct GNUNET_CRYPTO_EccSignature *sig,
-                          const struct GNUNET_CRYPTO_EccPublicSignKey *pub);
+GNUNET_CRYPTO_ecdsa_verify (uint32_t purpose,
+                            const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
+                            const struct GNUNET_CRYPTO_EcdsaSignature *sig,
+                            const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
 
 
 /**
@@ -1044,10 +1203,10 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
  *        typically the name of the subsystem/application
  * @return derived private key
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                             const char *label,
-                             const char *context);
+struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_private_key_derive (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+                                        const char *label,
+                                        const char *context);
 
 
 /**
@@ -1062,10 +1221,10 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
  * @param result where to write the derived public key
  */
 void
-GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
-                                    const char *label,
-                                    const char *context,
-                                    struct GNUNET_CRYPTO_EccPublicSignKey *result);
+GNUNET_CRYPTO_ecdsa_public_key_derive (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
+                                       const char *label,
+                                       const char *context,
+                                       struct GNUNET_CRYPTO_EcdsaPublicKey *result);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */
index a13c3b91c110f345afb21dce78fc250e6b4ea392..3546fdcb773b2a0652bbca2feacd229f8fdc22c1 100644 (file)
@@ -337,7 +337,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
  * @return an FS URI for the given namespace and identifier
  */
 struct GNUNET_FS_Uri *
-GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
+GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
                          const char *id);
 
 
@@ -351,7 +351,7 @@ GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns,
  */
 int
 GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
-                                 struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym);
+                                 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym);
 
 
 /**
@@ -1377,7 +1377,7 @@ struct GNUNET_FS_ProgressInfo
           /**
           * Public key of the namespace.
           */
-          struct GNUNET_CRYPTO_EccPublicSignKey pseudonym;
+          struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym;
 
         } ns;
 
@@ -1962,7 +1962,7 @@ enum GNUNET_FS_PublishOptions
 struct GNUNET_FS_PublishContext *
 GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
                          struct GNUNET_FS_FileInformation *fi,
-                         const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                         const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                         const char *nid,
                          const char *nuid,
                          enum GNUNET_FS_PublishOptions options);
@@ -2054,7 +2054,7 @@ struct GNUNET_FS_PublishSksContext;
  */
 struct GNUNET_FS_PublishSksContext *
 GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
-                       const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                       const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                        const char *identifier,
                       const char *update,
                        const struct GNUNET_CONTAINER_MetaData *meta,
@@ -2176,7 +2176,7 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
  */
 void
 GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h,
-                                    const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+                                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
                                      const char *next_id,
                                      GNUNET_FS_IdentifierProcessor ip,
                                      void *ip_cls);
index f16494c61dc4d06743998bfaabbf9dbb943b3930..f26b44265e96c25291ec23ac94b26c505e9091d2 100644 (file)
@@ -107,10 +107,10 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
 struct GNUNET_GNS_LookupRequest *
 GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
                   const char *name,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *zone,
+                  const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
                   int type,
                   int only_cached,
-                  const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key,
+                  const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key,
                   GNUNET_GNS_LookupResultProcessor proc,
                   void *proc_cls);
 
index 901aa4f2464379103fa816bfd951913fdcdc7058..609cb2822c35c85717ce75285b7634918b84f502 100644 (file)
@@ -198,7 +198,7 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls,
  * @return the hello message
  */
 struct GNUNET_HELLO_Message *
-GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey,
+GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *publicKey,
                      GNUNET_HELLO_GenerateAddressListCallback addrgen,
                      void *addrgen_cls,
                      int friend_only);
@@ -325,7 +325,7 @@ GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message
  */
 int
 GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
-                      struct GNUNET_CRYPTO_EccPublicSignKey *publicKey);
+                      struct GNUNET_CRYPTO_EddsaPublicKey *publicKey);
 
 
 /**
@@ -378,7 +378,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello,
  */
 int
 GNUNET_HELLO_parse_uri (const char *uri,
-                        struct GNUNET_CRYPTO_EccPublicSignKey *pubkey,
+                        struct GNUNET_CRYPTO_EddsaPublicKey *pubkey,
                         struct GNUNET_HELLO_Message **hello,
                         GNUNET_HELLO_TransportPluginsFind plugins_find);
 
index 79d27fa02eda782eb26cbe63106577e9acbffbd1..49b269604cbceaa23edd9cf1b3baefe55e43e328 100644 (file)
@@ -76,7 +76,7 @@ struct GNUNET_IDENTITY_Operation;
  * @param ego the ego
  * @return associated ECC key, valid as long as the ego is valid
  */
-const struct GNUNET_CRYPTO_EccPrivateKey *
+const struct GNUNET_CRYPTO_EcdsaPrivateKey *
 GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego);
 
 
@@ -97,7 +97,7 @@ GNUNET_IDENTITY_ego_get_anonymous (void);
  */
 void
 GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego,
-                                   struct GNUNET_CRYPTO_EccPublicSignKey *pk);
+                                   struct GNUNET_CRYPTO_EcdsaPublicKey *pk);
 
 
 /**
index 7a2421b4b26450d4ba496c15f07b3d567cdde781..58a99c0d88e2fea64b0d93b266f53d0ee5bab11d 100644 (file)
@@ -112,7 +112,7 @@ struct GNUNET_MULTICAST_MessageHeader
    *
    * Signature must match the public key of the multicast group.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 
   /**
    * Purpose for the signature and size of the signed data.
@@ -214,7 +214,7 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh,
  */
 typedef void
 (*GNUNET_MULTICAST_JoinCallback) (void *cls,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *member_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *member_key,
                                   const struct GNUNET_MessageHeader *join_req,
                                   struct GNUNET_MULTICAST_JoinHandle *jh);
 
@@ -253,7 +253,7 @@ GNUNET_MULTICAST_membership_test_result (struct GNUNET_MULTICAST_MembershipTestH
  */
 typedef void
 (*GNUNET_MULTICAST_MembershipTestCallback) (void *cls,
-                                            const struct GNUNET_CRYPTO_EccPublicSignKey *member_key,
+                                            const struct GNUNET_CRYPTO_EddsaPublicKey *member_key,
                                             uint64_t message_id,
                                             uint64_t group_generation,
                                             struct GNUNET_MULTICAST_MembershipTestHandle *mth);
@@ -277,7 +277,7 @@ typedef void
  */
 typedef void
 (*GNUNET_MULTICAST_RequestCallback) (void *cls,
-                                     const struct GNUNET_CRYPTO_EccPublicSignKey *member_key,
+                                     const struct GNUNET_CRYPTO_EddsaPublicKey *member_key,
                                      const struct GNUNET_MessageHeader *req,
                                      enum GNUNET_MULTICAST_MessageFlags flags);
 
@@ -341,7 +341,7 @@ struct GNUNET_MULTICAST_ReplayHandle;
  */
 typedef void
 (*GNUNET_MULTICAST_ReplayFragmentCallback) (void *cls,
-                                            const struct GNUNET_CRYPTO_EccPublicSignKey *member_key,
+                                            const struct GNUNET_CRYPTO_EddsaPublicKey *member_key,
                                             uint64_t fragment_id,
                                             uint64_t flags,
                                             struct GNUNET_MULTICAST_ReplayHandle *rh);
@@ -364,7 +364,7 @@ typedef void
  */
 typedef void
 (*GNUNET_MULTICAST_ReplayMessageCallback) (void *cls,
-                                           const struct GNUNET_CRYPTO_EccPublicSignKey *member_key,
+                                           const struct GNUNET_CRYPTO_EddsaPublicKey *member_key,
                                            uint64_t message_id,
                                            uint64_t fragment_offset,
                                            uint64_t flags,
@@ -491,7 +491,7 @@ GNUNET_MULTICAST_replay_response2 (struct GNUNET_MULTICAST_ReplayHandle *rh,
  */
 struct GNUNET_MULTICAST_Origin *
 GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                               const struct GNUNET_CRYPTO_EccPrivateKey *priv_key,
+                               const struct GNUNET_CRYPTO_EddsaPrivateKey *priv_key,
                                uint64_t next_fragment_id,
                                GNUNET_MULTICAST_JoinCallback join_cb,
                                GNUNET_MULTICAST_MembershipTestCallback mem_test_cb,
@@ -623,8 +623,8 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin);
  */
 struct GNUNET_MULTICAST_Member *
 GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *group_key,
-                              const struct GNUNET_CRYPTO_EccPrivateKey *member_key,
+                              const struct GNUNET_CRYPTO_EddsaPublicKey *group_key,
+                              const struct GNUNET_CRYPTO_EddsaPrivateKey *member_key,
                               const struct GNUNET_PeerIdentity *origin,
                               uint32_t relay_count,
                               const struct GNUNET_PeerIdentity *relays,
index 4d4821bcbee1b71622835ef3a776d7f01adebd4c..5c7408eec315ee5331c3d8a13d35ddd8bf99d191 100644 (file)
@@ -58,7 +58,7 @@ typedef void (*GNUNET_NAMESTORE_BlockCallback) (void *cls,
  * @param rd array of records with data to store
  */
 typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls,
-                                                const struct GNUNET_CRYPTO_EccPrivateKey *private_key,
+                                                const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key,
                                                 const char *label,
                                                 unsigned int rd_count,
                                                 const struct GNUNET_NAMESTORE_RecordData *rd);
@@ -115,7 +115,7 @@ struct GNUNET_NAMESTORE_PluginFunctions
    * @return #GNUNET_OK on success, else #GNUNET_SYSERR
    */
   int (*store_records) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                       const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                        const char *label,
                        unsigned int rd_count,
                        const struct GNUNET_NAMESTORE_RecordData *rd);
@@ -133,7 +133,7 @@ struct GNUNET_NAMESTORE_PluginFunctions
    * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
    */
   int (*iterate_records) (void *cls,
-                         const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                         const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                          uint64_t offset,
                          GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls);
 
@@ -150,8 +150,8 @@ struct GNUNET_NAMESTORE_PluginFunctions
    * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
    */
   int (*zone_to_name) (void *cls,
-                      const struct GNUNET_CRYPTO_EccPrivateKey *zone,
-                      const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone,
+                      const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+                      const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
                       GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls);
 
 
index 7e39adc49564f9ef85a5c6bbee906d86dc33d0da..c31c3689bc90ab2e6a07d0a8f68c0aa499ff49f7 100644 (file)
@@ -239,12 +239,12 @@ struct GNUNET_NAMESTORE_Block
   /**
    * Signature of the block.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
 
   /**
    * Derived key used for signing; hash of this is the query.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey derived_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
 
   /**
    * Number of bytes signed; also specifies the number of bytes
@@ -297,7 +297,7 @@ GNUNET_NAMESTORE_block_cache (struct GNUNET_NAMESTORE_Handle *h,
  */
 struct GNUNET_NAMESTORE_QueueEntry *
 GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPrivateKey *pkey,
+                               const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
                                const char *label,
                                unsigned int rd_count,
                                const struct GNUNET_NAMESTORE_RecordData *rd,
@@ -343,7 +343,7 @@ GNUNET_NAMESTORE_lookup_block (struct GNUNET_NAMESTORE_Handle *h,
  * @param rd array of records with data to store
  */
 typedef void (*GNUNET_NAMESTORE_RecordMonitor) (void *cls,
-                                               const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                               const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                                const char *label,
                                                unsigned int rd_count,
                                                const struct GNUNET_NAMESTORE_RecordData *rd);
@@ -364,8 +364,8 @@ typedef void (*GNUNET_NAMESTORE_RecordMonitor) (void *cls,
  */
 struct GNUNET_NAMESTORE_QueueEntry *
 GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPrivateKey *zone,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone,
+                              const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+                              const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
                               GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls);
 
 
@@ -411,7 +411,7 @@ GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe);
  */
 struct GNUNET_NAMESTORE_ZoneIterator *
 GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h,
-                                      const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                      const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                       GNUNET_NAMESTORE_RecordMonitor proc,
                                       void *proc_cls);
 
@@ -471,7 +471,7 @@ typedef void (*GNUNET_NAMESTORE_RecordsSynchronizedCallback)(void *cls);
  */
 struct GNUNET_NAMESTORE_ZoneMonitor *
 GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                                    const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                     GNUNET_NAMESTORE_RecordMonitor monitor,
                                     GNUNET_NAMESTORE_RecordsSynchronizedCallback sync_cb,
                                     void *cls);
@@ -614,7 +614,7 @@ GNUNET_NAMESTORE_normalize_string (const char *src);
  * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s.
  */
 const char *
-GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z);
+GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
 
 
 /**
@@ -628,7 +628,7 @@ GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z);
  *         key in an encoding suitable for DNS labels.
  */
 const char *
-GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey);
+GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
 
 
 /**
@@ -642,7 +642,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey
  */
 int
 GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey,
-                              struct GNUNET_CRYPTO_EccPublicSignKey *pkey);
+                              struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
 
 
 /**
@@ -653,7 +653,7 @@ GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey,
  * @param query hash to use for the query
  */
 void
-GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                         const char *label,
                                         struct GNUNET_HashCode *query);
 
@@ -666,7 +666,7 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe
  * @param query hash to use for the query
  */
 void
-GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
+GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
                                        const char *label,
                                        struct GNUNET_HashCode *query);
 
@@ -681,7 +681,7 @@ GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSign
  * @param rd_count number of records in @a rd
  */
 struct GNUNET_NAMESTORE_Block *
-GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key,
+GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
                               struct GNUNET_TIME_Absolute expire,
                               const char *label,
                               const struct GNUNET_NAMESTORE_RecordData *rd,
@@ -712,7 +712,7 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block);
  */
 int
 GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key,
+                               const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key,
                                const char *label,
                                GNUNET_NAMESTORE_RecordCallback proc,
                                void *proc_cls);
index e9f935de7fc15f3cc2a4d8516b01646077d5c7f1..7ac40a4c5d03931d50f12ead4e6d868e0b647ce8 100644 (file)
@@ -210,7 +210,7 @@ struct GNUNET_PSYC_MessageMethod
    * Sending slave's public key. NULL if the message is from the master, or when
    * transmitting a message.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey slave_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey slave_key;
 
   /* Followed by NUL-terminated method name. */
 };
@@ -305,7 +305,7 @@ struct GNUNET_PSYC_JoinHandle;
  */
 typedef int
 (*GNUNET_PSYC_Method) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                        uint64_t message_id,
                        const char *method_name,
                        size_t modifier_count,
@@ -331,7 +331,7 @@ typedef int
  */
 typedef int
 (*GNUNET_PSYC_JoinCallback) (void *cls,
-                             const struct GNUNET_CRYPTO_EccPublicSignKey
+                             const struct GNUNET_CRYPTO_EddsaPublicKey
                              *slave_key,
                              const char *method_name,
                              size_t variable_count,
@@ -421,7 +421,7 @@ typedef void
  */
 struct GNUNET_PSYC_Master *
 GNUNET_PSYC_master_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                          const struct GNUNET_CRYPTO_EccPrivateKey *channel_key,
+                          const struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key,
                           enum GNUNET_PSYC_Policy policy,
                           GNUNET_PSYC_Method method,
                           GNUNET_PSYC_JoinCallback join_cb,
@@ -579,8 +579,8 @@ typedef void
  */
 struct GNUNET_PSYC_Slave *
 GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                        const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                        const struct GNUNET_CRYPTO_EccPrivateKey *slave_key,
+                        const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                        const struct GNUNET_CRYPTO_EddsaPrivateKey *slave_key,
                         const struct GNUNET_PeerIdentity *origin,
                         size_t relay_count,
                         const struct GNUNET_PeerIdentity *relays,
@@ -732,7 +732,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave);
  */
 void
 GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey
+                               const struct GNUNET_CRYPTO_EddsaPublicKey
                                *slave_key,
                                uint64_t announced_at,
                                uint64_t effective_since);
@@ -761,7 +761,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel,
  */
 void
 GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey
                                   *slave_key,
                                   uint64_t announced_at);
 
index 8f8668043970c4bb3b5b95fe721b8a637aa2ea3d..7564ed4bd9d3c83cf64b8460407d1a47a6c55759 100644 (file)
@@ -59,8 +59,8 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*membership_store) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                        int did_join,
                        uint64_t announced_at,
                        uint64_t effective_since,
@@ -76,8 +76,8 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*membership_test) (void *cls,
-                      const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                      const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                      const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                      const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                       uint64_t message_id);
 
   /**
@@ -89,7 +89,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*fragment_store) (void *cls,
-                     const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                     const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                      const struct GNUNET_MULTICAST_MessageHeader *message,
                      uint32_t psycstore_flags);
 
@@ -107,7 +107,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*message_add_flags) (void *cls,
-                        const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                        const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                         uint64_t message_id,
                         uint64_t psycstore_flags);
 
@@ -120,7 +120,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*fragment_get) (void *cls,
-                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                    uint64_t fragment_id,
                    GNUNET_PSYCSTORE_FragmentCallback cb,
                    void *cb_cls);
@@ -134,7 +134,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*message_get) (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                   uint64_t message_id,
                   uint64_t *returned_fragments,
                   GNUNET_PSYCSTORE_FragmentCallback cb,
@@ -150,7 +150,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*message_get_fragment) (void *cls,
-                           const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                           const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                            uint64_t message_id,
                            uint64_t fragment_offset,
                            GNUNET_PSYCSTORE_FragmentCallback cb,
@@ -165,7 +165,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*counters_message_get) (void *cls,
-                           const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                           const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                            uint64_t *max_fragment_id,
                            uint64_t *max_message_id,
                            uint64_t *max_group_generation);
@@ -179,7 +179,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*counters_state_get) (void *cls,
-                         const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                         const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                          uint64_t *max_state_message_id);
 
 
@@ -192,7 +192,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_modify_begin) (void *cls,
-                         const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                         const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                          uint64_t message_id, uint64_t state_delta);
 
   /**
@@ -208,7 +208,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_modify_set) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                        const char *name, const void *value, size_t value_size);
 
 
@@ -221,7 +221,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_modify_end) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                        uint64_t message_id);
 
 
@@ -234,7 +234,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_sync_begin) (void *cls,
-                         const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key);
+                         const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key);
 
   /**
    * Set the value of a state variable while synchronizing state.
@@ -249,7 +249,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_sync_set) (void *cls,
-                     const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                     const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                      const char *name, const void *value, size_t value_size);
 
 
@@ -262,7 +262,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_sync_end) (void *cls,
-                     const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                     const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                      uint64_t message_id);
 
 
@@ -277,7 +277,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_reset) (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key);
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key);
 
   /**
    * Update signed state values from the current ones.
@@ -286,7 +286,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_update_signed) (void *cls,
-                          const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key);
+                          const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key);
 
 
   /**
@@ -296,7 +296,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_get) (void *cls,
-                const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                 const char *name,
                 GNUNET_PSYCSTORE_StateCallback cb,
                 void *cb_cls);
@@ -310,7 +310,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_get_prefix) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                        const char *name,
                        GNUNET_PSYCSTORE_StateCallback cb,
                        void *cb_cls);
@@ -323,7 +323,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions
    */
   int
   (*state_get_signed) (void *cls,
-                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                        GNUNET_PSYCSTORE_StateCallback cb,
                        void *cb_cls);
 
index 25d4339a3d09f79a8bd0bb157127740d3fc0f4d6..5f4a32b7bd484dcd3fec47259f57f3104052c397 100644 (file)
@@ -133,8 +133,8 @@ typedef void
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                                    int did_join,
                                    uint64_t announced_at,
                                    uint64_t effective_since,
@@ -165,8 +165,8 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                                   uint64_t message_id,
                                   uint64_t group_generation,
                                   GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -188,7 +188,7 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
-                                 const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                 const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                  const struct GNUNET_MULTICAST_MessageHeader *message,
                                  uint32_t psycstore_flags,
                                  GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -227,7 +227,7 @@ typedef int
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                uint64_t fragment_id,
                                GNUNET_PSYCSTORE_FragmentCallback fcb,
                                GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -248,7 +248,7 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                              const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                               uint64_t message_id,
                               GNUNET_PSYCSTORE_FragmentCallback fcb,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -271,7 +271,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
-                                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                        uint64_t message_id,
                                        uint64_t fragment_offset,
                                        GNUNET_PSYCSTORE_FragmentCallback fcb,
@@ -316,7 +316,7 @@ typedef void
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
-                               struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                GNUNET_PSYCSTORE_CountersCallback ccb,
                                void *ccb_cls);
 
@@ -340,7 +340,7 @@ GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                uint64_t message_id,
                                uint64_t state_delta,
                                size_t modifier_count,
@@ -364,7 +364,7 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
-                             const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                             const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                              uint64_t message_id,
                              size_t modifier_count,
                              const struct GNUNET_ENV_Modifier *modifiers,
@@ -387,7 +387,7 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey
+                              const struct GNUNET_CRYPTO_EddsaPublicKey
                               *channel_key,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
                               void *rcb_cls);
@@ -406,7 +406,7 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
-                                    const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                    const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                     uint64_t message_id,
                                     const struct GNUNET_HashCode *hash,
                                     GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -444,7 +444,7 @@ typedef int
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
-                            const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                            const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                             const char *name,
                             GNUNET_PSYCSTORE_StateCallback scb,
                             GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -465,7 +465,7 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_get_prefix (struct GNUNET_PSYCSTORE_Handle *h,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                    const char *name_prefix,
                                    GNUNET_PSYCSTORE_StateCallback scb,
                                    GNUNET_PSYCSTORE_ResultCallback rcb,
index 8809f9ece79876116441d6959db9afc450efa26a..82decc30ba3e435bbf68817463c3a83173a187db 100644 (file)
@@ -73,7 +73,7 @@ typedef void (*GNUNET_REVOCATION_Callback) (void *cls,
  */
 struct GNUNET_REVOCATION_Query *
 GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                        const struct GNUNET_CRYPTO_EccPublicSignKey *key,
+                        const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
                         GNUNET_REVOCATION_Callback func, void *func_cls);
 
 
@@ -109,8 +109,8 @@ struct GNUNET_REVOCATION_Handle;
  */
 struct GNUNET_REVOCATION_Handle *
 GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                         const struct GNUNET_CRYPTO_EccPublicSignKey *key,
-                         const struct GNUNET_CRYPTO_EccSignature *sig,
+                         const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
+                         const struct GNUNET_CRYPTO_EcdsaSignature *sig,
                          uint64_t pow,
                          GNUNET_REVOCATION_Callback func, void *func_cls);
 
@@ -134,7 +134,7 @@ GNUNET_REVOCATION_revoke_cancel (struct GNUNET_REVOCATION_Handle *h);
  * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not
  */
 int
-GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EccPublicSignKey *key,
+GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
                             uint64_t pow,
                             unsigned int matching_bits);
 
@@ -146,8 +146,8 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EccPublicSignKey *key,
  * @param sig where to write the revocation signature
  */
 void
-GNUNET_REVOCATION_sign_revocation (const struct GNUNET_CRYPTO_EccPrivateKey *key,
-                                  struct GNUNET_CRYPTO_EccSignature *sig);
+GNUNET_REVOCATION_sign_revocation (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+                                  struct GNUNET_CRYPTO_EcdsaSignature *sig);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */
index 910662d3fa99461f1e069846289e59fd6562d71c..1f27347ebedd91ab574b04915961660f27c28180 100644 (file)
@@ -48,7 +48,7 @@ extern "C"
 /**
  * Size of each hostkey in the hostkey file (in BYTES).
  */
-#define GNUNET_TESTING_HOSTKEYFILESIZE sizeof (struct GNUNET_CRYPTO_EccPrivateKey)
+#define GNUNET_TESTING_HOSTKEYFILESIZE sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)
 
 /**
  * The environmental variable, if set, that dictates where testing should place
@@ -185,7 +185,7 @@ GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system,
  *        key; if NULL, GNUNET_SYSERR is returned immediately
  * @return NULL on error (not enough keys)
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
+struct GNUNET_CRYPTO_EddsaPrivateKey *
 GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
                            uint32_t key_number,
                            struct GNUNET_PeerIdentity *id);
index 440dc272d960566d2676d7d727f689ee431a7586..77bb7317f906f0ad2baedbf9292eee6a1e1606a4 100644 (file)
@@ -138,7 +138,7 @@ show_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GNUNET_PeerIdentity pid;
 
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_public_sign_key_from_string (tunnel_id,
+      GNUNET_CRYPTO_eddsa_public_key_from_string (tunnel_id,
                                                     strlen (tunnel_id),
                                                     &pid.public_key))
   {
index 55b189da1a9970d5ce606356180bc4c2804c775d..0a3aeaf3550c90e93b37e5779e8c75efefca9ae0 100644 (file)
@@ -94,7 +94,7 @@ static struct GNUNET_PeerIdentity my_full_id;
 /**
  * Own private key.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 
 /******************************************************************************/
@@ -156,7 +156,7 @@ static void
 run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting to run\n");
 
@@ -166,10 +166,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "reading key\n");
-  pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (c);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_configuration (c);
   GNUNET_assert (NULL != pk);
   my_private_key = pk;
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (my_private_key,
                                                   &my_full_id.public_key);
   myid = GNUNET_PEER_intern (&my_full_id);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
index afa64f1fd113e3da3af8f8520b0a3a04aa948fc7..b17412b0243884c2ae6dc940663a545432993d12 100644 (file)
@@ -717,7 +717,7 @@ static struct GNUNET_PeerIdentity my_full_id;
 /**
  * Own private key.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 /**
  * Tunnel ID for the next created tunnel (global tunnel number).
@@ -5758,7 +5758,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *keyfile;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting to run\n");
   server_handle = server;
@@ -5897,11 +5897,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   /* Scheduled the task to clean up when shutdown is called */
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
-  pk = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   GNUNET_assert (NULL != pk);
   my_private_key = pk;
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (my_private_key,
                                                  &my_full_id.public_key);
   myid = GNUNET_PEER_intern (&my_full_id);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
index 3beb2da8a85bc3bebe822a8a8166badfd44ccb4d..00dfb9d4699f2414f03d7c4c295d222bbe278f24 100644 (file)
@@ -94,7 +94,7 @@ static struct GNUNET_PeerIdentity *full_id;
 /**
  * Own private key.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
 
 
 /******************************************************************************/
index 88a04eea6509479d9ffd62a7929cdfe9ef766f00..b077d00b229f2da26e8d4645ae45daffae6400b3 100644 (file)
@@ -70,17 +70,17 @@ struct MeshTunnel3
   /**
    * Local peer ephemeral private key
    */
-  struct GNUNET_CRYPTO_EccPrivateKey *my_eph_key;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *my_eph_key;
 
   /**
    * Local peer ephemeral public key
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey *my_eph;
+  struct GNUNET_CRYPTO_EddsaPublicKey *my_eph;
 
   /**
    * Remote peer's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey *peers_eph;
+  struct GNUNET_CRYPTO_EddsaPublicKey *peers_eph;
 
   /**
    * Encryption ("our") key.
@@ -181,7 +181,7 @@ const static struct GNUNET_PeerIdentity *my_full_id;
 /**
  * Own private key.
  */
-const static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+const static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 
 /******************************************************************************/
@@ -548,7 +548,7 @@ GMT_send_queued_data (struct MeshTunnel3 *t, int fwd)
 void
 GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
           const struct GNUNET_PeerIdentity *id,
-          const struct GNUNET_CRYPTO_EccPrivateKey *key)
+          const struct GNUNET_CRYPTO_EddsaPrivateKey *key)
 {
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (c, "MESH", "DEFAULT_TTL",
index 18104a147c8ba8bf467bfc89c95e6dffc5d48e25..b80f7dff151dbf42ab1def1909f9e78644a1e546 100644 (file)
@@ -95,7 +95,7 @@ struct MeshTunnel3;
 void
 GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
           const struct GNUNET_PeerIdentity *id,
-          const struct GNUNET_CRYPTO_EccPrivateKey *key);
+          const struct GNUNET_CRYPTO_EddsaPrivateKey *key);
 
 /**
  * Shut down the tunnel subsystem.
index 7455c0ba526d1c35ed5c4f7e21b48f088e8481cc..08f03a0559ecea72c2502423d562e2c592f64bac 100644 (file)
@@ -196,7 +196,7 @@ static struct GNUNET_NAMESTORE_Handle *ns;
 /**
  * Private key for the fcfsd zone.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey fcfs_zone_pkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey fcfs_zone_pkey;
 
 /**
  * Connection to identity service.
@@ -242,7 +242,7 @@ run_httpd_now ()
 
 static void
 iterate_cb (void *cls,
-           const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+           const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
            const char *name,
            unsigned int rd_len,
            const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -504,14 +504,14 @@ put_continuation (void *cls,
  */
 static void
 zone_to_name_cb (void *cls,
-                const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                 const char *name,
                 unsigned int rd_count,
                 const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   struct Request *request = cls;
   struct GNUNET_NAMESTORE_RecordData r;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
   request->qe = NULL;
   if (NULL != name)
@@ -523,7 +523,7 @@ zone_to_name_cb (void *cls,
     run_httpd_now ();
     return;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (zone_key,
+  GNUNET_CRYPTO_ecdsa_key_get_public (zone_key,
                                                  &pub);
   r.data = &pub;
   r.data_size = sizeof (pub);
@@ -554,7 +554,7 @@ lookup_result_processor (void *cls,
                         const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   struct Request *request = cls;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
   if (0 != rd_count)
   {
@@ -567,7 +567,7 @@ lookup_result_processor (void *cls,
     return;
   }
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_public_sign_key_from_string (request->public_key,
+      GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
                                                strlen (request->public_key),
                                                &pub))
   {
@@ -596,7 +596,7 @@ lookup_block_processor (void *cls,
                        const struct GNUNET_NAMESTORE_Block *block)
 {
   struct Request *request = cls;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
   request->qe = NULL;
   if (NULL == block)
@@ -604,7 +604,7 @@ lookup_block_processor (void *cls,
     lookup_result_processor (request, 0, NULL);
     return;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey,
+  GNUNET_CRYPTO_ecdsa_key_get_public (&fcfs_zone_pkey,
                                    &pub);
   if (GNUNET_OK !=
       GNUNET_NAMESTORE_block_decrypt (block,
@@ -657,7 +657,7 @@ create_response (void *cls,
   struct MHD_Response *response;
   struct Request *request;
   int ret;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
   struct GNUNET_HashCode query;
 
   if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
@@ -707,7 +707,7 @@ create_response (void *cls,
        request->pp = NULL;
       }
       if (GNUNET_OK !=
-         GNUNET_CRYPTO_ecc_public_sign_key_from_string (request->public_key,
+         GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
                                                    strlen (request->public_key),
                                                    &pub))
       {
@@ -735,7 +735,7 @@ create_response (void *cls,
                                 request, connection);
          }
          request->phase = RP_LOOKUP;
-         GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey,
+         GNUNET_CRYPTO_ecdsa_key_get_public (&fcfs_zone_pkey,
                                            &pub);
          GNUNET_NAMESTORE_query_from_public_key (&pub,
                                                  request->domain_name,
@@ -1030,7 +1030,7 @@ main (int argc, char *const *argv)
                           options,
                            &run, NULL)) ? 0 : 1;
   GNUNET_free ((void*) argv);
-  GNUNET_CRYPTO_ecc_key_clear (&fcfs_zone_pkey);
+  GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey);
   return ret;
 }
 
index 2ff6406045ada6bb945454243a8245acb7466b9d..322030e65ab6f854027c33ec30be5231f1e4d9b2 100644 (file)
@@ -41,7 +41,7 @@ static struct GNUNET_NAMESTORE_Handle *ns;
 /**
  * Private key for the our zone.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey zone_pkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey;
 
 /**
  * Handle to identity lookup.
@@ -334,7 +334,7 @@ del_continuation (void *cls,
  */
 static void
 display_record (void *cls,
-               const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+               const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                const char *name,
                unsigned int rd_len,
                const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -413,7 +413,7 @@ sync_cb (void *cls)
  */
 static void
 get_existing_record (void *cls,
-                    const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                     const char *rec_name,
                     unsigned int rd_count,
                     const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -524,10 +524,10 @@ static void
 handle_block (void *cls,
              const struct GNUNET_NAMESTORE_Block *block)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey zone_pubkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey zone_pubkey;
 
   list_qe = NULL;
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (&zone_pkey,
+  GNUNET_CRYPTO_ecdsa_key_get_public (&zone_pkey,
                                                  &zone_pubkey);
   if (NULL == block)
   {
@@ -560,7 +560,7 @@ handle_block (void *cls,
  */
 static void
 handle_reverse_lookup (void *cls,
-                       const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                       const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                        const char *label,
                        unsigned int rd_count,
                        const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -591,7 +591,7 @@ testservice_task (void *cls,
                   int result)
 {
   const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
   struct GNUNET_NAMESTORE_RecordData rd;
 
   if (GNUNET_YES != result)
@@ -608,7 +608,7 @@ testservice_task (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (&zone_pkey,
+  GNUNET_CRYPTO_ecdsa_key_get_public (&zone_pkey,
                                     &pub);
 
   ns = GNUNET_NAMESTORE_connect (cfg);
@@ -738,9 +738,9 @@ testservice_task (void *cls,
     else
     {
       struct GNUNET_HashCode query;
-      struct GNUNET_CRYPTO_EccPublicSignKey zone_pubkey;
+      struct GNUNET_CRYPTO_EcdsaPublicKey zone_pubkey;
 
-      GNUNET_CRYPTO_ecc_key_get_public_for_signature (&zone_pkey,
+      GNUNET_CRYPTO_ecdsa_key_get_public (&zone_pkey,
                                                      &zone_pubkey);
       GNUNET_NAMESTORE_query_from_public_key (&zone_pubkey,
                                              name,
@@ -753,10 +753,10 @@ testservice_task (void *cls,
   }
   if (NULL != reverse_pkey)
   {
-    struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+    struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
     if (GNUNET_OK !=
-        GNUNET_CRYPTO_ecc_public_sign_key_from_string (reverse_pkey,
+        GNUNET_CRYPTO_ecdsa_public_key_from_string (reverse_pkey,
                                                        strlen (reverse_pkey),
                                                        &pubkey))
     {
@@ -775,14 +775,14 @@ testservice_task (void *cls,
   {
     char sh[105];
     char sname[64];
-    struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+    struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
 
     if ( (2 != (sscanf (uri,
                         "gnunet://gns/%104s/%63s",
                         sh,
                         sname)) ) ||
          (GNUNET_OK !=
-          GNUNET_CRYPTO_ecc_public_sign_key_from_string (sh, strlen (sh), &pkey)) )
+          GNUNET_CRYPTO_ecdsa_public_key_from_string (sh, strlen (sh), &pkey)) )
     {
       fprintf (stderr,
                _("Invalid URI `%s'\n"),
@@ -793,7 +793,7 @@ testservice_task (void *cls,
     }
     memset (&rd, 0, sizeof (rd));
     rd.data = &pkey;
-    rd.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey);
+    rd.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
     rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
     if (GNUNET_YES == etime_is_rel)
     {
@@ -952,11 +952,11 @@ main (int argc, char *const *argv)
                          &run, NULL))
   {
     GNUNET_free ((void*) argv);
-    GNUNET_CRYPTO_ecc_key_clear (&zone_pkey);
+    GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey);
     return 1;
   }
   GNUNET_free ((void*) argv);
-  GNUNET_CRYPTO_ecc_key_clear (&zone_pkey);
+  GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey);
   return ret;
 }
 
index 49315f6e09839f31d55e4fcaafc4c2d9987efdfc..2cce9263522c83cc3a45fe4aafb3ca2e9702475b 100644 (file)
@@ -64,7 +64,7 @@ struct ZoneIteration
   /**
    * Key of the zone we are iterating over.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
   /**
    * The operation id fot the zone iteration in the response for the client
@@ -140,7 +140,7 @@ struct ZoneMonitor
   /**
    * Private key of the zone.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
   /**
    * The operation id fot the zone iteration in the response for the client
@@ -512,7 +512,7 @@ static void
 send_lookup_response (struct GNUNET_SERVER_NotificationContext *nc,
                      struct GNUNET_SERVER_Client *client,
                      uint32_t request_id,
-                     const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                     const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                      const char *name,
                      unsigned int rd_count,
                      const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -563,7 +563,7 @@ send_lookup_response (struct GNUNET_SERVER_NotificationContext *nc,
  * @param rd records stored under the given @a name
  */
 static void
-refresh_block (const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+refresh_block (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                const char *name,
                unsigned int rd_count,
                const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -617,7 +617,7 @@ handle_record_store (void *cls,
   const char *rd_ser;
   unsigned int rd_count;
   int res;
-  struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
   struct ZoneMonitor *zm;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -670,7 +670,7 @@ handle_record_store (void *cls,
     }
 
     /* Extracting and converting private key */
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (&rp_msg->private_key,
+    GNUNET_CRYPTO_ecdsa_key_get_public (&rp_msg->private_key,
                                      &pubkey);
     conv_name = GNUNET_NAMESTORE_normalize_string (name_tmp);
     if (NULL == conv_name)
@@ -711,7 +711,7 @@ handle_record_store (void *cls,
 
         for (zm = monitor_head; NULL != zm; zm = zm->next)
           if (0 == memcmp (&rp_msg->private_key, &zm->zone,
-                           sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+                           sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
             send_lookup_response (monitor_nc,
                                   zm->nc->client,
                                   zm->request_id,
@@ -774,7 +774,7 @@ struct ZoneToNameCtx
  */
 static void
 handle_zone_to_name_it (void *cls,
-                       const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                       const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                        const char *name,
                        unsigned int rd_count,
                        const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -936,7 +936,7 @@ struct ZoneIterationProcResult
  */
 static void
 zone_iteraterate_proc (void *cls,
-                       const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                       const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                        const char *name,
                        unsigned int rd_count,
                        const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -992,7 +992,7 @@ zone_iteraterate_proc (void *cls,
 static void
 run_zone_iteration_round (struct ZoneIteration *zi)
 {
-  static struct GNUNET_CRYPTO_EccPrivateKey zero;
+  static struct GNUNET_CRYPTO_EcdsaPrivateKey zero;
   struct ZoneIterationProcResult proc;
   struct RecordResultMessage rrm;
   int ret;
@@ -1198,7 +1198,7 @@ monitor_next (void *cls,
  */
 static void
 monitor_iterate_cb (void *cls,
-                   const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                   const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                    const char *name,
                    unsigned int rd_count,
                    const struct GNUNET_NAMESTORE_RecordData *rd)
index a8851e104d6a54471c058e15a67121c4b2de0bf7..4350dbab4b1ae90e4494b8b65d03f342ff3c087d 100644 (file)
@@ -88,12 +88,12 @@ struct LookupBlockResponseMessage
   /**
    * Signature.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
 
   /**
    * Derived public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey derived_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
 
   /* follwed by encrypted block data */
 };
@@ -117,12 +117,12 @@ struct BlockCacheMessage
   /**
    * Signature.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
 
   /**
    * Derived public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey derived_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
 
   /* follwed by encrypted block data */
 };
@@ -183,7 +183,7 @@ struct RecordStoreMessage
   /**
    * The private key of the authority.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
 
   /* followed by:
    * name with length name_len
@@ -223,12 +223,12 @@ struct ZoneToNameMessage
   /**
    * The private key of the zone to look up in
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
   /**
    * The public key of the target zone
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey value_zone;
+  struct GNUNET_CRYPTO_EcdsaPublicKey value_zone;
 };
 
 
@@ -266,7 +266,7 @@ struct ZoneToNameResponseMessage
   /**
    * The private key of the zone that contained the name.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
   /* followed by:
    * name with length name_len
@@ -309,7 +309,7 @@ struct RecordResultMessage
   /**
    * The private key of the authority.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
 
   /* followed by:
    * name with length name_len
@@ -331,7 +331,7 @@ struct ZoneMonitorStartMessage
   /**
    * Zone key.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
 };
 
@@ -349,7 +349,7 @@ struct ZoneIterationStartMessage
   /**
    * Zone key.  All zeros for "all zones".
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
 };
 
index 3df6f8210f07e2e9b3c89c6795784d5cdfea3abe..c4282ec71c59508b116cccf0e8e92b1e2a3bae01 100644 (file)
@@ -134,7 +134,7 @@ struct GNUNET_NAMESTORE_ZoneIterator
   /**
    * Private key of the zone.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
   /**
    * The operation id this zone iteration operation has
@@ -592,7 +592,7 @@ handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze,
                                 const struct RecordResultMessage *msg,
                                 size_t size)
 {
-  static struct GNUNET_CRYPTO_EccPrivateKey priv_dummy;
+  static struct GNUNET_CRYPTO_EcdsaPrivateKey priv_dummy;
   size_t msg_len;
   size_t exp_msg_len;
   size_t name_len;
@@ -1082,7 +1082,7 @@ GNUNET_NAMESTORE_block_cache (struct GNUNET_NAMESTORE_Handle *h,
  */
 struct GNUNET_NAMESTORE_QueueEntry *
 GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPrivateKey *pkey,
+                               const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
                                const char *label,
                                unsigned int rd_count,
                                const struct GNUNET_NAMESTORE_RecordData *rd,
@@ -1212,8 +1212,8 @@ GNUNET_NAMESTORE_lookup_block (struct GNUNET_NAMESTORE_Handle *h,
  */
 struct GNUNET_NAMESTORE_QueueEntry *
 GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPrivateKey *zone,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone,
+                              const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+                              const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
                               GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls)
 {
   struct GNUNET_NAMESTORE_QueueEntry *qe;
@@ -1268,7 +1268,7 @@ GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h,
  */
 struct GNUNET_NAMESTORE_ZoneIterator *
 GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h,
-                                      const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                      const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                       GNUNET_NAMESTORE_RecordMonitor proc,
                                       void *proc_cls)
 {
index 8cf75330cf0bd78ceca1121ab85bece1d31438f5..81662a86173718eee2d0384d5e9cbbd28b51a891 100644 (file)
@@ -98,13 +98,13 @@ GNUNET_NAMESTORE_normalize_string (const char *src)
  * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s
  */
 const char *
-GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z)
+GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z)
 {
-  static char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) * 8];
+  static char buf[sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) * 8];
   char *end;
 
   end = GNUNET_STRINGS_data_to_string ((const unsigned char *) z,
-                                      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                                      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                                       buf, sizeof (buf));
   if (NULL == end)
   {
@@ -342,18 +342,18 @@ static void
 derive_block_aes_key (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
                      struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
                      const char *label,
-                     const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+                     const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
 {
   static const char ctx_key[] = "gns-aes-ctx-key";
   static const char ctx_iv[] = "gns-aes-ctx-iv";
 
   GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
-                    pub, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                    pub, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                     label, strlen (label),
                     ctx_key, strlen (ctx_key),
                     NULL, 0);
   GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_SymmetricInitializationVector),
-                    pub, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                    pub, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                     label, strlen (label),
                     ctx_iv, strlen (ctx_iv),
                     NULL, 0);
@@ -371,7 +371,7 @@ derive_block_aes_key (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
  * @return NULL on error (block too large)
  */
 struct GNUNET_NAMESTORE_Block *
-GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key,
+GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
                               struct GNUNET_TIME_Absolute expire,
                               const char *label,
                               const struct GNUNET_NAMESTORE_RecordData *rd,
@@ -380,8 +380,8 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key,
   size_t payload_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd);
   char payload[sizeof (uint32_t) + payload_len];
   struct GNUNET_NAMESTORE_Block *block;
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
-  struct GNUNET_CRYPTO_EccPrivateKey *dkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *dkey;
   struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
   struct GNUNET_CRYPTO_SymmetricSessionKey skey;
   uint32_t rd_count_nbo;
@@ -400,12 +400,12 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key,
                               sizeof (struct GNUNET_TIME_AbsoluteNBO));
   block->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN);
   block->expiration_time = GNUNET_TIME_absolute_hton (expire);
-  dkey = GNUNET_CRYPTO_ecc_key_derive (key,
+  dkey = GNUNET_CRYPTO_ecdsa_private_key_derive (key,
                                       label,
                                       "gns");
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (dkey,
+  GNUNET_CRYPTO_ecdsa_key_get_public (dkey,
                                    &block->derived_key);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (key,
+  GNUNET_CRYPTO_ecdsa_key_get_public (key,
                                    &pkey);
   derive_block_aes_key (&iv, &skey, label, &pkey);
   GNUNET_break (payload_len + sizeof (uint32_t) ==
@@ -413,7 +413,7 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key,
                                           &skey, &iv,
                                           &block[1]));
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_sign (dkey,
+      GNUNET_CRYPTO_ecdsa_sign (dkey,
                              &block->purpose,
                              &block->signature))
   {
@@ -437,7 +437,7 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key,
 int
 GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block)
 {
-  return GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN,
+  return GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN,
                                   &block->purpose,
                                   &block->signature,
                                   &block->derived_key);
@@ -457,7 +457,7 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block)
  */
 int
 GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key,
+                               const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key,
                                const char *label,
                                GNUNET_NAMESTORE_RecordCallback proc,
                                void *proc_cls)
@@ -653,9 +653,9 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type,
       return NULL;
     return GNUNET_strdup (tmp);
   case GNUNET_NAMESTORE_TYPE_PKEY:
-    if (data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))
+    if (data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))
       return NULL;
-    return GNUNET_CRYPTO_ecc_public_sign_key_to_string (data);
+    return GNUNET_CRYPTO_ecdsa_public_key_to_string (data);
   case GNUNET_NAMESTORE_TYPE_PHONE:
     {
       const struct GNUNET_CONVERSATION_PhoneRecord *pr;
@@ -667,7 +667,7 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type,
       pr = data;
       if (0 != ntohl (pr->version))
        return NULL;
-      pkey = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pr->peer.public_key);
+      pkey = GNUNET_CRYPTO_eddsa_public_key_to_string (&pr->peer.public_key);
       GNUNET_asprintf (&ret,
                       "%u-%s",
                       ntohl (pr->line),
@@ -792,7 +792,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type,
 {
   struct in_addr value_a;
   struct in6_addr value_aaaa;
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
   struct GNUNET_TUN_GnsVpnRecord *vpn;
   struct GNUNET_TUN_DnsTlsaRecord *tlsa;
   char s_peer[103 + 1];
@@ -987,16 +987,16 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type,
     return GNUNET_OK;
   case GNUNET_NAMESTORE_TYPE_PKEY:
     if (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_public_sign_key_from_string (s, strlen (s), &pkey))
+       GNUNET_CRYPTO_ecdsa_public_key_from_string (s, strlen (s), &pkey))
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
            _("Unable to parse PKEY record `%s'\n"),
            s);
       return GNUNET_SYSERR;
     }
-    *data = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey);
+    *data = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
     memcpy (*data, &pkey, sizeof (pkey));
-    *data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey);
+    *data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
     return GNUNET_OK;
   case GNUNET_NAMESTORE_TYPE_PHONE:
     {
@@ -1008,7 +1008,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type,
       if ( (NULL == (dash = strchr (s, '-'))) ||
           (1 != sscanf (s, "%u-", &line)) ||
           (GNUNET_OK !=
-           GNUNET_CRYPTO_ecc_public_sign_key_from_string (dash + 1,
+           GNUNET_CRYPTO_eddsa_public_key_from_string (dash + 1,
                                                           strlen (dash + 1),
                                                           &peer.public_key)) )
       {
@@ -1044,7 +1044,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type,
     }
     *data_size = sizeof (struct GNUNET_TUN_GnsVpnRecord) + strlen (s_serv) + 1;
     *data = vpn = GNUNET_malloc (*data_size);
-    if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_sign_key_from_string ((char*) s_peer,
+    if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string ((char*) s_peer,
                                                                    strlen (s_peer),
                                                                    &vpn->peer.public_key))
     {
@@ -1194,13 +1194,13 @@ GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd)
  * @param query hash to use for the query
  */
 void
-GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                         const char *label,
                                         struct GNUNET_HashCode *query)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (zone, &pub);
+  GNUNET_CRYPTO_ecdsa_key_get_public (zone, &pub);
   GNUNET_NAMESTORE_query_from_public_key (&pub, label, query);
 }
 
@@ -1213,13 +1213,13 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe
  * @param query hash to use for the query
  */
 void
-GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
+GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
                                        const char *label,
                                        struct GNUNET_HashCode *query)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pd;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pd;
 
-  GNUNET_CRYPTO_ecc_public_key_derive (pub, label, "gns", &pd);
+  GNUNET_CRYPTO_ecdsa_public_key_derive (pub, label, "gns", &pd);
   GNUNET_CRYPTO_hash (&pd, sizeof (pd), query);
 }
 
@@ -1235,12 +1235,12 @@ GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSign
  *         key in an encoding suitable for DNS labels.
  */
 const char *
-GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey)
+GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
 {
   static char ret[128];
   char *pkeys;
 
-  pkeys = GNUNET_CRYPTO_ecc_public_sign_key_to_string (pkey);
+  pkeys = GNUNET_CRYPTO_ecdsa_public_key_to_string (pkey);
   GNUNET_snprintf (ret,
                   sizeof (ret),
                   "%s.zkey",
@@ -1261,7 +1261,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey
  */
 int
 GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey,
-                              struct GNUNET_CRYPTO_EccPublicSignKey *pkey)
+                              struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
 {
   char *cpy;
   char *dot;
@@ -1277,7 +1277,7 @@ GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey,
     goto error;
 
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_public_sign_key_from_string (x,
+      GNUNET_CRYPTO_ecdsa_public_key_from_string (x,
                                                strlen (x),
                                                pkey))
     goto error;
index ccf556abd814a1b9710b0a0b0f93db438c2a2ad0..c9834e46c44973d38f1f61b0ba6d6c573f17a080 100644 (file)
@@ -73,7 +73,7 @@ struct GNUNET_NAMESTORE_ZoneMonitor
   /**
    * Monitored zone.
    */
-  struct GNUNET_CRYPTO_EccPrivateKey zone;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
 
 };
 
@@ -255,7 +255,7 @@ transmit_monitor_message (void *cls,
  */
 struct GNUNET_NAMESTORE_ZoneMonitor *
 GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                                    const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                     GNUNET_NAMESTORE_RecordMonitor monitor,
                                     GNUNET_NAMESTORE_RecordsSynchronizedCallback sync_cb,
                                     void *cls)
index 7be06b2f503170c08677d8d7c0fcb36e9a02a81f..6a1dc6f2cfef703edab39862c1776bad014f9924 100644 (file)
@@ -337,8 +337,8 @@ namestore_postgres_cache_block (void *cls,
   struct Plugin *plugin = cls;
   struct GNUNET_HashCode query;
   size_t block_size = ntohl (block->purpose.size) +
-    sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-    sizeof (struct GNUNET_CRYPTO_EccSignature);
+    sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+    sizeof (struct GNUNET_CRYPTO_EcdsaSignature);
   const char *paramValues[] = {
     (const char *) &query,
     (const char *) block,
@@ -354,7 +354,7 @@ namestore_postgres_cache_block (void *cls,
 
   namestore_postgres_expire_blocks (plugin);
   GNUNET_CRYPTO_hash (&block->derived_key,
-                     sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                      &query);
   if (block_size > 64 * 65536)
   {
@@ -433,8 +433,8 @@ namestore_postgres_lookup_block (void *cls,
   block = (const struct GNUNET_NAMESTORE_Block *) PQgetvalue (res, 0, 0);
   if ( (bsize < sizeof (*block)) ||
        (bsize != ntohl (block->purpose.size) +
-        sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-        sizeof (struct GNUNET_CRYPTO_EccSignature)) )
+        sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+        sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) )
   {
     GNUNET_break (0);
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -461,13 +461,13 @@ namestore_postgres_lookup_block (void *cls,
  */
 static int
 namestore_postgres_store_records (void *cls,
-                                  const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                                  const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                                   const char *label,
                                   unsigned int rd_count,
                                   const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   struct Plugin *plugin = cls;
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
   uint64_t rvalue;
   uint32_t rd_count_nbo = htonl ((uint32_t) rd_count);
   size_t data_size;
@@ -477,7 +477,7 @@ namestore_postgres_store_records (void *cls,
   for (i=0;i<rd_count;i++)
     if (GNUNET_NAMESTORE_TYPE_PKEY == rd[i].record_type)
     {
-      GNUNET_break (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) == rd[i].data_size);
+      GNUNET_break (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) == rd[i].data_size);
       memcpy (&pkey,
               rd[i].data,
               rd[i].data_size);
@@ -549,7 +549,7 @@ namestore_postgres_store_records (void *cls,
 static int
 get_record_and_call_iterator (struct Plugin *plugin,
                               PGresult *res,
-                             const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                             const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                              GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 {
   const char *data;
@@ -580,13 +580,13 @@ get_record_and_call_iterator (struct Plugin *plugin,
   GNUNET_assert (3 + ((NULL == zone_key) ? 1 : 0) == PQnfields (res));
   if (NULL == zone_key)
   {
-    if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) != PQgetlength (res, 0, 3))
+    if (sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey) != PQgetlength (res, 0, 3))
     {
       GNUNET_break (0);
       PQclear (res);
       return GNUNET_SYSERR;
     }
-    zone_key = (const struct GNUNET_CRYPTO_EccPrivateKey *) PQgetvalue (res, 0, 3);
+    zone_key = (const struct GNUNET_CRYPTO_EcdsaPrivateKey *) PQgetvalue (res, 0, 3);
   }
   if (sizeof (uint32_t) != PQfsize (res, 0))
   {
@@ -642,7 +642,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
  */
 static int
 namestore_postgres_iterate_records (void *cls,
-                                    const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                    const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                     uint64_t offset,
                                     GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 {
@@ -707,8 +707,8 @@ namestore_postgres_iterate_records (void *cls,
  */
 static int
 namestore_postgres_zone_to_name (void *cls,
-                                 const struct GNUNET_CRYPTO_EccPrivateKey *zone,
-                                 const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone,
+                                 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+                                 const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
                                  GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 {
   struct Plugin *plugin = cls;
index 19fa86bf3a4f59ffe1368803cd1439766fb5e820..729b916ca4ef962ff9a54f752146a82153c9759b 100644 (file)
@@ -467,15 +467,15 @@ namestore_sqlite_cache_block (void *cls,
 
   namestore_sqlite_expire_blocks (plugin);
   GNUNET_CRYPTO_hash (&block->derived_key,
-                     sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                      &query);
   expiration = GNUNET_TIME_absolute_ntoh (block->expiration_time);
   dval = (int64_t) expiration.abs_value_us;
   if (dval < 0)
     dval = INT64_MAX;
   block_size = ntohl (block->purpose.size) +
-    sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-    sizeof (struct GNUNET_CRYPTO_EccSignature);
+    sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+    sizeof (struct GNUNET_CRYPTO_EcdsaSignature);
   if (block_size > 64 * 65536)
   {
     GNUNET_break (0);
@@ -606,8 +606,8 @@ namestore_sqlite_lookup_block (void *cls,
     block_size = sqlite3_column_bytes (plugin->lookup_block, 0);
     if ( (block_size < sizeof (struct GNUNET_NAMESTORE_Block)) ||
         (ntohl (block->purpose.size) +
-         sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
-         sizeof (struct GNUNET_CRYPTO_EccSignature) != block_size) )
+         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+         sizeof (struct GNUNET_CRYPTO_EcdsaSignature) != block_size) )
     {
       GNUNET_break (0);
       ret = GNUNET_SYSERR;
@@ -656,14 +656,14 @@ namestore_sqlite_lookup_block (void *cls,
  */
 static int
 namestore_sqlite_store_records (void *cls,
-                               const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                               const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                                const char *label,
                                unsigned int rd_count,
                                const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   struct Plugin *plugin = cls;
   int n;
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
   uint64_t rvalue;
   size_t data_size;
   unsigned int i;
@@ -672,7 +672,7 @@ namestore_sqlite_store_records (void *cls,
   for (i=0;i<rd_count;i++)
     if (GNUNET_NAMESTORE_TYPE_PKEY == rd[i].record_type)
     {
-      GNUNET_break (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) == rd[i].data_size);
+      GNUNET_break (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) == rd[i].data_size);
       memcpy (&pkey,
               rd[i].data,
               rd[i].data_size);
@@ -697,7 +697,7 @@ namestore_sqlite_store_records (void *cls,
 
     /* First delete 'old' records */
     if ((SQLITE_OK != sqlite3_bind_blob (plugin->delete_records, 1,
-                                        zone_key, sizeof (struct GNUNET_CRYPTO_EccPrivateKey), SQLITE_STATIC)) ||
+                                        zone_key, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey), SQLITE_STATIC)) ||
        (SQLITE_OK != sqlite3_bind_text (plugin->delete_records, 2, label, -1, SQLITE_STATIC)))
     {
       LOG_SQLITE (plugin,
@@ -718,9 +718,9 @@ namestore_sqlite_store_records (void *cls,
     if (0 != rd_count)
     {
       if ((SQLITE_OK != sqlite3_bind_blob (plugin->store_records, 1,
-                                          zone_key, sizeof (struct GNUNET_CRYPTO_EccPrivateKey), SQLITE_STATIC)) ||
+                                          zone_key, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey), SQLITE_STATIC)) ||
          (SQLITE_OK != sqlite3_bind_blob (plugin->store_records, 2,
-                                          &pkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), SQLITE_STATIC)) ||
+                                          &pkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), SQLITE_STATIC)) ||
          (SQLITE_OK != sqlite3_bind_int64 (plugin->store_records, 3, rvalue)) ||
          (SQLITE_OK != sqlite3_bind_int (plugin->store_records, 4, rd_count)) ||
          (SQLITE_OK != sqlite3_bind_blob (plugin->store_records, 5, data, data_size, SQLITE_STATIC)) ||
@@ -776,7 +776,7 @@ namestore_sqlite_store_records (void *cls,
 static int
 get_record_and_call_iterator (struct Plugin *plugin,
                              sqlite3_stmt *stmt,
-                             const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+                             const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
                              GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 {
   unsigned int record_count;
@@ -796,7 +796,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
     if (NULL == zone_key)
     {
       /* must be "iterate_all_zones", got one extra return value */
-      if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) !=
+      if (sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey) !=
          sqlite3_column_bytes (stmt, 3))
       {
        GNUNET_break (0);
@@ -859,7 +859,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
  */
 static int
 namestore_sqlite_iterate_records (void *cls,
-                                 const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                  uint64_t offset,
                                  GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 {
@@ -877,7 +877,7 @@ namestore_sqlite_iterate_records (void *cls,
   {
     stmt = plugin->iterate_zone;
     err = ( (SQLITE_OK != sqlite3_bind_blob (stmt, 1,
-                                            zone, sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+                                            zone, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
                                             SQLITE_STATIC)) ||
            (SQLITE_OK != sqlite3_bind_int64 (stmt, 2,
                                              offset)) );
@@ -909,8 +909,8 @@ namestore_sqlite_iterate_records (void *cls,
  */
 static int
 namestore_sqlite_zone_to_name (void *cls,
-                              const struct GNUNET_CRYPTO_EccPrivateKey *zone,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone,
+                              const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+                              const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
                               GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 {
   struct Plugin *plugin = cls;
@@ -918,10 +918,10 @@ namestore_sqlite_zone_to_name (void *cls,
 
   stmt = plugin->zone_to_name;
   if ( (SQLITE_OK != sqlite3_bind_blob (stmt, 1,
-                                       zone, sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+                                       zone, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
                                        SQLITE_STATIC)) ||
        (SQLITE_OK != sqlite3_bind_blob (stmt, 2,
-                                       value_zone, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                                       value_zone, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                                        SQLITE_STATIC)) )
   {
     LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
index e480def31bab9d21fba35f0503d9bceeedf91fab..001e7e182cc9778c4b92846e161f0169767b6f3c 100644 (file)
@@ -40,7 +40,7 @@
 #define TEST_REMOVE_RECORD_DATA 'b'
 
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
 static struct GNUNET_NAMESTORE_RecordData *s_rd;
 
@@ -99,19 +99,19 @@ run (void *cls, char *const *args, const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_NAMESTORE_Block *block;
-  struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
   /* load privat key */
   char *hostkey_file;
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
   struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get();
   /* get public key */
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public(privkey, &pubkey);
 
   /* create record */
   s_name = "DUMMY.dummy.gnunet";
index 8ed010abd3071d038a1cabf43669dd4ebb51358d..1fee80ec8a25e5a5c7590270bef2d2b6a0a3d0ac 100644 (file)
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static int res;
 
@@ -182,10 +182,10 @@ run (void *cls,
                   DIR_SEPARATOR_STR,
                   "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
 
 
   rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us;
index f2b009ac537f0e070f2bdc654aea045a3b7834d4..6c6ee55ecfecf881698551aff4794d40b9bf61f7 100644 (file)
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static int res;
 
@@ -149,7 +149,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
 {
   const char *name = cls;
   struct GNUNET_HashCode derived_hash;
-  struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
   GNUNET_assert (NULL != cls);
 
@@ -159,7 +159,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
              (success == GNUNET_OK) ? "SUCCESS" : "FAIL");
 
   /* Create derived hash */
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
   GNUNET_NAMESTORE_query_from_public_key (&pubkey, name, &derived_hash);
 
   nsqe = GNUNET_NAMESTORE_lookup_block (nsh, &derived_hash,
@@ -183,10 +183,10 @@ run (void *cls,
                   DIR_SEPARATOR_STR,
                   "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
 
 
   rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us;
index d0662617e49095c22fdb7536715718fcf4f9108a..2d5888a5ebeb4615bd881942879f3650c08103f6 100644 (file)
@@ -34,9 +34,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey2;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
 
 static struct GNUNET_NAMESTORE_ZoneMonitor *zm;
 
@@ -145,7 +145,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 zone_proc (void *cls,
-          const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+          const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
           const char *name,
           unsigned int rd_count,
           const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -156,7 +156,7 @@ zone_proc (void *cls,
              "Comparing results name %s\n",
              name);
 
-  if (0 != memcmp (zone_key, privkey, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+  if (0 != memcmp (zone_key, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Monitoring returned wrong zone key\n");
@@ -268,7 +268,7 @@ run (void *cls,
                  "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
 
@@ -301,7 +301,7 @@ run (void *cls,
                  DIR_SEPARATOR_STR,
                  "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey2 != NULL);
 
index 4db1c6d62a32b059afaf4ba6c2c4bf69ae2c7747..3b2ca60929f2464e9ed582cdcff81835c424b5ce 100644 (file)
@@ -35,9 +35,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey2;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
 
 static struct GNUNET_NAMESTORE_ZoneMonitor *zm;
 
@@ -146,7 +146,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 zone_proc (void *cls,
-          const struct GNUNET_CRYPTO_EccPrivateKey *zone_key,
+          const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
           const char *name,
           unsigned int rd_count,
           const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -157,7 +157,7 @@ zone_proc (void *cls,
              "Comparing results name %s\n",
              name);
 
-  if (0 != memcmp (zone_key, privkey, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+  if (0 != memcmp (zone_key, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Monitoring returned wrong zone key\n");
@@ -286,7 +286,7 @@ run (void *cls,
                  "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
 
@@ -306,7 +306,7 @@ run (void *cls,
                  DIR_SEPARATOR_STR,
                  "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey2 != NULL);
 
index e3610ccaf4773e768d9642ae3575098c83215d16..983ea6804b9d607bb606edd67cf7fb0362e76c62 100644 (file)
@@ -41,9 +41,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static struct GNUNET_NAMESTORE_RecordData *s_rd;
 
@@ -135,7 +135,7 @@ run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *cfg,
      struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_CRYPTO_EccSignature *signature;
+  struct GNUNET_CRYPTO_EcdsaSignature *signature;
   char * s_name;
   int c;
   char *hostkey_file;
@@ -146,11 +146,11 @@ run (void *cls,
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_assert (privkey != NULL);
   GNUNET_free (hostkey_file);
   /* get public key */
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public(privkey, &pubkey);
   nsh = GNUNET_NAMESTORE_connect (cfg);
   GNUNET_break (NULL != nsh);
   /* create record */
index 3f3823e897821885340c65d9682b7c035aea0145..f43bafecc82aec5bb0346a45e09e51c5bc2fa816 100644 (file)
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static struct GNUNET_HashCode derived_hash;
 
@@ -244,10 +244,10 @@ run (void *cls,
                   DIR_SEPARATOR_STR,
                   "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
 
   removed = GNUNET_NO;
 
index 86cf47e26976a718e98d15c615f0be2bc266a961..231d7b0bc084334e19a52858625a9c03298c2e5e 100644 (file)
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static int res;
 
@@ -148,10 +148,10 @@ run (void *cls,
                   DIR_SEPARATOR_STR,
                   "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
 
   nsh = GNUNET_NAMESTORE_connect (cfg);
   GNUNET_break (NULL != nsh);
index 69c47337fc22976492699bd2146c49cae20ce43a..133bf567fe1946c63b6c0254a4bb5042bcaf7096 100644 (file)
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static int res;
 
@@ -181,10 +181,10 @@ run (void *cls,
                   DIR_SEPARATOR_STR,
                   "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
 
 
   rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us;
index 8b10763c0949a8fef0e1fb5444bdbf508f396b4c..91b8511c997ec006358c69141a5ee64f460c5ff2 100644 (file)
@@ -46,9 +46,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static int res;
 
@@ -225,10 +225,10 @@ run (void *cls,
                   DIR_SEPARATOR_STR,
                   "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
 
   rd.flags = GNUNET_NAMESTORE_RF_NONE;
   rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us;
index 94fd6d008b59ad93de784c8658be9ef1681702e9..48671897e70019233f7f9cf0ba4b0f7ce2d180c6 100644 (file)
@@ -34,9 +34,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey2;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
 
 static struct GNUNET_NAMESTORE_ZoneIterator *zi;
 
@@ -156,7 +156,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 zone_proc (void *cls,
-                                        const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                        const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                         const char *label,
                                         unsigned int rd_count,
                                         const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -181,7 +181,7 @@ zone_proc (void *cls,
   }
   else
   {
-       if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+       if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
        {
       if (0 == strcmp (label, s_name_1))
       {
@@ -225,7 +225,7 @@ zone_proc (void *cls,
         GNUNET_break (0);
       }
        }
-       else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+       else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
        {
       if (0 == strcmp (label, s_name_3))
       {
@@ -345,7 +345,7 @@ create_record (unsigned int count)
  */
 static void
 empty_zone_proc (void *cls,
-                const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                 const char *label,
                 unsigned int rd_count,
                 const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -379,14 +379,14 @@ empty_zone_proc (void *cls,
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
 
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey2 != NULL);
 
index a34e742f0895cb08778389c7f52acd29055e4e0d..7707c418e27016300f3313df298e939110ac69a8 100644 (file)
@@ -34,9 +34,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey2;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
 
 static struct GNUNET_NAMESTORE_ZoneIterator *zi;
 
@@ -156,7 +156,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 zone_proc (void *cls,
-                                        const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                        const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                         const char *label,
                                         unsigned int rd_count,
                                         const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -181,7 +181,7 @@ zone_proc (void *cls,
   }
   else
   {
-       if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+       if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
        {
       if (0 == strcmp (label, s_name_1))
       {
@@ -225,7 +225,7 @@ zone_proc (void *cls,
         GNUNET_break (0);
       }
        }
-       else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+       else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
        {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received data for not requested zone\n");
       failed = GNUNET_YES;
@@ -323,7 +323,7 @@ create_record (unsigned int count)
  */
 static void
 empty_zone_proc (void *cls,
-                const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                 const char *label,
                 unsigned int rd_count,
                 const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -357,14 +357,14 @@ empty_zone_proc (void *cls,
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
 
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey2 != NULL);
 
index ebc26db795c7c749a0e442db90c83b4612e1b257..e56559f96c1b5030a0a61c327a4033a320d324c9 100644 (file)
@@ -34,9 +34,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey2;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
 
 static struct GNUNET_NAMESTORE_ZoneIterator *zi;
 
@@ -156,7 +156,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 zone_proc (void *cls,
-                                        const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                                        const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                                         const char *label,
                                         unsigned int rd_count,
                                         const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -178,7 +178,7 @@ zone_proc (void *cls,
   }
   else
   {
-       if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+       if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
        {
       if (0 == strcmp (label, s_name_1))
       {
@@ -222,7 +222,7 @@ zone_proc (void *cls,
         GNUNET_break (0);
       }
        }
-       else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+       else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
        {
       if (0 == strcmp (label, s_name_3))
       {
@@ -357,7 +357,7 @@ create_record (unsigned int count)
  */
 static void
 empty_zone_proc (void *cls,
-                const struct GNUNET_CRYPTO_EccPrivateKey *zone,
+                const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
                 const char *label,
                 unsigned int rd_count,
                 const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -391,14 +391,14 @@ empty_zone_proc (void *cls,
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
 
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey2 != NULL);
 
index 1eeed10012dfcda1c52837aa19b47976ba4029c7..973cc18a0d990c47c24d6a9fda74043b4cd3bf83 100644 (file)
@@ -41,9 +41,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh;
 
 static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
 
 static struct GNUNET_TIME_Absolute expire;
 
@@ -53,7 +53,7 @@ static struct GNUNET_CRYPTO_ShortHashCode s_zone_value;
 
 static char * s_name;
 
-static struct GNUNET_CRYPTO_EccSignature *s_signature;
+static struct GNUNET_CRYPTO_EcdsaSignature *s_signature;
 
 static int res;
 
@@ -96,12 +96,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 zone_to_name_proc (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key,
+                  const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key,
                   struct GNUNET_TIME_Absolute expire,
                   const char *n,
                   unsigned int rd_count,
                   const struct GNUNET_NAMESTORE_RecordData *rd,
-                  const struct GNUNET_CRYPTO_EccSignature *signature)
+                  const struct GNUNET_CRYPTO_EcdsaSignature *signature)
 {
   int fail = GNUNET_NO;
 
@@ -123,7 +123,7 @@ zone_to_name_proc (void *cls,
       fail = GNUNET_YES;
       GNUNET_break (0);
     }
-    if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))))
+    if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))))
     {
       fail = GNUNET_YES;
       GNUNET_break (0);
@@ -173,14 +173,14 @@ run (void *cls,
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
       "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file);
+  privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
   GNUNET_free (hostkey_file);
   GNUNET_assert (privkey != NULL);
   /* get public key */
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey);
+  GNUNET_CRYPTO_ecdsa_key_get_public(privkey, &pubkey);
 
   /* zone hash */
-  GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &s_zone);
+  GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), &s_zone);
   GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value));
 
index 5274e8bca6d9ede46eff7112fbcde08a982bf91c..7e77f4317713bcfa32d3927631fd11d3bbb4865b 100644 (file)
@@ -81,14 +81,14 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg)
 
 static void
 test_record (void *cls,
-                                                const struct GNUNET_CRYPTO_EccPrivateKey *private_key,
+                                                const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key,
                                                 const char *label,
                                                 unsigned int rd_count,
                                                 const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   int *idp = cls;
   int id = *idp;
-  struct GNUNET_CRYPTO_EccPrivateKey tzone_private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey tzone_private_key;
   char tname[64];
   unsigned int trd_count = 1 + (id % 1024);
   unsigned int i;
@@ -104,7 +104,7 @@ test_record (void *cls,
   }
   memset (&tzone_private_key, (id % 241), sizeof (tzone_private_key));
   GNUNET_assert (0 == strcmp (label, tname));
-  GNUNET_assert (0 == memcmp (&tzone_private_key, private_key, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)));
+  GNUNET_assert (0 == memcmp (&tzone_private_key, private_key, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)));
 }
 
 
@@ -119,11 +119,11 @@ get_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id)
 static void
 put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey zone_private_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey zone_private_key;
   char label[64];
   unsigned int rd_count = 1 + (id % 1024);
   struct GNUNET_NAMESTORE_RecordData rd[rd_count];
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
   unsigned int i;
 
   GNUNET_snprintf (label, sizeof (label),
index b69a4a7fe4eb0cd79a534382d6eebb208e676bd3..366770cadd6ab4e793219b640ff25ee2767f4812 100644 (file)
@@ -199,7 +199,7 @@ struct GNUNET_NSE_FloodMessage
   /**
    * Signature (over range specified in purpose).
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 };
 GNUNET_NETWORK_STRUCT_END
 
@@ -288,7 +288,7 @@ static struct GNUNET_TIME_Absolute current_timestamp;
 /**
  * The private key of this peer.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 /**
  * The peer identity of this peer.
@@ -710,14 +710,14 @@ setup_flood_message (unsigned int slot,
   fm->purpose.size =
       htonl (sizeof (struct GNUNET_NSE_FloodMessage) -
              sizeof (struct GNUNET_MessageHeader) - sizeof (uint32_t) -
-             sizeof (struct GNUNET_CRYPTO_EccSignature));
+             sizeof (struct GNUNET_CRYPTO_EddsaSignature));
   fm->matching_bits = htonl (matching_bits);
   fm->timestamp = GNUNET_TIME_absolute_hton (ts);
   fm->origin = my_identity;
   fm->proof_of_work = my_proof;
   if (nse_work_required > 0)
     GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CRYPTO_ecc_sign (my_private_key, &fm->purpose,
+                   GNUNET_CRYPTO_eddsa_sign (my_private_key, &fm->purpose,
                                            &fm->signature));
   else
     memset (&fm->signature, 0, sizeof (fm->signature));
@@ -849,16 +849,16 @@ count_leading_zeroes (const struct GNUNET_HashCode *hash)
  * @return #GNUNET_YES if valid, #GNUNET_NO if not
  */
 static int
-check_proof_of_work (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey,
+check_proof_of_work (const struct GNUNET_CRYPTO_EddsaPublicKey *pkey,
                      uint64_t val)
 {
-  char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
+  char buf[sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
            sizeof (val)] GNUNET_ALIGN;
   struct GNUNET_HashCode result;
 
   memcpy (buf, &val, sizeof (val));
   memcpy (&buf[sizeof (val)], pkey,
-          sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+          sizeof (struct GNUNET_CRYPTO_EddsaPublicKey));
   pow_hash (buf, sizeof (buf), &result);
   return (count_leading_zeroes (&result) >=
           nse_work_required) ? GNUNET_YES : GNUNET_NO;
@@ -898,7 +898,7 @@ find_proof (void *cls,
 {
 #define ROUND_SIZE 10
   uint64_t counter;
-  char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
+  char buf[sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
            sizeof (uint64_t)] GNUNET_ALIGN;
   struct GNUNET_HashCode result;
   unsigned int i;
@@ -967,7 +967,7 @@ verify_message_crypto (const struct GNUNET_NSE_FloodMessage *incoming_flood)
   }
   if ((nse_work_required > 0) &&
       (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_NSE_SEND,
+       GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_NSE_SEND,
                                  &incoming_flood->purpose,
                                  &incoming_flood->signature,
                                  &incoming_flood->origin.public_key)))
@@ -1421,7 +1421,7 @@ run (void *cls,
     {NULL, 0, 0}
   };
   char *proof;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
 
   cfg = c;
   srv = server;
@@ -1474,10 +1474,10 @@ run (void *cls,
 
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
-  pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
   GNUNET_assert (NULL != pk);
   my_private_key = pk;
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (my_private_key,
                                                  &my_identity.public_key);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "PROOFFILE", &proof))
index 67aeddbe7b56df73c3b651d1ea178f52bb4a84a2..e62df3047d03cbbfc65de6ef22902ce0008e5b07 100644 (file)
@@ -628,7 +628,7 @@ static void
 run (void *cls, char *const *args, const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
   char *fn;
 
   cfg = c;
@@ -662,14 +662,14 @@ run (void *cls, char *const *args, const char *cfgfile,
               "GNUNETD", "HOSTKEYFILE");
       return;
     }
-    if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_file (fn)))
+    if (NULL == (priv = GNUNET_CRYPTO_eddsa_key_create_from_file (fn)))
     {
       FPRINTF (stderr, _("Loading hostkey from `%s' failed.\n"), fn);
       GNUNET_free (fn);
       return;
     }
     GNUNET_free (fn);
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv,
+    GNUNET_CRYPTO_eddsa_key_get_public (priv,
                                                    &my_peer_identity.public_key);
     GNUNET_free (priv);
   }
index d62e81eae8744b6c21971fb1fc54807ab8ed79d7..fe5094d79e830ca62bd36f5985506f4262a56932 100644 (file)
@@ -575,7 +575,7 @@ hosts_directory_scan_callback (void *cls, const char *fullname)
       remove_garbage (fullname);
     return GNUNET_OK;
   }
-  if (GNUNET_OK == GNUNET_CRYPTO_ecc_public_sign_key_from_string (filename,
+  if (GNUNET_OK == GNUNET_CRYPTO_eddsa_public_key_from_string (filename,
                                                                   strlen (filename),
                                                                   &identity.public_key))
   {
@@ -654,7 +654,7 @@ update_friend_hello (const struct GNUNET_HELLO_Message *hello,
 {
   struct GNUNET_HELLO_Message * res;
   struct GNUNET_HELLO_Message * tmp;
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EddsaPublicKey pk;
 
   if (NULL != friend_hello)
   {
index adc52c2547762d4f40ed11cd2b3644bbbe4871ab..3562169989b6e17f95860a1219bd9255a53300a5 100644 (file)
@@ -621,7 +621,7 @@ database_shutdown (struct Plugin *plugin)
  */
 static int
 exec_channel (struct Plugin *plugin, sqlite3_stmt *stmt,
-              const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+              const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
 {
   if (SQLITE_OK != sqlite3_bind_blob (stmt, 1, channel_key,
                                       sizeof (*channel_key), SQLITE_STATIC))
@@ -721,7 +721,7 @@ transaction_rollback (struct Plugin *plugin)
 
 static int
 channel_key_store (struct Plugin *plugin,
-                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
 {
   sqlite3_stmt *stmt = plugin->insert_channel_key;
 
@@ -750,7 +750,7 @@ channel_key_store (struct Plugin *plugin,
 
 static int
 slave_key_store (struct Plugin *plugin,
-                 const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key)
+                 const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key)
 {
   sqlite3_stmt *stmt = plugin->insert_slave_key;
 
@@ -788,8 +788,8 @@ slave_key_store (struct Plugin *plugin,
  */
 static int
 membership_store (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                   int did_join,
                   uint64_t announced_at,
                   uint64_t effective_since,
@@ -850,8 +850,8 @@ membership_store (void *cls,
  */
 static int
 membership_test (void *cls,
-                 const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                 const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                 const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                 const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                  uint64_t message_id)
 {
   struct Plugin *plugin = cls;
@@ -897,7 +897,7 @@ membership_test (void *cls,
  */
 static int
 fragment_store (void *cls,
-                const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                 const struct GNUNET_MULTICAST_MessageHeader *msg,
                 uint32_t psycstore_flags)
 {
@@ -970,7 +970,7 @@ fragment_store (void *cls,
  */
 static int
 message_add_flags (void *cls,
-                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                    uint64_t message_id,
                    uint64_t psycstore_flags)
 {
@@ -1045,7 +1045,7 @@ fragment_row (sqlite3_stmt *stmt, GNUNET_PSYCSTORE_FragmentCallback cb,
  */
 static int
 fragment_get (void *cls,
-              const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+              const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
               uint64_t fragment_id,
               GNUNET_PSYCSTORE_FragmentCallback cb,
               void *cb_cls)
@@ -1096,7 +1096,7 @@ fragment_get (void *cls,
  */
 static int
 message_get (void *cls,
-             const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+             const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
              uint64_t message_id,
              uint64_t *returned_fragments,
              GNUNET_PSYCSTORE_FragmentCallback cb,
@@ -1160,7 +1160,7 @@ message_get (void *cls,
  */
 static int
 message_get_fragment (void *cls,
-                      const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                      const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                       uint64_t message_id,
                       uint64_t fragment_offset,
                       GNUNET_PSYCSTORE_FragmentCallback cb,
@@ -1213,7 +1213,7 @@ message_get_fragment (void *cls,
  */
 static int
 counters_message_get (void *cls,
-                      const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                      const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                       uint64_t *max_fragment_id,
                       uint64_t *max_message_id,
                       uint64_t *max_group_generation)
@@ -1266,7 +1266,7 @@ counters_message_get (void *cls,
  */
 static int
 counters_state_get (void *cls,
-                    const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                    const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                     uint64_t *max_state_message_id)
 {
   struct Plugin *plugin = cls;
@@ -1314,7 +1314,7 @@ counters_state_get (void *cls,
  */
 static int
 state_set (struct Plugin *plugin, sqlite3_stmt *stmt,
-           const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+           const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
            const char *name, const void *value, size_t value_size)
 {
   int ret = GNUNET_SYSERR;
@@ -1354,7 +1354,7 @@ state_set (struct Plugin *plugin, sqlite3_stmt *stmt,
 
 static int
 update_message_id (struct Plugin *plugin, sqlite3_stmt *stmt,
-                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                    uint64_t message_id)
 {
   if (SQLITE_OK != sqlite3_bind_int64 (stmt, 1, message_id)
@@ -1384,7 +1384,7 @@ update_message_id (struct Plugin *plugin, sqlite3_stmt *stmt,
  */
 static int
 state_modify_begin (void *cls,
-                    const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                    const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                     uint64_t message_id, uint64_t state_delta)
 {
   struct Plugin *plugin = cls;
@@ -1449,7 +1449,7 @@ state_modify_begin (void *cls,
  */
 static int
 state_modify_set (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                   const char *name, const void *value, size_t value_size)
 {
   struct Plugin *plugin = cls;
@@ -1466,7 +1466,7 @@ state_modify_set (void *cls,
  */
 static int
 state_modify_end (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                   uint64_t message_id)
 {
   struct Plugin *plugin = cls;
@@ -1487,7 +1487,7 @@ state_modify_end (void *cls,
  */
 static int
 state_sync_begin (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
 {
   struct Plugin *plugin = cls;
   return exec_channel (plugin, plugin->delete_state_sync, channel_key);
@@ -1503,7 +1503,7 @@ state_sync_begin (void *cls,
  */
 static int
 state_sync_set (void *cls,
-                const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                 const char *name, const void *value, size_t value_size)
 {
   struct Plugin *plugin = cls;
@@ -1517,7 +1517,7 @@ state_sync_set (void *cls,
  */
 static int
 state_sync_end (void *cls,
-                const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                 uint64_t message_id)
 {
   struct Plugin *plugin = cls;
@@ -1547,7 +1547,7 @@ state_sync_end (void *cls,
  * @return #GNUNET_OK on success, else #GNUNET_SYSERR
  */
 static int
-state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+state_reset (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
 {
   struct Plugin *plugin = cls;
   return exec_channel (plugin, plugin->delete_state, channel_key);
@@ -1563,7 +1563,7 @@ state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key
  */
 static int
 state_update_signed (void *cls,
-                     const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key)
+                     const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key)
 {
   struct Plugin *plugin = cls;
   return exec_channel (plugin, plugin->update_state_signed, channel_key);
@@ -1578,7 +1578,7 @@ state_update_signed (void *cls,
  * @return #GNUNET_OK on success, else #GNUNET_SYSERR
  */
 static int
-state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+state_get (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
            const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls)
 {
   struct Plugin *plugin = cls;
@@ -1629,7 +1629,7 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
  * @return #GNUNET_OK on success, else #GNUNET_SYSERR
  */
 static int
-state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                   const char *name, GNUNET_PSYCSTORE_StateCallback cb,
                   void *cb_cls)
 {
@@ -1697,7 +1697,7 @@ state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channe
  */
 static int
 state_get_signed (void *cls,
-                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                   GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls)
 {
   struct Plugin *plugin = cls;
index 61d4adc06a29f79a53d4fed3e664cd0bffe43571..f28d1ba786e45661762314fa89a6d60f9e6f9ba6 100644 (file)
@@ -144,7 +144,7 @@ struct OperationRequest
    */
   uint32_t op_id GNUNET_PACKED;
 
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
 };
 
@@ -167,12 +167,12 @@ struct MembershipStoreRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   /**
    * Slave's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey slave_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey slave_key;
 
   uint64_t announced_at GNUNET_PACKED;
   uint64_t effective_since GNUNET_PACKED;
@@ -199,12 +199,12 @@ struct MembershipTestRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   /**
    * Slave's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey slave_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey slave_key;
 
   uint64_t message_id GNUNET_PACKED;
 
@@ -230,7 +230,7 @@ struct FragmentStoreRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint32_t psycstore_flags GNUNET_PACKED;
 };
@@ -254,7 +254,7 @@ struct FragmentGetRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t fragment_id GNUNET_PACKED;
 };
@@ -278,7 +278,7 @@ struct MessageGetRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t message_id GNUNET_PACKED;
 };
@@ -302,7 +302,7 @@ struct MessageGetFragmentRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t message_id GNUNET_PACKED;
 
@@ -328,7 +328,7 @@ struct StateHashUpdateRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   struct GNUNET_HashCode hash;
 };
@@ -357,7 +357,7 @@ struct StateModifyRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t message_id GNUNET_PACKED;
 
@@ -400,7 +400,7 @@ struct StateSyncRequest
   /**
    * Channel's public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
 
   uint64_t message_id GNUNET_PACKED;
 
index 0e72d9ca20c1bfdd95f69983660769f4693195e5..55d7f73ecdfedb85dd760312b35a61d48a66bd03 100644 (file)
@@ -655,8 +655,8 @@ GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op)
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                                    int did_join,
                                    uint64_t announced_at,
                                    uint64_t effective_since,
@@ -721,8 +721,8 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                                   uint64_t message_id,
                                   uint64_t group_generation,
                                   GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -769,7 +769,7 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
-                                 const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                 const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                  const struct GNUNET_MULTICAST_MessageHeader *message,
                                  uint32_t psycstore_flags,
                                  GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -815,7 +815,7 @@ GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                uint64_t fragment_id,
                                GNUNET_PSYCSTORE_FragmentCallback fcb,
                                GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -860,7 +860,7 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                              const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                               uint64_t message_id,
                               GNUNET_PSYCSTORE_FragmentCallback fcb,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -907,7 +907,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
-                                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                        uint64_t message_id,
                                        uint64_t fragment_offset,
                                        GNUNET_PSYCSTORE_FragmentCallback fcb,
@@ -955,7 +955,7 @@ GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
-                               struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                GNUNET_PSYCSTORE_CountersCallback ccb,
                                void *mccb_cls)
 {
@@ -1001,7 +1001,7 @@ GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                uint64_t message_id,
                                uint64_t state_delta,
                                size_t modifier_count,
@@ -1070,7 +1070,7 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
-                             const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                             const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                              uint64_t message_id,
                              size_t modifier_count,
                              const struct GNUNET_ENV_Modifier *modifiers,
@@ -1132,7 +1132,7 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey
+                              const struct GNUNET_CRYPTO_EddsaPublicKey
                               *channel_key,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
                               void *rcb_cls)
@@ -1174,7 +1174,7 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
-                                    const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                    const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                     uint64_t message_id,
                                     const struct GNUNET_HashCode *hash,
                                     GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -1218,7 +1218,7 @@ GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
-                            const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                            const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                             const char *name,
                             GNUNET_PSYCSTORE_StateCallback scb,
                             GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -1265,7 +1265,7 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_get_prefix (struct GNUNET_PSYCSTORE_Handle *h,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                    const char *name_prefix,
                                    GNUNET_PSYCSTORE_StateCallback scb,
                                    GNUNET_PSYCSTORE_ResultCallback rcb,
index 0a8d4c2bcbdcc8bc10a0fab73f287835f7cb256f..ccd3751bf77cd6caab58703b741c8eb441333a86 100644 (file)
@@ -50,11 +50,11 @@ static int ok;
  */
 static const char *plugin_name;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *channel_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *slave_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *slave_key;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key;
-static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key;
+static struct GNUNET_CRYPTO_EddsaPublicKey channel_pub_key;
+static struct GNUNET_CRYPTO_EddsaPublicKey slave_pub_key;
 
 /**
  * Function called when the service shuts down.  Unloads our psycstore
@@ -177,9 +177,9 @@ run (void *cls, char *const *args, const char *cfgfile,
   channel_key = GNUNET_CRYPTO_ecc_key_create ();
   slave_key = GNUNET_CRYPTO_ecc_key_create ();
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (channel_key,
                                                   &channel_pub_key);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (slave_key, &slave_pub_key);
 
   GNUNET_assert (GNUNET_OK == db->membership_store (db->cls, &channel_pub_key,
                                                     &slave_pub_key, GNUNET_YES,
@@ -218,7 +218,7 @@ run (void *cls, char *const *args, const char *cfgfile,
                              - sizeof (msg->hop_counter)
                              - sizeof (msg->signature));
   msg->purpose.purpose = htonl (234);
-  GNUNET_CRYPTO_ecc_sign (slave_key, &msg->purpose, &msg->signature);
+  GNUNET_CRYPTO_eddsa_sign (slave_key, &msg->purpose, &msg->signature);
 
   struct FragmentClosure fcls = { 0 };
   fcls.n = 0;
index bb6f88665ec5b8c07e0109de8e6cb70cfc2b8885..cca3c808d2203f2f3158375ee5d915293a94fa05 100644 (file)
@@ -56,11 +56,11 @@ static struct GNUNET_PSYCSTORE_OperationHandle *op;
  */
 static GNUNET_SCHEDULER_TaskIdentifier end_badly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *channel_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *slave_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *slave_key;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key;
-static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key;
+static struct GNUNET_CRYPTO_EddsaPublicKey channel_pub_key;
+static struct GNUNET_CRYPTO_EddsaPublicKey slave_pub_key;
 
 static struct FragmentClosure
 {
@@ -436,7 +436,7 @@ membership_test_result (void *cls, int64_t result, const char *err_msg)
                              - sizeof (msg->hop_counter)
                              - sizeof (msg->signature));
   msg->purpose.purpose = htonl (234);
-  GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecc_sign (slave_key, &msg->purpose,
+  GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (slave_key, &msg->purpose,
                                                       &msg->signature));
 
   op = GNUNET_PSYCSTORE_fragment_store (h, &channel_pub_key, msg, fcls.flags[0],
@@ -498,8 +498,8 @@ run (void *cls,
   channel_key = GNUNET_CRYPTO_ecc_key_create ();
   slave_key = GNUNET_CRYPTO_ecc_key_create ();
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key, &channel_pub_key);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (channel_key, &channel_pub_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (slave_key, &slave_pub_key);
 
   op = GNUNET_PSYCSTORE_membership_store (h, &channel_pub_key, &slave_pub_key,
                                           GNUNET_YES, 4, 2, 1,
index bcb99aaf5ea61742f6d5d442bd81ff87587483e9..3efd769f157b22e165f63296ccf07e4430bc9c9a 100644 (file)
@@ -98,7 +98,7 @@ static unsigned int rounds = 3;
 /**
  * Private key for this peer.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 
 
@@ -258,7 +258,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
 
   cfg = cfg_;
 
-  my_private_key = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
+  my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
   GNUNET_assert (NULL != my_private_key);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (cfg, "REGEXPROFILER",
index 620086b15843a1d72db77e739b9252de5b379faa..cc32c46de1ba738e6a30db85a9f547faf85ac719 100644 (file)
@@ -102,7 +102,7 @@ static struct GNUNET_SERVER_NotificationContext *nc;
 /**
  * Private key for this peer.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 
 /**
@@ -362,7 +362,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     {NULL, NULL, 0, 0}
   };
 
-  my_private_key = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
+  my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
   if (NULL == my_private_key)
   {
     GNUNET_SCHEDULER_shutdown ();
index 3d7b977254eb9de6a8ce73f25590c406e31bcb9e..1db1d0d5e6245eff6f11bfdfc427089ca9c12260 100644 (file)
@@ -186,7 +186,7 @@ evaluate_block_regex_accept (void *cls, enum GNUNET_BLOCK_Type type,
     return GNUNET_BLOCK_EVALUATION_OK_DUPLICATE;
   }
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT,
+      GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT,
                                &rba->purpose,
                                &rba->signature,
                                &rba->peer.public_key))
index 55ca426cbd3331aca2ce31fb870f75af77a1964e..e8788190212cc2fdd79b248a1bb2352e23c5a658 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)
index 6b69d79ebc3cd04f28b672e777206a4db9632561..ec4e339d2bdd8dc79dc7a148a33e2f82d4fbac2d 100644 (file)
@@ -182,7 +182,7 @@ struct REGEX_INTERNAL_Search;
  */
 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);
index 5f97a7112f6ac8834890c389298f7a03bbda37d9..6b2aa618047eb5d38af74dde00f3e2eea45cba52 100644 (file)
@@ -193,12 +193,12 @@ struct RevocationData
   /**
    * Public key.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey key;
 
   /**
    * Revocation signature data.
    */
-  struct GNUNET_CRYPTO_EccSignature sig;
+  struct GNUNET_CRYPTO_EcdsaSignature sig;
 
   /**
    * Proof of work (in NBO).
@@ -310,7 +310,7 @@ ego_callback (void *cls,
               const struct GNUNET_IDENTITY_Ego *ego)
 {
   struct RevocationData *rd;
-  struct GNUNET_CRYPTO_EccPublicSignKey key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey key;
 
   el = NULL;
   if (NULL == ego)
@@ -334,7 +334,7 @@ ego_callback (void *cls,
   {
     if (0 != memcmp (&rd->key,
                      &key,
-                     sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))
+                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
     {
       fprintf (stderr,
                _("Error: revocation certificate in `%s' is not for `%s'\n"),
@@ -387,14 +387,14 @@ run (void *cls,
      const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pk;
   struct RevocationData rd;
 
   cfg = c;
   if (NULL != test_ego)
   {
     if (GNUNET_OK !=
-        GNUNET_CRYPTO_ecc_public_sign_key_from_string (test_ego,
+        GNUNET_CRYPTO_ecdsa_public_key_from_string (test_ego,
                                                        strlen (test_ego),
                                                        &pk))
     {
index c6e3152bab47c8c803eca71f9dfce4d272d0b765..5a7170de694a1a7b8429c52a092ca7722090047a 100644 (file)
@@ -147,7 +147,7 @@ verify_revoke_message (const struct RevokeMessage *rm)
     return GNUNET_NO;
   }
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
+      GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
                                &rm->purpose,
                                &rm->signature,
                                &rm->public_key))
@@ -177,7 +177,7 @@ handle_query_message (void *cls,
   int res;
 
   GNUNET_CRYPTO_hash (&qm->key,
-                      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                       &hc);
   res = GNUNET_CONTAINER_multihashmap_contains (revocation_map, &hc);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -240,7 +240,7 @@ publicize_rm (const struct RevokeMessage *rm)
   struct GNUNET_SET_Element e;
 
   GNUNET_CRYPTO_hash (&rm->public_key,
-                      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                       &hc);
   if (GNUNET_YES ==
       GNUNET_CONTAINER_multihashmap_contains (revocation_map,
@@ -622,7 +622,7 @@ run (void *cls,
     }
     GNUNET_break (0 == ntohl (rm->reserved));
     GNUNET_CRYPTO_hash (&rm->public_key,
-                        sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                        sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
                         &hc);
     GNUNET_break (GNUNET_OK ==
                   GNUNET_CONTAINER_multihashmap_put (revocation_map,
index b13d79a3762f2a2c66d5a00f8e0dafa8d662f312..48c284a4d192186908dd2cb13a948722772711c1 100644 (file)
@@ -48,7 +48,7 @@ struct QueryMessage
   /**
    * Key to check.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey key;
 
 };
 
@@ -98,7 +98,7 @@ struct RevokeMessage
   /**
    * Signature confirming revocation.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
 
   /**
    * Must have purpose #GNUNET_SIGNATURE_PURPOSE_REVOCATION,
@@ -109,7 +109,7 @@ struct RevokeMessage
   /**
    * Key to revoke.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey public_key;
 
 };
 
index ebf85a94e32db5ad6e0fa6fa01d4c1c9586f70f2..82e905e0912d28b827b050fffcd8e4a67153b276 100644 (file)
@@ -49,7 +49,7 @@ struct GNUNET_REVOCATION_Query
   /**
    * Key to check.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey key;
 
   /**
    * Function to call with the result.
@@ -146,7 +146,7 @@ send_revocation_query (void *cls,
  */
 struct GNUNET_REVOCATION_Query *
 GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                        const struct GNUNET_CRYPTO_EccPublicSignKey *key,
+                        const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
                         GNUNET_REVOCATION_Callback func, void *func_cls)
 {
   struct GNUNET_REVOCATION_Query *q;
@@ -210,12 +210,12 @@ struct GNUNET_REVOCATION_Handle
   /**
    * Key to revoke.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey key;
+  struct GNUNET_CRYPTO_EcdsaPublicKey key;
 
   /**
    * Signature showing that we have the right to revoke.
    */
-  struct GNUNET_CRYPTO_EccSignature sig;
+  struct GNUNET_CRYPTO_EcdsaSignature sig;
 
   /**
    * Proof of work showing that we spent enough resources to broadcast revocation.
@@ -300,7 +300,7 @@ send_revoke (void *cls,
   rm.proof_of_work = h->pow;
   rm.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
   rm.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
-                           sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+                           sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
   rm.public_key = h->key;
   rm.signature = h->sig;
   memcpy (buf, &rm, sizeof (struct RevokeMessage));
@@ -329,8 +329,8 @@ send_revoke (void *cls,
  */
 struct GNUNET_REVOCATION_Handle *
 GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                         const struct GNUNET_CRYPTO_EccPublicSignKey *key,
-                         const struct GNUNET_CRYPTO_EccSignature *sig,
+                         const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
+                         const struct GNUNET_CRYPTO_EcdsaSignature *sig,
                          uint64_t pow,
                          GNUNET_REVOCATION_Callback func, void *func_cls)
 {
@@ -437,17 +437,17 @@ count_leading_zeroes (const struct GNUNET_HashCode *hash)
  * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not
  */
 int
-GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EccPublicSignKey *key,
+GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
                             uint64_t pow,
                             unsigned int matching_bits)
 {
-  char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
+  char buf[sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
            sizeof (pow)] GNUNET_ALIGN;
   struct GNUNET_HashCode result;
 
   memcpy (buf, &pow, sizeof (pow));
   memcpy (&buf[sizeof (pow)], key,
-          sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
+          sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
   pow_hash (buf, sizeof (buf), &result);
   return (count_leading_zeroes (&result) >=
           matching_bits) ? GNUNET_YES : GNUNET_NO;
@@ -461,17 +461,17 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EccPublicSignKey *key,
  * @param sig where to write the revocation signature
  */
 void
-GNUNET_REVOCATION_sign_revocation (const struct GNUNET_CRYPTO_EccPrivateKey *key,
-                                  struct GNUNET_CRYPTO_EccSignature *sig)
+GNUNET_REVOCATION_sign_revocation (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+                                  struct GNUNET_CRYPTO_EcdsaSignature *sig)
 {
   struct RevokeMessage rm;
 
   rm.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
   rm.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
-                          sizeof (struct GNUNET_CRYPTO_EccPublicSignKey));
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &rm.public_key);
+                          sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+  GNUNET_CRYPTO_ecdsa_key_get_public (key, &rm.public_key);
   GNUNET_assert (GNUNET_OK ==
-                GNUNET_CRYPTO_ecc_sign (key,
+                GNUNET_CRYPTO_ecdsa_sign (key,
                                         &rm.purpose,
                                         sig));
 }
index 1cec948a2d1df308e2567c95dc9c042564af44db..a79e836c73180505076f646e871746ef77b70171 100644 (file)
@@ -164,7 +164,7 @@ create_hostkeys (const unsigned int no)
   struct GNUNET_TESTING_System *system;
   struct GNUNET_PeerIdentity id;
   struct GNUNET_DISK_FileHandle *fd;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
 
   system = GNUNET_TESTING_system_create ("testing", NULL, NULL, NULL);
   pk = GNUNET_TESTING_hostkey_get (system, create_no, &id);
@@ -182,7 +182,7 @@ create_hostkeys (const unsigned int no)
                              GNUNET_DISK_PERM_USER_WRITE);
   GNUNET_assert (fd != NULL);
   ret = GNUNET_DISK_file_write (fd, pk,
-                               sizeof (struct GNUNET_CRYPTO_EccPrivateKey));
+                               sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey));
   GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
   GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing",
                   "Wrote hostkey to file: `%s'\n", create_hostkey);
index 89d4c0f50a586cc75f186223f4c2cff57181a867..cfca8ce9b464e92f3153f382e81c325a0f32b7fb 100644 (file)
@@ -701,12 +701,12 @@ GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
  *        key; if NULL, GNUNET_SYSERR is returned immediately
  * @return NULL on error (not enough keys)
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
+struct GNUNET_CRYPTO_EddsaPrivateKey *
 GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
                            uint32_t key_number,
                            struct GNUNET_PeerIdentity *id)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *private_key;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
 
   if ((NULL == id) || (NULL == system->hostkeys_data))
     return NULL;
@@ -716,12 +716,12 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
          _("Key number %u does not exist\n"), key_number);
     return NULL;
   }
-  private_key = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+  private_key = GNUNET_new (struct GNUNET_CRYPTO_EddsaPrivateKey);
   memcpy (private_key,
          system->hostkeys_data +
          (key_number * GNUNET_TESTING_HOSTKEYFILESIZE),
          GNUNET_TESTING_HOSTKEYFILESIZE);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (private_key,
                                                   &id->public_key);
   return private_key;
 }
@@ -1137,7 +1137,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
   char *config_filename;
   char *libexec_binary;
   char *emsg_;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
   uint16_t *ports;
   struct SharedService *ss;
   struct SharedServiceInstance **ss_instances;
index 5c074e941bda6c9182da4f2c60d4178e9ff170ee..d41ff1ec68efa98bc899268d8c324be668e7be64 100644 (file)
@@ -92,7 +92,7 @@ GNUNET_FRIENDS_parse (const struct GNUNET_CONFIGURATION_Handle *cfg,
     while ((pos < fsize) && (! isspace ((int) data[pos])))
       pos++;
     if (GNUNET_OK !=
-        GNUNET_CRYPTO_ecc_public_sign_key_from_string (&data[start],
+        GNUNET_CRYPTO_eddsa_public_key_from_string (&data[start],
                                                       pos - start,
                                                       &pid.public_key))
     {
@@ -196,7 +196,7 @@ GNUNET_FRIENDS_write (struct GNUNET_FRIENDS_Writer *w,
   char *ret;
   size_t slen;
 
-  ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&friend->public_key);
+  ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&friend->public_key);
   GNUNET_asprintf (&buf,
                    "%s\n",
                    ret);
index d6be384bdbe5d8b7150dcbd46ec687d9278edd4f..6d2e1831eef5024ba8ce6ba1ac1506e500d4c154 100644 (file)
@@ -70,7 +70,7 @@ static struct GNUNET_SERVER_Handle *GST_server;
 /**
  * Our private key.
  */
-struct GNUNET_CRYPTO_EccPrivateKey *GST_my_private_key;
+struct GNUNET_CRYPTO_EddsaPrivateKey *GST_my_private_key;
 
 /**
  * ATS handle.
@@ -738,7 +738,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *keyfile;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
   long long unsigned int max_fd_cfg;
   int max_fd_rlimit;
   int max_fd;
@@ -763,14 +763,14 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION;
   }
   GST_server = server;
-  pk = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   GNUNET_assert (NULL != pk);
   GST_my_private_key = pk;
 
   GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg);
   GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (GST_my_private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (GST_my_private_key,
                                                  &GST_my_identity.public_key);
   GNUNET_assert (NULL != GST_my_private_key);
 
index 9b68cb258364149379ed7fdba3f2ffa4e2e00783..66da0163e894880f8aec786ac103e4e9aec3e6fa 100644 (file)
@@ -55,7 +55,7 @@ extern struct GNUNET_PEERINFO_Handle *GST_peerinfo;
 /**
  * Our private key.
  */
-extern struct GNUNET_CRYPTO_EccPrivateKey *GST_my_private_key;
+extern struct GNUNET_CRYPTO_EddsaPrivateKey *GST_my_private_key;
 
 /**
  * ATS handle.
index 8f45a19b8308e9c492b1afd64fee5579f956a102..87d7539295ba91874ad8f56eeee1bea177811820 100644 (file)
@@ -254,7 +254,7 @@ blacklist_cfg_iter (void *cls, const char *section,
   char *plugs;
   char *pos;
 
-  if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_sign_key_from_string (option,
+  if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (option,
                                                                  strlen (option),
                                                                  &peer.public_key))
     return;
index a53e26f9509da1b1cf3b50d0d47779d3d345984c..6bf7077558604a02ce4304961e87c4e93c76e956 100644 (file)
@@ -74,7 +74,7 @@ struct OwnAddressList
   /**
    * Signature for a 'struct TransportPongMessage' for this address.
    */
-  struct GNUNET_CRYPTO_EccSignature pong_signature;
+  struct GNUNET_CRYPTO_EddsaSignature pong_signature;
 
 };
 
@@ -307,7 +307,7 @@ GST_hello_modify_addresses (int addremove,
  */
 int
 GST_hello_test_address (const struct GNUNET_HELLO_Address *address,
-                        struct GNUNET_CRYPTO_EccSignature **sig,
+                        struct GNUNET_CRYPTO_EddsaSignature **sig,
                         struct GNUNET_TIME_Absolute **sig_expiration)
 {
   struct OwnAddressList *al;
index 2aefbe3007068f6b69e5a803fedbe257c9db1412..0c67cef4d916900d2f3c0e5adea1af6a7bd07b8f 100644 (file)
@@ -93,7 +93,7 @@ GST_hello_modify_addresses (int addremove,
  */
 int
 GST_hello_test_address (const struct GNUNET_HELLO_Address *address,
-                        struct GNUNET_CRYPTO_EccSignature **sig,
+                        struct GNUNET_CRYPTO_EddsaSignature **sig,
                         struct GNUNET_TIME_Absolute **sig_expiration);
 
 
index 0cffe0aeb63e58e0014924760cbb4210fa93cf15..d89aa2f3239043d970cba81d5dc809f6ab1b92ad 100644 (file)
@@ -329,14 +329,14 @@ struct SessionDisconnectMessage
   /**
    * Public key of the sender.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey public_key;
 
   /**
    * Signature of the peer that sends us the disconnect.  Only
    * valid if the timestamp is AFTER the timestamp from the
    * corresponding 'CONNECT' message.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 
 };
 
@@ -1195,7 +1195,7 @@ send_disconnect (struct NeighbourMapEntry *n)
   disconnect_msg.reserved = htonl (0);
   disconnect_msg.purpose.size =
       htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
-             sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
+             sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
              sizeof (struct GNUNET_TIME_AbsoluteNBO));
   disconnect_msg.purpose.purpose =
       htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT);
@@ -1203,7 +1203,7 @@ send_disconnect (struct NeighbourMapEntry *n)
       GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
   disconnect_msg.public_key = GST_my_identity.public_key;
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_CRYPTO_ecc_sign (GST_my_private_key,
+                 GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
                                          &disconnect_msg.purpose,
                                          &disconnect_msg.signature));
 
@@ -3157,7 +3157,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
     return;
   }
   GNUNET_CRYPTO_hash (&sdm->public_key,
-                      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                      sizeof (struct GNUNET_CRYPTO_EddsaPublicKey),
                       &hc);
   if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity)))
   {
@@ -3166,7 +3166,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
   }
   if (ntohl (sdm->purpose.size) !=
       sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
-      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) +
+      sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
       sizeof (struct GNUNET_TIME_AbsoluteNBO))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -3177,7 +3177,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
     return;
   }
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_verify
+      GNUNET_CRYPTO_eddsa_verify
       (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, &sdm->purpose,
        &sdm->signature, &sdm->public_key))
   {
index 6018e2c7b028cec907091ce072b3154a867306c7..f5f3d6d56e51ef1c70963b2aceeb21398b735114 100644 (file)
@@ -148,7 +148,7 @@ struct TransportPongMessage
   /**
    * Signature.
    */
-  struct GNUNET_CRYPTO_EccSignature signature;
+  struct GNUNET_CRYPTO_EddsaSignature signature;
 
   /**
    * GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN to confirm that this is a
@@ -189,7 +189,7 @@ struct ValidationEntry
   /**
    * Public key of the peer.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey public_key;
 
   /**
    * The identity of the peer. FIXME: duplicated (also in 'address')
@@ -199,7 +199,7 @@ struct ValidationEntry
   /**
    * Cached PONG signature
    */
-  struct GNUNET_CRYPTO_EccSignature pong_sig_cache;
+  struct GNUNET_CRYPTO_EddsaSignature pong_sig_cache;
 
   /**
    * ID of task that will clean up this entry if nothing happens.
@@ -678,7 +678,7 @@ revalidate_address (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  *         if we don't have an existing entry and no public key was given
  */
 static struct ValidationEntry *
-find_validation_entry (const struct GNUNET_CRYPTO_EccPublicSignKey *public_key,
+find_validation_entry (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
                       const struct GNUNET_HELLO_Address *address)
 {
   struct ValidationEntryMatchContext vemc;
@@ -701,7 +701,7 @@ find_validation_entry (const struct GNUNET_CRYPTO_EccPublicSignKey *public_key,
   ve->public_key = *public_key;
   ve->pid = address->peer;
   ve->pong_sig_valid_until = GNUNET_TIME_absolute_get_zero_();
-  memset (&ve->pong_sig_cache, '\0', sizeof (struct GNUNET_CRYPTO_EccSignature));
+  memset (&ve->pong_sig_cache, '\0', sizeof (struct GNUNET_CRYPTO_EddsaSignature));
   ve->latency = GNUNET_TIME_UNIT_FOREVER_REL;
   ve->challenge =
       GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX);
@@ -733,7 +733,7 @@ add_valid_address (void *cls, const struct GNUNET_HELLO_Address *address,
   struct ValidationEntry *ve;
   struct GNUNET_PeerIdentity pid;
   struct GNUNET_ATS_Information ats;
-  struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey public_key;
 
   if (0 == GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us)
     return GNUNET_OK;           /* expired */
@@ -855,7 +855,7 @@ GST_validation_stop ()
  */
 static void
 multicast_pong (void *cls,
-                const struct GNUNET_CRYPTO_EccPublicSignKey *public_key,
+                const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
                struct GNUNET_TIME_Absolute valid_until,
                 struct GNUNET_TIME_Absolute validation_block,
                 const struct GNUNET_HELLO_Address *address)
@@ -901,7 +901,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
   const struct TransportPingMessage *ping;
   struct TransportPongMessage *pong;
   struct GNUNET_TRANSPORT_PluginFunctions *papi;
-  struct GNUNET_CRYPTO_EccSignature *sig_cache;
+  struct GNUNET_CRYPTO_EddsaSignature *sig_cache;
   struct GNUNET_TIME_Absolute *sig_cache_exp;
   const char *addr;
   const char *addrend;
@@ -1022,7 +1022,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
   {
     addrend = NULL;             /* make gcc happy */
     slen = 0;
-    static struct GNUNET_CRYPTO_EccSignature no_address_signature;
+    static struct GNUNET_CRYPTO_EddsaSignature no_address_signature;
     static struct GNUNET_TIME_Absolute no_address_signature_expiration;
 
     sig_cache = &no_address_signature;
@@ -1063,7 +1063,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
     *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME);
     pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp);
     if (GNUNET_OK !=
-                  GNUNET_CRYPTO_ecc_sign (GST_my_private_key, &pong->purpose,
+                  GNUNET_CRYPTO_eddsa_sign (GST_my_private_key, &pong->purpose,
                                           sig_cache))
     {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1141,7 +1141,7 @@ struct ValidateAddressContext
   /**
    * Public key of the peer whose address is being validated.
    */
-  struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+  struct GNUNET_CRYPTO_EddsaPublicKey public_key;
 };
 
 
@@ -1274,7 +1274,7 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
   {
                /* We have a cached and valid signature for this peer,
                 * try to compare instead of verify */
-               if (0 == memcmp (&ve->pong_sig_cache, &pong->signature, sizeof (struct GNUNET_CRYPTO_EccSignature)))
+               if (0 == memcmp (&ve->pong_sig_cache, &pong->signature, sizeof (struct GNUNET_CRYPTO_EddsaSignature)))
                {
                        /* signatures are identical, we can skip verification */
                        sig_res = GNUNET_OK;
@@ -1290,7 +1290,7 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
   if (GNUNET_YES == do_verify)
   {
                        /* Do expensive verification */
-               sig_res = GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
+               sig_res = GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
                                 &pong->purpose, &pong->signature,
                                 &ve->public_key);
                if (sig_res == GNUNET_SYSERR)
index c935b97cf43d04a26ad430f80a47887350ba99c7..3408f50bb90c4f62bfe874f813acb41f52063fad 100644 (file)
@@ -134,7 +134,7 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello);
  */
 typedef void (*GST_ValidationAddressCallback) (void *cls,
                                                const struct
-                                               GNUNET_CRYPTO_EccPublicSignKey *public_key,
+                                               GNUNET_CRYPTO_EddsaPublicKey *public_key,
                                                struct GNUNET_TIME_Absolute
                                                valid_until,
                                                struct GNUNET_TIME_Absolute
index cbda8ac6eb31c80206b2d53eec3c3d7ecd7e26e2..ed47e29e19085de4bc0b0a036fb06621fd9154a3 100644 (file)
@@ -809,7 +809,7 @@ testservice_task (void *cls,
   }
 
   if ( (NULL != cpid) &&
-       (GNUNET_OK != GNUNET_CRYPTO_ecc_public_sign_key_from_string (cpid,
+       (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (cpid,
                                                                    strlen (cpid),
                                                                    &pid.public_key)))
   {
index 15a0be297683be0c2f9da6d58503cc2d9fee2dad..9e4e54e676f9c0d9be5a436c8e115d5d95c4b07b 100644 (file)
@@ -1013,7 +1013,7 @@ server_parse_url (struct HTTP_Server_Plugin *plugin,
       return GNUNET_SYSERR;
   }
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecc_public_sign_key_from_string (target_start,
+      GNUNET_CRYPTO_eddsa_public_key_from_string (target_start,
                                                     hash_length,
                                                     &target->public_key))
     {
index ba16d539dc5eec9e2642297f724bd16b471d3665..98806fbb83362a184f7330cb4fa438dd3fbbc802 100644 (file)
@@ -49,7 +49,7 @@ static struct GNUNET_PeerIdentity my_identity;
 /**
  * Our private key.
  */
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
 
 /**
  * Our configuration.
@@ -617,7 +617,7 @@ run (void *cls, char *const *args, const char *cfgfile,
 
 
   max_connect_per_transport = (uint32_t) tneigh;
-  my_private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+  my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   if (NULL == my_private_key)
   {
@@ -626,7 +626,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     end_badly_now ();
     return;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_identity.public_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, &my_identity.public_key);
 
   hello = GNUNET_HELLO_create (&my_identity.public_key, NULL, NULL, GNUNET_NO);
 
index 564204862b4cc340305d0f745cfeb53e0d2b95af..a9b4e09daee5452e430f9dd82b182c07f6cad5bc 100644 (file)
@@ -7,7 +7,7 @@ libexecdir= $(pkglibdir)/libexec/
 pkgcfgdir= $(pkgdatadir)/config.d/
 
 dist_pkgcfg_DATA = \
-  util.conf 
+  util.conf
 
 pkgcfg_DATA = \
   resolver.conf
@@ -19,7 +19,7 @@ libgnunetutilwin_la_SOURCES = \
   win.c \
   winproc.c
 libgnunetutilwin_la_LDFLAGS = \
-  -no-undefined -Wl,--export-all-symbols 
+  -no-undefined -Wl,--export-all-symbols
 libgnunetutilwin_la_LIBADD = \
   -lshell32 -liconv -lstdc++ \
   -lcomdlg32 -lgdi32 -liphlpapi
@@ -47,7 +47,7 @@ noinst_PROGRAMS = \
 gnunet_config_diff_SOURCES = \
  gnunet-config-diff.c
 gnunet_config_diff_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 gnunet_config_diff_DEPENDENCIES = \
  libgnunetutil.la
 
@@ -114,7 +114,7 @@ libgnunetutil_la_LIBADD = \
   $(LIBGCRYPT_LIBS) \
   $(LTLIBICONV) \
   $(LTLIBINTL) \
-  -lltdl $(Z_LIBS) -lunistring $(XLIB) 
+  -lltdl $(Z_LIBS) -lunistring $(XLIB)
 
 libgnunetutil_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) \
@@ -126,17 +126,17 @@ endif
 
 
 libexec_PROGRAMS = \
- gnunet-service-resolver 
+ gnunet-service-resolver
 
 bin_PROGRAMS = \
  gnunet-resolver \
  gnunet-config \
  $(GNUNET_ECC) \
- gnunet-uri 
+ gnunet-uri
 
 
 gnunet_service_resolver_SOURCES = \
- gnunet-service-resolver.c         
+ gnunet-service-resolver.c
 gnunet_service_resolver_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)
@@ -145,7 +145,7 @@ gnunet_service_resolver_DEPENDENCIES = \
 
 
 gnunet_resolver_SOURCES = \
- gnunet-resolver.c         
+ gnunet-resolver.c
 gnunet_resolver_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)
@@ -154,7 +154,7 @@ gnunet_resolver_DEPENDENCIES = \
 
 
 gnunet_ecc_SOURCES = \
- gnunet-ecc.c         
+ gnunet-ecc.c
 gnunet_ecc_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL) -lgcrypt
@@ -163,7 +163,7 @@ gnunet_ecc_DEPENDENCIES = \
 
 
 gnunet_config_SOURCES = \
- gnunet-config.c         
+ gnunet-config.c
 gnunet_config_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)
@@ -172,7 +172,7 @@ gnunet_config_DEPENDENCIES = \
 
 
 gnunet_uri_SOURCES = \
- gnunet-uri.c         
+ gnunet-uri.c
 gnunet_uri_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)
@@ -210,7 +210,9 @@ check_PROGRAMS = \
  test_container_slist \
  test_crypto_symmetric \
  test_crypto_crc \
- test_crypto_ecc \
+ test_crypto_ecdsa \
+ test_crypto_eddsa \
+ test_crypto_ecdhe \
  test_crypto_hash \
  test_crypto_hkdf \
  test_crypto_random \
@@ -265,22 +267,22 @@ test_os_start_process_DEPENDENCIES = \
 test_client_SOURCES = \
  test_client.c
 test_client_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_common_allocation_SOURCES = \
  test_common_allocation.c
 test_common_allocation_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_common_endian_SOURCES = \
  test_common_endian.c
 test_common_endian_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_common_logging_SOURCES = \
  test_common_logging.c
 test_common_logging_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_common_logging_runtime_loglevels_SOURCES = \
  test_common_logging_runtime_loglevels.c
@@ -290,12 +292,12 @@ test_common_logging_runtime_loglevels_LDADD = \
 test_configuration_SOURCES = \
  test_configuration.c
 test_configuration_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_container_bloomfilter_SOURCES = \
  test_container_bloomfilter.c
 test_container_bloomfilter_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_container_meta_data_SOURCES = \
  test_container_meta_data.c
@@ -320,83 +322,95 @@ test_container_multipeermap_LDADD = \
 test_container_heap_SOURCES = \
  test_container_heap.c
 test_container_heap_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la   
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_container_slist_SOURCES = \
  test_container_slist.c
 test_container_slist_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_crypto_symmetric_SOURCES = \
  test_crypto_symmetric.c
 test_crypto_symmetric_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_crypto_crc_SOURCES = \
  test_crypto_crc.c
 test_crypto_crc_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
-test_crypto_ecc_SOURCES = \
- test_crypto_ecc.c
-test_crypto_ecc_LDADD = \
+test_crypto_ecdsa_SOURCES = \
+ test_crypto_ecdsa.c
+test_crypto_ecdsa_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(LIBGCRYPT_LIBS)
+
+test_crypto_eddsa_SOURCES = \
+ test_crypto_eddsa.c
+test_crypto_eddsa_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(LIBGCRYPT_LIBS)
+
+test_crypto_ecdhe_SOURCES = \
+ test_crypto_ecdhe.c
+test_crypto_ecdhe_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(LIBGCRYPT_LIBS)
 
 test_crypto_hash_SOURCES = \
  test_crypto_hash.c
 test_crypto_hash_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_crypto_hkdf_SOURCES = \
  test_crypto_hkdf.c
 test_crypto_hkdf_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_crypto_random_SOURCES = \
  test_crypto_random.c
 test_crypto_random_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_disk_SOURCES = \
  test_disk.c
 test_disk_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_getopt_SOURCES = \
  test_getopt.c
 test_getopt_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_connection_SOURCES = \
  test_connection.c
 test_connection_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_connection_addressing_SOURCES = \
  test_connection_addressing.c
 test_connection_addressing_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_connection_receive_cancel_SOURCES = \
  test_connection_receive_cancel.c
 test_connection_receive_cancel_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_connection_timeout_SOURCES = \
  test_connection_timeout.c
 test_connection_timeout_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_connection_timeout_no_connect_SOURCES = \
  test_connection_timeout_no_connect.c
 test_connection_timeout_no_connect_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_connection_transmit_cancel_SOURCES = \
  test_connection_transmit_cancel.c
 test_connection_transmit_cancel_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_mq_SOURCES = \
  test_mq.c
@@ -411,7 +425,7 @@ test_mq_client_LDADD = \
 test_os_network_SOURCES = \
  test_os_network.c
 test_os_network_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_peer_SOURCES = \
  test_peer.c
@@ -421,63 +435,63 @@ $(top_builddir)/src/util/libgnunetutil.la -lgcrypt
 test_plugin_SOURCES = \
  test_plugin.c
 test_plugin_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_program_SOURCES = \
  test_program.c
 test_program_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_resolver_api_SOURCES = \
  test_resolver_api.c
 test_resolver_api_LDADD = \
-  $(top_builddir)/src/util/libgnunetutil.la  
+  $(top_builddir)/src/util/libgnunetutil.la
 
 test_scheduler_SOURCES = \
  test_scheduler.c
 test_scheduler_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_scheduler_delay_SOURCES = \
  test_scheduler_delay.c
 test_scheduler_delay_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_server_mst_interrupt_SOURCES = \
  test_server_mst_interrupt.c
 test_server_mst_interrupt_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_server_SOURCES = \
  test_server.c
 test_server_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_server_disconnect_SOURCES = \
  test_server_disconnect.c
 test_server_disconnect_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_server_with_client_SOURCES = \
  test_server_with_client.c
 test_server_with_client_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_server_with_client_unix_SOURCES = \
  test_server_with_client_unix.c
 test_server_with_client_unix_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 
 test_service_SOURCES = \
  test_service.c
 test_service_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_strings_SOURCES = \
  test_strings.c
 test_strings_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 
 test_strings_to_data_SOURCES = \
@@ -489,27 +503,27 @@ test_strings_to_data_LDADD = \
 test_time_SOURCES = \
  test_time.c
 test_time_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 test_speedup_SOURCES = \
  test_speedup.c
 test_speedup_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 perf_crypto_hash_SOURCES = \
  perf_crypto_hash.c
 perf_crypto_hash_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 perf_crypto_symmetric_SOURCES = \
  perf_crypto_symmetric.c
 perf_crypto_symmetric_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 perf_malloc_SOURCES = \
  perf_malloc.c
 perf_malloc_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
 
 
 EXTRA_DIST = \
index 48a6724f7f76b907b0974b23b941568c4ac585b2..582435651f98200972e848ef25620ebe835dbc65 100644 (file)
@@ -1096,7 +1096,7 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
   static char buf[256];
   char *ret;
 
-  ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key);
+  ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
   strcpy (buf, ret);
   GNUNET_free (ret);
   buf[4] = '\0';
@@ -1119,7 +1119,7 @@ GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid)
   static char buf[256];
   char *ret;
 
-  ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key);
+  ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
   strcpy (buf, ret);
   GNUNET_free (ret);
   return buf;
index 34edec3deca1702f023fcfb8d15e5f3233fd66a3..e2eaaa2690bc0a906b956448a777ce2804aa3db4 100644 (file)
@@ -188,7 +188,7 @@ mpi_scan (gcry_mpi_t *result,
  * @return NULL on error
  */
 static gcry_sexp_t
-decode_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *priv)
+decode_private_ecdsa_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv)
 {
   gcry_sexp_t result;
   gcry_mpi_t d;
@@ -217,6 +217,111 @@ decode_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *priv)
 }
 
 
+/**
+ * Convert the given private key from the network format to the
+ * S-expression that can be used by libgcrypt.
+ *
+ * @param priv private key to decode
+ * @return NULL on error
+ */
+static gcry_sexp_t
+decode_private_eddsa_key (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
+{
+  gcry_sexp_t result;
+  gcry_mpi_t d;
+  int rc;
+
+  mpi_scan (&d,
+           priv->d,
+           sizeof (priv->d));
+  rc = gcry_sexp_build (&result, NULL,
+                       "(private-key(ecdsa(curve \"" CURVE "\")(d %m)))", // FIXME: eddsa soon!
+                       d);
+  gcry_mpi_release (d);
+  if (0 != rc)
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
+    GNUNET_assert (0);
+  }
+#if EXTRA_CHECKS
+  if (0 != (rc = gcry_pk_testkey (result)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+    GNUNET_assert (0);
+  }
+#endif
+  return result;
+}
+
+
+/**
+ * Convert the given private key from the network format to the
+ * S-expression that can be used by libgcrypt.
+ *
+ * @param priv private key to decode
+ * @return NULL on error
+ */
+static gcry_sexp_t
+decode_private_ecdhe_key (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv)
+{
+  gcry_sexp_t result;
+  gcry_mpi_t d;
+  int rc;
+
+  mpi_scan (&d,
+           priv->d,
+           sizeof (priv->d));
+  rc = gcry_sexp_build (&result, NULL,
+                       "(private-key(ecdsa(curve \"" CURVE "\")(d %m)))", // FIXME: ecdh here?
+                       d);
+  gcry_mpi_release (d);
+  if (0 != rc)
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
+    GNUNET_assert (0);
+  }
+#if EXTRA_CHECKS
+  if (0 != (rc = gcry_pk_testkey (result)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+    GNUNET_assert (0);
+  }
+#endif
+  return result;
+}
+
+
+/**
+ * Initialize public key struct from the respective point
+ * on the curve.
+ *
+ * @param q point on curve
+ * @param pub public key struct to initialize
+ * @param ctx context to use for ECC operations
+ */
+static void
+point_to_public_ecdsa_key (gcry_mpi_point_t q,
+                           gcry_ctx_t ctx,
+                           struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
+{
+  gcry_mpi_t q_x;
+  gcry_mpi_t q_y;
+
+  q_x = gcry_mpi_new (256);
+  q_y = gcry_mpi_new (256);
+  if (gcry_mpi_ec_get_affine (q_x, q_y, q, ctx))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "get_affine failed", 0);
+    return;
+  }
+
+  mpi_print (pub->q_x, sizeof (pub->q_x), q_x);
+  mpi_print (pub->q_y, sizeof (pub->q_y), q_y);
+  gcry_mpi_release (q_x);
+  gcry_mpi_release (q_y);
+}
+
+
 /**
  * Initialize public key struct from the respective point
  * on the curve.
@@ -226,9 +331,9 @@ decode_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *priv)
  * @param ctx context to use for ECC operations
  */
 static void
-point_to_public_sign_key (gcry_mpi_point_t q,
-                         gcry_ctx_t ctx,
-                         struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+point_to_public_eddsa_key (gcry_mpi_point_t q,
+                           gcry_ctx_t ctx,
+                           struct GNUNET_CRYPTO_EddsaPublicKey *pub)
 {
   gcry_mpi_t q_x;
   gcry_mpi_t q_y;
@@ -257,9 +362,9 @@ point_to_public_sign_key (gcry_mpi_point_t q,
  * @param ctx context to use for ECC operations
  */
 static void
-point_to_public_encrypt_key (gcry_mpi_point_t q,
-                            gcry_ctx_t ctx,
-                            struct GNUNET_CRYPTO_EccPublicEncryptKey *pub)
+point_to_public_ecdhe_key (gcry_mpi_point_t q,
+                           gcry_ctx_t ctx,
+                           struct GNUNET_CRYPTO_EcdhePublicKey *pub)
 {
   gcry_mpi_t q_x;
   gcry_mpi_t q_y;
@@ -286,19 +391,19 @@ point_to_public_encrypt_key (gcry_mpi_point_t q,
  * @param pub where to write the public key
  */
 void
-GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                                               struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+GNUNET_CRYPTO_ecdsa_key_get_public (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+                                    struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
 {
   gcry_sexp_t sexp;
   gcry_ctx_t ctx;
   gcry_mpi_point_t q;
 
-  sexp = decode_private_key (priv);
+  sexp = decode_private_ecdsa_key (priv);
   GNUNET_assert (NULL != sexp);
   GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, sexp, NULL));
   gcry_sexp_release (sexp);
   q = gcry_mpi_ec_get_point ("q", ctx, 0);
-  point_to_public_sign_key (q, ctx, pub);
+  point_to_public_ecdsa_key (q, ctx, pub);
   gcry_ctx_release (ctx);
   gcry_mpi_point_release (q);
 }
@@ -311,24 +416,80 @@ GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPr
  * @param pub where to write the public key
  */
 void
-GNUNET_CRYPTO_ecc_key_get_public_for_encryption (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                                                struct GNUNET_CRYPTO_EccPublicEncryptKey *pub)
+GNUNET_CRYPTO_eddsa_key_get_public (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
+                                    struct GNUNET_CRYPTO_EddsaPublicKey *pub)
 {
   gcry_sexp_t sexp;
   gcry_ctx_t ctx;
   gcry_mpi_point_t q;
 
-  sexp = decode_private_key (priv);
+  sexp = decode_private_eddsa_key (priv);
   GNUNET_assert (NULL != sexp);
   GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, sexp, NULL));
   gcry_sexp_release (sexp);
   q = gcry_mpi_ec_get_point ("q", ctx, 0);
-  point_to_public_encrypt_key (q, ctx, pub);
+  point_to_public_eddsa_key (q, ctx, pub);
   gcry_ctx_release (ctx);
   gcry_mpi_point_release (q);
 }
 
 
+/**
+ * Extract the public key for the given private key.
+ *
+ * @param priv the private key
+ * @param pub where to write the public key
+ */
+void
+GNUNET_CRYPTO_ecdhe_key_get_public (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
+                                    struct GNUNET_CRYPTO_EcdhePublicKey *pub)
+{
+  gcry_sexp_t sexp;
+  gcry_ctx_t ctx;
+  gcry_mpi_point_t q;
+
+  sexp = decode_private_ecdhe_key (priv);
+  GNUNET_assert (NULL != sexp);
+  GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, sexp, NULL));
+  gcry_sexp_release (sexp);
+  q = gcry_mpi_ec_get_point ("q", ctx, 0);
+  point_to_public_ecdhe_key (q, ctx, pub);
+  gcry_ctx_release (ctx);
+  gcry_mpi_point_release (q);
+}
+
+
+/**
+ * Convert a public key to a string.
+ *
+ * @param pub key to convert
+ * @return string representing @a pub
+ */
+char *
+GNUNET_CRYPTO_ecdsa_public_key_to_string (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
+{
+  char *pubkeybuf;
+  size_t keylen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
+  char *end;
+
+  if (keylen % 5 > 0)
+    keylen += 5 - keylen % 5;
+  keylen /= 5;
+  pubkeybuf = GNUNET_malloc (keylen + 1);
+  end = GNUNET_STRINGS_data_to_string ((unsigned char *) pub,
+                                      sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
+                                      pubkeybuf,
+                                      keylen);
+  if (NULL == end)
+  {
+    GNUNET_free (pubkeybuf);
+    return NULL;
+  }
+  *end = '\0';
+  return pubkeybuf;
+}
+
+
 /**
  * Convert a public key to a string.
  *
@@ -336,10 +497,10 @@ GNUNET_CRYPTO_ecc_key_get_public_for_encryption (const struct GNUNET_CRYPTO_EccP
  * @return string representing @a pub
  */
 char *
-GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+GNUNET_CRYPTO_eddsa_public_key_to_string (const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
 {
   char *pubkeybuf;
-  size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8;
+  size_t keylen = (sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)) * 8;
   char *end;
 
   if (keylen % 5 > 0)
@@ -347,7 +508,7 @@ GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPubli
   keylen /= 5;
   pubkeybuf = GNUNET_malloc (keylen + 1);
   end = GNUNET_STRINGS_data_to_string ((unsigned char *) pub,
-                                      sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
+                                      sizeof (struct GNUNET_CRYPTO_EddsaPublicKey),
                                       pubkeybuf,
                                       keylen);
   if (NULL == end)
@@ -369,11 +530,11 @@ GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPubli
  * @return #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc,
-                                         size_t enclen,
-                                         struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+GNUNET_CRYPTO_ecdsa_public_key_from_string (const char *enc,
+                                            size_t enclen,
+                                            struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
 {
-  size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8;
+  size_t keylen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
 
   if (keylen % 5 > 0)
     keylen += 5 - keylen % 5;
@@ -383,7 +544,36 @@ GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc,
 
   if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen,
                                                  pub,
-                                                 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))
+                                                 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+    return GNUNET_SYSERR;
+  return GNUNET_OK;
+}
+
+
+/**
+ * Convert a string representing a public key to a public key.
+ *
+ * @param enc encoded public key
+ * @param enclen number of bytes in @a enc (without 0-terminator)
+ * @param pub where to store the public key
+ * @return #GNUNET_OK on success
+ */
+int
+GNUNET_CRYPTO_eddsa_public_key_from_string (const char *enc,
+                                            size_t enclen,
+                                            struct GNUNET_CRYPTO_EddsaPublicKey *pub)
+{
+  size_t keylen = (sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)) * 8;
+
+  if (keylen % 5 > 0)
+    keylen += 5 - keylen % 5;
+  keylen /= 5;
+  if (enclen != keylen)
+    return GNUNET_SYSERR;
+
+  if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen,
+                                                 pub,
+                                                 sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
     return GNUNET_SYSERR;
   return GNUNET_OK;
 }
@@ -397,7 +587,7 @@ GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc,
  * @return NULL on error
  */
 static gcry_sexp_t
-decode_public_sign_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+decode_public_ecdsa_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
 {
   gcry_sexp_t pub_sexp;
   gcry_mpi_t q_x;
@@ -413,7 +603,42 @@ decode_public_sign_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
   gcry_mpi_release (q_y);
 
   /* initialize 'ctx' with 'q' */
-  GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE));
+  GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); // FIXME: need to say ECDSA?
+  gcry_mpi_ec_set_point ("q", q, ctx);
+  gcry_mpi_point_release (q);
+
+  /* convert 'ctx' to 'sexp' */
+  GNUNET_assert (0 == gcry_pubkey_get_sexp (&pub_sexp, GCRY_PK_GET_PUBKEY, ctx));
+  gcry_ctx_release (ctx);
+  return pub_sexp;
+}
+
+
+/**
+ * Convert the given public key from the network format to the
+ * S-expression that can be used by libgcrypt.
+ *
+ * @param pub public key to decode
+ * @return NULL on error
+ */
+static gcry_sexp_t
+decode_public_eddsa_key (const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
+{
+  gcry_sexp_t pub_sexp;
+  gcry_mpi_t q_x;
+  gcry_mpi_t q_y;
+  gcry_mpi_point_t q;
+  gcry_ctx_t ctx;
+
+  mpi_scan (&q_x, pub->q_x, sizeof (pub->q_x));
+  mpi_scan (&q_y, pub->q_y, sizeof (pub->q_y));
+  q = gcry_mpi_point_new (256);
+  gcry_mpi_point_set (q, q_x, q_y, GCRYMPI_CONST_ONE);
+  gcry_mpi_release (q_x);
+  gcry_mpi_release (q_y);
+
+  /* initialize 'ctx' with 'q' */
+  GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); // FIXME: need to say EdDSA?
   gcry_mpi_ec_set_point ("q", q, ctx);
   gcry_mpi_point_release (q);
 
@@ -431,9 +656,35 @@ decode_public_sign_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
  * @param pk location of the key
  */
 void
-GNUNET_CRYPTO_ecc_key_clear (struct GNUNET_CRYPTO_EccPrivateKey *pk)
+GNUNET_CRYPTO_ecdhe_key_clear (struct GNUNET_CRYPTO_EcdhePrivateKey *pk)
 {
-  memset (pk, 0, sizeof (struct GNUNET_CRYPTO_EccPrivateKey));
+  memset (pk, 0, sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey));
+}
+
+
+/**
+ * @ingroup crypto
+ * Clear memory that was used to store a private key.
+ *
+ * @param pk location of the key
+ */
+void
+GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk)
+{
+  memset (pk, 0, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
+}
+
+
+/**
+ * @ingroup crypto
+ * Clear memory that was used to store a private key.
+ *
+ * @param pk location of the key
+ */
+void
+GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
+{
+  memset (pk, 0, sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey));
 }
 
 
@@ -442,10 +693,59 @@ GNUNET_CRYPTO_ecc_key_clear (struct GNUNET_CRYPTO_EccPrivateKey *pk)
  *
  * @return fresh private key
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create ()
+struct GNUNET_CRYPTO_EcdhePrivateKey *
+GNUNET_CRYPTO_ecdhe_key_create ()
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  struct GNUNET_CRYPTO_EcdhePrivateKey *priv;
+  gcry_sexp_t priv_sexp;
+  gcry_sexp_t s_keyparam;
+  gcry_mpi_t d;
+  int rc;
+
+  if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL,
+                                  "(genkey(ecdsa(curve \"" CURVE "\")))"))) // FIXME: ECDHE?
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
+    return NULL;
+  }
+  if (0 != (rc = gcry_pk_genkey (&priv_sexp, s_keyparam)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_genkey", rc);
+    gcry_sexp_release (s_keyparam);
+    return NULL;
+  }
+  gcry_sexp_release (s_keyparam);
+#if EXTRA_CHECKS
+  if (0 != (rc = gcry_pk_testkey (priv_sexp)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+    gcry_sexp_release (priv_sexp);
+    return NULL;
+  }
+#endif
+  if (0 != (rc = key_from_sexp (&d, priv_sexp, "private-key", "d")))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "key_from_sexp", rc);
+    gcry_sexp_release (priv_sexp);
+    return NULL;
+  }
+  gcry_sexp_release (priv_sexp);
+  priv = GNUNET_new (struct GNUNET_CRYPTO_EcdhePrivateKey);
+  mpi_print (priv->d, sizeof (priv->d), d);
+  gcry_mpi_release (d);
+  return priv;
+}
+
+
+/**
+ * Create a new private key. Caller must free return value.
+ *
+ * @return fresh private key
+ */
+struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_create ()
+{
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *priv;
   gcry_sexp_t priv_sexp;
   gcry_sexp_t s_keyparam;
   gcry_mpi_t d;
@@ -463,71 +763,275 @@ GNUNET_CRYPTO_ecc_key_create ()
     gcry_sexp_release (s_keyparam);
     return NULL;
   }
-  gcry_sexp_release (s_keyparam);
-#if EXTRA_CHECKS
-  if (0 != (rc = gcry_pk_testkey (priv_sexp)))
+  gcry_sexp_release (s_keyparam);
+#if EXTRA_CHECKS
+  if (0 != (rc = gcry_pk_testkey (priv_sexp)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+    gcry_sexp_release (priv_sexp);
+    return NULL;
+  }
+#endif
+  if (0 != (rc = key_from_sexp (&d, priv_sexp, "private-key", "d")))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "key_from_sexp", rc);
+    gcry_sexp_release (priv_sexp);
+    return NULL;
+  }
+  gcry_sexp_release (priv_sexp);
+  priv = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
+  mpi_print (priv->d, sizeof (priv->d), d);
+  gcry_mpi_release (d);
+  return priv;
+}
+
+/**
+ * Create a new private key. Caller must free return value.
+ *
+ * @return fresh private key
+ */
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create ()
+{
+  struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
+  gcry_sexp_t priv_sexp;
+  gcry_sexp_t s_keyparam;
+  gcry_mpi_t d;
+  int rc;
+
+  if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL,
+                                  "(genkey(ecdsa(curve \"" CURVE "\")))"))) // FIXME: EdDSA?
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
+    return NULL;
+  }
+  if (0 != (rc = gcry_pk_genkey (&priv_sexp, s_keyparam)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_genkey", rc);
+    gcry_sexp_release (s_keyparam);
+    return NULL;
+  }
+  gcry_sexp_release (s_keyparam);
+#if EXTRA_CHECKS
+  if (0 != (rc = gcry_pk_testkey (priv_sexp)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+    gcry_sexp_release (priv_sexp);
+    return NULL;
+  }
+#endif
+  if (0 != (rc = key_from_sexp (&d, priv_sexp, "private-key", "d")))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "key_from_sexp", rc);
+    gcry_sexp_release (priv_sexp);
+    return NULL;
+  }
+  gcry_sexp_release (priv_sexp);
+  priv = GNUNET_new (struct GNUNET_CRYPTO_EddsaPrivateKey);
+  mpi_print (priv->d, sizeof (priv->d), d);
+  gcry_mpi_release (d);
+  return priv;
+}
+
+
+/**
+ * Get the shared private key we use for anonymous users.
+ *
+ * @return "anonymous" private key
+ */
+const struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_get_anonymous ()
+{
+  /**
+   * 'anonymous' pseudonym (global static, d=1, public key = G
+   * (generator).
+   */
+  static struct GNUNET_CRYPTO_EcdsaPrivateKey anonymous;
+  static int once;
+
+  if (once)
+    return &anonymous;
+  mpi_print (anonymous.d,
+            sizeof (anonymous.d),
+            GCRYMPI_CONST_ONE);
+  once = 1;
+  return &anonymous;
+}
+
+
+/**
+ * Wait for a short time (we're trying to lock a file or want
+ * to give another process a shot at finishing a disk write, etc.).
+ * Sleeps for 100ms (as that should be long enough for virtually all
+ * modern systems to context switch and allow another process to do
+ * some 'real' work).
+ */
+static void
+short_wait ()
+{
+  struct GNUNET_TIME_Relative timeout;
+
+  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100);
+  (void) GNUNET_NETWORK_socket_select (NULL, NULL, NULL, timeout);
+}
+
+
+/**
+ * Create a new private key by reading it from a file.  If the
+ * files does not exist, create a new key and write it to the
+ * file.  Caller must free return value.  Note that this function
+ * can not guarantee that another process might not be trying
+ * the same operation on the same file at the same time.
+ * If the contents of the file
+ * are invalid the old file is deleted and a fresh key is
+ * created.
+ *
+ * @param filename name of file to use to store the key
+ * @return new private key, NULL on error (for example,
+ *   permission denied)
+ */
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename)
+{
+  struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
+  struct GNUNET_DISK_FileHandle *fd;
+  unsigned int cnt;
+  int ec;
+  uint64_t fs;
+
+  if (GNUNET_SYSERR == GNUNET_DISK_directory_create_for_file (filename))
+    return NULL;
+  while (GNUNET_YES != GNUNET_DISK_file_test (filename))
+  {
+    fd = GNUNET_DISK_file_open (filename,
+                                GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE
+                                | GNUNET_DISK_OPEN_FAILIFEXISTS,
+                                GNUNET_DISK_PERM_USER_READ |
+                                GNUNET_DISK_PERM_USER_WRITE);
+    if (NULL == fd)
+    {
+      if (EEXIST == errno)
+      {
+        if (GNUNET_YES != GNUNET_DISK_file_test (filename))
+        {
+          /* must exist but not be accessible, fail for good! */
+          if (0 != ACCESS (filename, R_OK))
+            LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "access", filename);
+          else
+            GNUNET_break (0);   /* what is going on!? */
+          return NULL;
+        }
+        continue;
+      }
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename);
+      return NULL;
+    }
+    cnt = 0;
+    while (GNUNET_YES !=
+           GNUNET_DISK_file_lock (fd, 0,
+                                  sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey),
+                                  GNUNET_YES))
+    {
+      short_wait ();
+      if (0 == ++cnt % 10)
+      {
+        ec = errno;
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             _("Could not acquire lock on file `%s': %s...\n"), filename,
+             STRERROR (ec));
+      }
+    }
+    LOG (GNUNET_ERROR_TYPE_INFO,
+         _("Creating a new private key.  This may take a while.\n"));
+    priv = GNUNET_CRYPTO_eddsa_key_create ();
+    GNUNET_assert (NULL != priv);
+    GNUNET_assert (sizeof (*priv) ==
+                   GNUNET_DISK_file_write (fd, priv, sizeof (*priv)));
+    GNUNET_DISK_file_sync (fd);
+    if (GNUNET_YES !=
+        GNUNET_DISK_file_unlock (fd, 0,
+                                 sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)))
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+    GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
+    return priv;
+  }
+  /* key file exists already, read it! */
+  fd = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ,
+                              GNUNET_DISK_PERM_NONE);
+  if (NULL == fd)
   {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
-    gcry_sexp_release (priv_sexp);
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename);
     return NULL;
   }
-#endif
-  if (0 != (rc = key_from_sexp (&d, priv_sexp, "private-key", "d")))
+  cnt = 0;
+  while (1)
   {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "key_from_sexp", rc);
-    gcry_sexp_release (priv_sexp);
-    return NULL;
+    if (GNUNET_YES !=
+        GNUNET_DISK_file_lock (fd, 0,
+                               sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey),
+                               GNUNET_NO))
+    {
+      if (0 == ++cnt % 60)
+      {
+        ec = errno;
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             _("Could not acquire lock on file `%s': %s...\n"), filename,
+             STRERROR (ec));
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             _
+             ("This may be ok if someone is currently generating a private key.\n"));
+      }
+      short_wait ();
+      continue;
+    }
+    if (GNUNET_YES != GNUNET_DISK_file_test (filename))
+    {
+      /* eh, what!? File we opened is now gone!? */
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", filename);
+      if (GNUNET_YES !=
+          GNUNET_DISK_file_unlock (fd, 0,
+                                   sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)))
+        LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+      GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
+
+      return NULL;
+    }
+    if (GNUNET_OK != GNUNET_DISK_file_size (filename, &fs, GNUNET_YES, GNUNET_YES))
+      fs = 0;
+    if (fs < sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey))
+    {
+      /* maybe we got the read lock before the key generating
+       * process had a chance to get the write lock; give it up! */
+      if (GNUNET_YES !=
+          GNUNET_DISK_file_unlock (fd, 0,
+                                   sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)))
+        LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+      if (0 == ++cnt % 10)
+      {
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             _("When trying to read key file `%s' I found %u bytes but I need at least %u.\n"),
+             filename, (unsigned int) fs,
+             (unsigned int) sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey));
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             _("This may be ok if someone is currently generating a key.\n"));
+      }
+      short_wait ();                /* wait a bit longer! */
+      continue;
+    }
+    break;
   }
-  gcry_sexp_release (priv_sexp);
-  priv = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
-  mpi_print (priv->d, sizeof (priv->d), d);
-  gcry_mpi_release (d);
+  fs = sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey);
+  priv = GNUNET_malloc (fs);
+  GNUNET_assert (fs == GNUNET_DISK_file_read (fd, priv, fs));
+  if (GNUNET_YES !=
+      GNUNET_DISK_file_unlock (fd, 0,
+                               sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)))
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+  GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
   return priv;
 }
 
 
-/**
- * Get the shared private key we use for anonymous users.
- *
- * @return "anonymous" private key
- */
-const struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_get_anonymous ()
-{
-  /**
-   * 'anonymous' pseudonym (global static, d=1, public key = G
-   * (generator).
-   */
-  static struct GNUNET_CRYPTO_EccPrivateKey anonymous;
-  static int once;
-
-  if (once)
-    return &anonymous;
-  mpi_print (anonymous.d,
-            sizeof (anonymous.d),
-            GCRYMPI_CONST_ONE);
-  once = 1;
-  return &anonymous;
-}
-
-
-/**
- * Wait for a short time (we're trying to lock a file or want
- * to give another process a shot at finishing a disk write, etc.).
- * Sleeps for 100ms (as that should be long enough for virtually all
- * modern systems to context switch and allow another process to do
- * some 'real' work).
- */
-static void
-short_wait ()
-{
-  struct GNUNET_TIME_Relative timeout;
-
-  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100);
-  (void) GNUNET_NETWORK_socket_select (NULL, NULL, NULL, timeout);
-}
-
-
 /**
  * Create a new private key by reading it from a file.  If the
  * files does not exist, create a new key and write it to the
@@ -542,10 +1046,10 @@ short_wait ()
  * @return new private key, NULL on error (for example,
  *   permission denied)
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
+struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *priv;
   struct GNUNET_DISK_FileHandle *fd;
   unsigned int cnt;
   int ec;
@@ -581,7 +1085,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
     cnt = 0;
     while (GNUNET_YES !=
            GNUNET_DISK_file_lock (fd, 0,
-                                  sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+                                  sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
                                   GNUNET_YES))
     {
       short_wait ();
@@ -595,14 +1099,14 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
     }
     LOG (GNUNET_ERROR_TYPE_INFO,
          _("Creating a new private key.  This may take a while.\n"));
-    priv = GNUNET_CRYPTO_ecc_key_create ();
+    priv = GNUNET_CRYPTO_ecdsa_key_create ();
     GNUNET_assert (NULL != priv);
     GNUNET_assert (sizeof (*priv) ==
                    GNUNET_DISK_file_write (fd, priv, sizeof (*priv)));
     GNUNET_DISK_file_sync (fd);
     if (GNUNET_YES !=
         GNUNET_DISK_file_unlock (fd, 0,
-                                 sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+                                 sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
     GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
     return priv;
@@ -620,7 +1124,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
   {
     if (GNUNET_YES !=
         GNUNET_DISK_file_lock (fd, 0,
-                               sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+                               sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
                                GNUNET_NO))
     {
       if (0 == ++cnt % 60)
@@ -642,7 +1146,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", filename);
       if (GNUNET_YES !=
           GNUNET_DISK_file_unlock (fd, 0,
-                                   sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+                                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
       GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
 
@@ -650,36 +1154,34 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
     }
     if (GNUNET_OK != GNUNET_DISK_file_size (filename, &fs, GNUNET_YES, GNUNET_YES))
       fs = 0;
-    if (fs < sizeof (struct GNUNET_CRYPTO_EccPrivateKey))
+    if (fs < sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))
     {
       /* maybe we got the read lock before the key generating
        * process had a chance to get the write lock; give it up! */
       if (GNUNET_YES !=
           GNUNET_DISK_file_unlock (fd, 0,
-                                   sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+                                   sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
       if (0 == ++cnt % 10)
       {
         LOG (GNUNET_ERROR_TYPE_ERROR,
-             _
-             ("When trying to read key file `%s' I found %u bytes but I need at least %u.\n"),
+             _("When trying to read key file `%s' I found %u bytes but I need at least %u.\n"),
              filename, (unsigned int) fs,
-             (unsigned int) sizeof (struct GNUNET_CRYPTO_EccPrivateKey));
+             (unsigned int) sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
         LOG (GNUNET_ERROR_TYPE_ERROR,
-             _
-             ("This may be ok if someone is currently generating a key.\n"));
+             _("This may be ok if someone is currently generating a key.\n"));
       }
       short_wait ();                /* wait a bit longer! */
       continue;
     }
     break;
   }
-  fs = sizeof (struct GNUNET_CRYPTO_EccPrivateKey);
+  fs = sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey);
   priv = GNUNET_malloc (fs);
   GNUNET_assert (fs == GNUNET_DISK_file_read (fd, priv, fs));
   if (GNUNET_YES !=
       GNUNET_DISK_file_unlock (fd, 0,
-                               sizeof (struct GNUNET_CRYPTO_EccPrivateKey)))
+                               sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
     LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
   GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
   return priv;
@@ -694,16 +1196,16 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename)
  * @return new private key, NULL on error (for example,
  *   permission denied)
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg)
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
   char *fn;
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (cfg, "PEER", "PRIVATE_KEY", &fn))
     return NULL;
-  priv = GNUNET_CRYPTO_ecc_key_create_from_file (fn);
+  priv = GNUNET_CRYPTO_eddsa_key_create_from_file (fn);
   GNUNET_free (fn);
   return priv;
 }
@@ -718,14 +1220,14 @@ GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATI
  * @param cfg_name name of the configuration file to use
  */
 void
-GNUNET_CRYPTO_ecc_setup_key (const char *cfg_name)
+GNUNET_CRYPTO_eddsa_setup_key (const char *cfg_name)
 {
   struct GNUNET_CONFIGURATION_Handle *cfg;
-  struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
 
   cfg = GNUNET_CONFIGURATION_create ();
   (void) GNUNET_CONFIGURATION_load (cfg, cfg_name);
-  priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
+  priv = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
   if (NULL != priv)
     GNUNET_free (priv);
   GNUNET_CONFIGURATION_destroy (cfg);
@@ -744,15 +1246,15 @@ int
 GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  struct GNUNET_PeerIdentity *dst)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *priv;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
 
-  if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg)))
+  if (NULL == (priv = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Could not load peer's private key\n"));
     return GNUNET_SYSERR;
   }
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &dst->public_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (priv, &dst->public_key);
   GNUNET_free (priv);
   return GNUNET_OK;
 }
@@ -766,7 +1268,35 @@ GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return converted s-expression
  */
 static gcry_sexp_t
-data_to_pkcs1 (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose)
+data_to_eddsa_value (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose)
+{
+  struct GNUNET_HashCode hc;
+  gcry_sexp_t data;
+  int rc;
+
+  GNUNET_CRYPTO_hash (purpose, ntohl (purpose->size), &hc);
+  if (0 != (rc = gcry_sexp_build (&data, NULL,
+                                 "(data(flags rfc6979)(hash %s %b))", // FIXME: use EdDSA encoding!
+                                 "sha512",
+                                 sizeof (hc),
+                                 &hc)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
+    return NULL;
+  }
+  return data;
+}
+
+
+/**
+ * Convert the data specified in the given purpose argument to an
+ * S-expression suitable for signature operations.
+ *
+ * @param purpose data to convert
+ * @return converted s-expression
+ */
+static gcry_sexp_t
+data_to_ecdsa_value (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose)
 {
   struct GNUNET_HashCode hc;
   gcry_sexp_t data;
@@ -795,9 +1325,9 @@ data_to_pkcs1 (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose)
  * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                        const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
-                        struct GNUNET_CRYPTO_EccSignature *sig)
+GNUNET_CRYPTO_ecdsa_sign (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+                          const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+                          struct GNUNET_CRYPTO_EcdsaSignature *sig)
 {
   gcry_sexp_t priv_sexp;
   gcry_sexp_t sig_sexp;
@@ -805,8 +1335,8 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
   int rc;
   gcry_mpi_t rs[2];
 
-  priv_sexp = decode_private_key (priv);
-  data = data_to_pkcs1 (purpose);
+  priv_sexp = decode_private_ecdsa_key (priv);
+  data = data_to_ecdsa_value (purpose);
   if (0 != (rc = gcry_pk_sign (&sig_sexp, data, priv_sexp)))
   {
     LOG (GNUNET_ERROR_TYPE_WARNING,
@@ -836,6 +1366,56 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
 }
 
 
+/**
+ * Sign a given block.
+ *
+ * @param priv private key to use for the signing
+ * @param purpose what to sign (size, purpose)
+ * @param sig where to write the signature
+ * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
+ */
+int
+GNUNET_CRYPTO_eddsa_sign (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
+                          const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+                          struct GNUNET_CRYPTO_EddsaSignature *sig)
+{
+  gcry_sexp_t priv_sexp;
+  gcry_sexp_t sig_sexp;
+  gcry_sexp_t data;
+  int rc;
+  gcry_mpi_t rs[2];
+
+  priv_sexp = decode_private_eddsa_key (priv);
+  data = data_to_eddsa_value (purpose);
+  if (0 != (rc = gcry_pk_sign (&sig_sexp, data, priv_sexp)))
+  {
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+         _("EdDSA signing failed at %s:%d: %s\n"), __FILE__,
+         __LINE__, gcry_strerror (rc));
+    gcry_sexp_release (data);
+    gcry_sexp_release (priv_sexp);
+    return GNUNET_SYSERR;
+  }
+  gcry_sexp_release (priv_sexp);
+  gcry_sexp_release (data);
+
+  /* extract 'r' and 's' values from sexpression 'sig_sexp' and store in
+     'signature' */
+  if (0 != (rc = key_from_sexp (rs, sig_sexp, "sig-val", "rs")))
+  {
+    GNUNET_break (0);
+    gcry_sexp_release (sig_sexp);
+    return GNUNET_SYSERR;
+  }
+  gcry_sexp_release (sig_sexp);
+  mpi_print (sig->r, sizeof (sig->r), rs[0]);
+  mpi_print (sig->s, sizeof (sig->s), rs[1]);
+  gcry_mpi_release (rs[0]);
+  gcry_mpi_release (rs[1]);
+  return GNUNET_OK;
+}
+
+
 /**
  * Verify signature.
  *
@@ -846,11 +1426,10 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
  * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
  */
 int
-GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
-                          const struct GNUNET_CRYPTO_EccSignaturePurpose
-                          *validate,
-                          const struct GNUNET_CRYPTO_EccSignature *sig,
-                          const struct GNUNET_CRYPTO_EccPublicSignKey *pub)
+GNUNET_CRYPTO_ecdsa_verify (uint32_t purpose,
+                            const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
+                            const struct GNUNET_CRYPTO_EcdsaSignature *sig,
+                            const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
 {
   gcry_sexp_t data;
   gcry_sexp_t sig_sexpr;
@@ -876,8 +1455,70 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
   }
   gcry_mpi_release (r);
   gcry_mpi_release (s);
-  data = data_to_pkcs1 (validate);
-  if (! (pub_sexpr = decode_public_sign_key (pub)))
+  data = data_to_ecdsa_value (validate);
+  if (! (pub_sexpr = decode_public_ecdsa_key (pub)))
+  {
+    gcry_sexp_release (data);
+    gcry_sexp_release (sig_sexpr);
+    return GNUNET_SYSERR;
+  }
+  rc = gcry_pk_verify (sig_sexpr, data, pub_sexpr);
+  gcry_sexp_release (pub_sexpr);
+  gcry_sexp_release (data);
+  gcry_sexp_release (sig_sexpr);
+  if (0 != rc)
+  {
+    LOG (GNUNET_ERROR_TYPE_INFO,
+         _("ECDSA signature verification failed at %s:%d: %s\n"), __FILE__,
+         __LINE__, gcry_strerror (rc));
+    return GNUNET_SYSERR;
+  }
+  return GNUNET_OK;
+}
+
+
+
+/**
+ * Verify signature.
+ *
+ * @param purpose what is the purpose that the signature should have?
+ * @param validate block to validate (size, purpose, data)
+ * @param sig signature that is being validated
+ * @param pub public key of the signer
+ * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
+ */
+int
+GNUNET_CRYPTO_eddsa_verify (uint32_t purpose,
+                            const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
+                            const struct GNUNET_CRYPTO_EddsaSignature *sig,
+                            const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
+{
+  gcry_sexp_t data;
+  gcry_sexp_t sig_sexpr;
+  gcry_sexp_t pub_sexpr;
+  int rc;
+  gcry_mpi_t r;
+  gcry_mpi_t s;
+
+  if (purpose != ntohl (validate->purpose))
+    return GNUNET_SYSERR;       /* purpose mismatch */
+
+  /* build s-expression for signature */
+  mpi_scan (&r, sig->r, sizeof (sig->r));
+  mpi_scan (&s, sig->s, sizeof (sig->s));
+  if (0 != (rc = gcry_sexp_build (&sig_sexpr, NULL,
+                                 "(sig-val(eddsa(r %m)(s %m)))",
+                                  r, s)))
+  {
+    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
+    gcry_mpi_release (r);
+    gcry_mpi_release (s);
+    return GNUNET_SYSERR;
+  }
+  gcry_mpi_release (r);
+  gcry_mpi_release (s);
+  data = data_to_eddsa_value (validate);
+  if (! (pub_sexpr = decode_public_eddsa_key (pub)))
   {
     gcry_sexp_release (data);
     gcry_sexp_release (sig_sexpr);
@@ -890,7 +1531,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
   if (0 != rc)
   {
     LOG (GNUNET_ERROR_TYPE_INFO,
-         _("ECC signature verification failed at %s:%d: %s\n"), __FILE__,
+         _("EdDSA signature verification failed at %s:%d: %s\n"), __FILE__,
          __LINE__, gcry_strerror (rc));
     return GNUNET_SYSERR;
   }
@@ -906,7 +1547,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
  * @return NULL on error
  */
 static gcry_sexp_t
-decode_public_encrypt_key (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub)
+decode_public_ecdhe_key (const struct GNUNET_CRYPTO_EcdhePublicKey *pub)
 {
   gcry_sexp_t pub_sexp;
   gcry_mpi_t q_x;
@@ -934,7 +1575,7 @@ decode_public_encrypt_key (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub)
 
 
 /**
- * Derive key material from a public and a private ECC key.
+ * Derive key material from a public and a private ECDHE key.
  *
  * @param priv private key to use for the ECDH (x)
  * @param pub public key to use for the ECDH (yG)
@@ -942,8 +1583,8 @@ decode_public_encrypt_key (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub)
  * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                        const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub,
+GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
+                        const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
                         struct GNUNET_HashCode *key_material)
 {
   gcry_mpi_point_t result;
@@ -956,7 +1597,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
   unsigned char xbuf[256 / 8];
 
   /* first, extract the q = dP value from the public key */
-  if (! (pub_sexpr = decode_public_encrypt_key (pub)))
+  if (! (pub_sexpr = decode_public_ecdhe_key (pub)))
     return GNUNET_SYSERR;
   GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, pub_sexpr, NULL));
   gcry_sexp_release (pub_sexpr);
@@ -1003,7 +1644,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
  * @return h value
  */
 static gcry_mpi_t
-derive_h (const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
+derive_h (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
          const char *label,
          const char *context)
 {
@@ -1033,13 +1674,13 @@ derive_h (const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
  *        typically the name of the subsystem/application
  * @return derived private key
  */
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
-                             const char *label,
-                             const char *context)
+struct GNUNET_CRYPTO_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_private_key_derive (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+                                        const char *label,
+                                        const char *context)
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
-  struct GNUNET_CRYPTO_EccPrivateKey *ret;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pub;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *ret;
   gcry_mpi_t h;
   gcry_mpi_t x;
   gcry_mpi_t d;
@@ -1048,7 +1689,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
 
   GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE));
   n = gcry_mpi_ec_get_mpi ("n", ctx, 1);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &pub);
+  GNUNET_CRYPTO_ecdsa_key_get_public (priv, &pub);
   h = derive_h (&pub, label, context);
   mpi_scan (&x, priv->d, sizeof (priv->d));
   d = gcry_mpi_new (256);
@@ -1057,7 +1698,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
   gcry_mpi_release (x);
   gcry_mpi_release (n);
   gcry_ctx_release (ctx);
-  ret = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+  ret = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
   mpi_print (ret->d, sizeof (ret->d), d);
   gcry_mpi_release (d);
   return ret;
@@ -1075,10 +1716,10 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
  * @param result where to write the derived public key
  */
 void
-GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey *pub,
-                                    const char *label,
-                                    const char *context,
-                                    struct GNUNET_CRYPTO_EccPublicSignKey *result)
+GNUNET_CRYPTO_ecdsa_public_key_derive (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
+                                       const char *label,
+                                       const char *context,
+                                       struct GNUNET_CRYPTO_EcdsaPublicKey *result)
 {
   gcry_ctx_t ctx;
   gcry_mpi_t h;
@@ -1113,7 +1754,7 @@ GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey
   gcry_mpi_release (n);
   gcry_mpi_point_release (q);
   /* convert point 'v' to public key that we return */
-  point_to_public_sign_key (v, ctx, result);
+  point_to_public_ecdsa_key (v, ctx, result);
   gcry_mpi_point_release (v);
   gcry_ctx_release (ctx);
 }
index 23e562cbee98ad94b87e56264d0450011d48e351..e76321e5ea42d44c431060f49b7e911a62b0057c 100644 (file)
@@ -20,7 +20,7 @@
 
 /**
  * @file util/gnunet-ecc.c
- * @brief tool to manipulate ECC key files
+ * @brief tool to manipulate EDDSA key files
  * @author Christian Grothoff
  */
 #include "platform.h"
@@ -52,7 +52,7 @@ static void
 create_keys (const char *fn)
 {
   FILE *f;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
 
   if (NULL == (f = fopen (fn, "w+")))
   {
@@ -69,7 +69,7 @@ create_keys (const char *fn)
   {
     fprintf (stderr,
             ".");
-    if (NULL == (pk = GNUNET_CRYPTO_ecc_key_create ()))
+    if (NULL == (pk = GNUNET_CRYPTO_eddsa_key_create ()))
     {
        GNUNET_break (0);
        break;
@@ -109,12 +109,14 @@ static void
 run (void *cls, char *const *args, const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
-  struct GNUNET_CRYPTO_EccPublicSignKey pub;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPublicKey pub;
 
   if (NULL == args[0])
   {
-    fprintf (stderr, _("No hostkey file specified on command line\n"));
+    FPRINTF (stderr,
+             "%s",
+             _("No hostkey file specified on command line\n"));
     return;
   }
   if (make_keys > 0)
@@ -122,25 +124,27 @@ run (void *cls, char *const *args, const char *cfgfile,
     create_keys (args[0]);
     return;
   }
-  pk = GNUNET_CRYPTO_ecc_key_create_from_file (args[0]);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_file (args[0]);
   if (NULL == pk)
     return;
   if (print_public_key)
   {
     char *s;
 
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub);
-    s = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pub);
-    fprintf (stdout, "%s\n", s);
+    GNUNET_CRYPTO_eddsa_key_get_public (pk, &pub);
+    s = GNUNET_CRYPTO_eddsa_public_key_to_string (&pub);
+    FPRINTF (stdout,
+             "%s\n",
+             s);
     GNUNET_free (s);
   }
   if (print_peer_identity)
   {
     char *str;
 
-    GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub);
-    str = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pub);
-    fprintf (stdout,
+    GNUNET_CRYPTO_eddsa_key_get_public (pk, &pub);
+    str = GNUNET_CRYPTO_eddsa_public_key_to_string (&pub);
+    FPRINTF (stdout,
              "%s\n",
              str);
     GNUNET_free (str);
index 5a35a0df59290dd5531325043a3f03346522177d..a68fdc45b785e64e2e767715c6fd5b46932d230e 100644 (file)
@@ -226,7 +226,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     if (udp)
       protocol = IPPROTO_UDP;
     if (GNUNET_OK !=
-       GNUNET_CRYPTO_ecc_public_sign_key_from_string (peer_id,
+       GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id,
                                                       strlen (peer_id),
                                                       &peer.public_key))
     {