[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30096 - in gnunet/src: ats-tool core dns exit fs gns hello
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30096 - in gnunet/src: ats-tool core dns exit fs gns hello identity include mesh namestore nse peerinfo peerinfo-tool psycstore regex revocation testing topology transport util vpn |
Date: |
Thu, 10 Oct 2013 16:38:55 +0200 |
Author: grothoff
Date: 2013-10-10 16:38:55 +0200 (Thu, 10 Oct 2013)
New Revision: 30096
Modified:
gnunet/src/ats-tool/gnunet-ats.c
gnunet/src/core/gnunet-service-core.c
gnunet/src/core/gnunet-service-core_kx.c
gnunet/src/core/gnunet-service-core_kx.h
gnunet/src/dns/plugin_block_dns.c
gnunet/src/exit/gnunet-daemon-exit.c
gnunet/src/fs/fs_api.c
gnunet/src/fs/fs_api.h
gnunet/src/fs/fs_namespace.c
gnunet/src/fs/fs_publish.c
gnunet/src/fs/fs_publish_ksk.c
gnunet/src/fs/fs_publish_ublock.c
gnunet/src/fs/fs_publish_ublock.h
gnunet/src/fs/fs_search.c
gnunet/src/fs/fs_unindex.c
gnunet/src/fs/fs_uri.c
gnunet/src/fs/gnunet-publish.c
gnunet/src/fs/plugin_block_fs.c
gnunet/src/fs/test_fs_namespace.c
gnunet/src/fs/test_fs_namespace_list_updateable.c
gnunet/src/fs/test_fs_uri.c
gnunet/src/gns/gns.h
gnunet/src/gns/gns_api.c
gnunet/src/gns/gnunet-dns2gns.c
gnunet/src/gns/gnunet-gns-helper-service-w32.c
gnunet/src/gns/gnunet-gns-proxy.c
gnunet/src/gns/gnunet-gns.c
gnunet/src/gns/gnunet-service-gns.c
gnunet/src/gns/gnunet-service-gns_interceptor.c
gnunet/src/gns/gnunet-service-gns_interceptor.h
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/gns/gnunet-service-gns_resolver.h
gnunet/src/gns/gnunet-service-gns_shorten.c
gnunet/src/gns/gnunet-service-gns_shorten.h
gnunet/src/gns/plugin_block_gns.c
gnunet/src/gns/test_gns_proxy.c
gnunet/src/gns/test_gns_pseu_shorten.c
gnunet/src/gns/test_gns_revocation.c
gnunet/src/gns/test_gns_simple_shorten.c
gnunet/src/gns/test_gns_simple_srv_lookup.c
gnunet/src/gns/test_gns_simple_zkey_lookup.c
gnunet/src/hello/gnunet-hello.c
gnunet/src/hello/hello.c
gnunet/src/hello/test_friend_hello.c
gnunet/src/hello/test_hello.c
gnunet/src/identity/gnunet-identity.c
gnunet/src/identity/gnunet-service-identity.c
gnunet/src/identity/identity.h
gnunet/src/identity/identity_api.c
gnunet/src/include/block_dns.h
gnunet/src/include/block_fs.h
gnunet/src/include/block_regex.h
gnunet/src/include/gnunet_crypto_lib.h
gnunet/src/include/gnunet_fs_service.h
gnunet/src/include/gnunet_gns_service.h
gnunet/src/include/gnunet_hello_lib.h
gnunet/src/include/gnunet_identity_service.h
gnunet/src/include/gnunet_multicast_service.h
gnunet/src/include/gnunet_namestore_plugin.h
gnunet/src/include/gnunet_namestore_service.h
gnunet/src/include/gnunet_psyc_service.h
gnunet/src/include/gnunet_psycstore_plugin.h
gnunet/src/include/gnunet_psycstore_service.h
gnunet/src/include/gnunet_revocation_service.h
gnunet/src/include/gnunet_testing_lib.h
gnunet/src/mesh/gnunet-mesh.c
gnunet/src/mesh/gnunet-service-mesh-enc.c
gnunet/src/mesh/gnunet-service-mesh.c
gnunet/src/mesh/gnunet-service-mesh_dht.c
gnunet/src/mesh/gnunet-service-mesh_tunnel.c
gnunet/src/mesh/gnunet-service-mesh_tunnel.h
gnunet/src/namestore/gnunet-namestore-fcfsd.c
gnunet/src/namestore/gnunet-namestore.c
gnunet/src/namestore/gnunet-service-namestore.c
gnunet/src/namestore/namestore.h
gnunet/src/namestore/namestore_api.c
gnunet/src/namestore/namestore_api_common.c
gnunet/src/namestore/namestore_api_monitor.c
gnunet/src/namestore/plugin_namestore_postgres.c
gnunet/src/namestore/plugin_namestore_sqlite.c
gnunet/src/namestore/test_namestore_api_blocks.c
gnunet/src/namestore/test_namestore_api_cache_block.c
gnunet/src/namestore/test_namestore_api_lookup_public.c
gnunet/src/namestore/test_namestore_api_monitoring.c
gnunet/src/namestore/test_namestore_api_monitoring_existing.c
gnunet/src/namestore/test_namestore_api_put.c
gnunet/src/namestore/test_namestore_api_remove.c
gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
gnunet/src/namestore/test_namestore_api_store.c
gnunet/src/namestore/test_namestore_api_store_update.c
gnunet/src/namestore/test_namestore_api_zone_iteration.c
gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
gnunet/src/namestore/test_namestore_api_zone_to_name.c
gnunet/src/namestore/test_plugin_namestore.c
gnunet/src/nse/gnunet-service-nse.c
gnunet/src/peerinfo-tool/gnunet-peerinfo.c
gnunet/src/peerinfo/gnunet-service-peerinfo.c
gnunet/src/psycstore/plugin_psycstore_sqlite.c
gnunet/src/psycstore/psycstore.h
gnunet/src/psycstore/psycstore_api.c
gnunet/src/psycstore/test_plugin_psycstore.c
gnunet/src/psycstore/test_psycstore.c
gnunet/src/regex/gnunet-daemon-regexprofiler.c
gnunet/src/regex/gnunet-service-regex.c
gnunet/src/regex/plugin_block_regex.c
gnunet/src/regex/regex_internal_dht.c
gnunet/src/regex/regex_internal_lib.h
gnunet/src/revocation/gnunet-revocation.c
gnunet/src/revocation/gnunet-service-revocation.c
gnunet/src/revocation/revocation.h
gnunet/src/revocation/revocation_api.c
gnunet/src/testing/gnunet-testing.c
gnunet/src/testing/testing.c
gnunet/src/topology/friends.c
gnunet/src/transport/gnunet-service-transport.c
gnunet/src/transport/gnunet-service-transport.h
gnunet/src/transport/gnunet-service-transport_blacklist.c
gnunet/src/transport/gnunet-service-transport_hello.c
gnunet/src/transport/gnunet-service-transport_hello.h
gnunet/src/transport/gnunet-service-transport_neighbours.c
gnunet/src/transport/gnunet-service-transport_validation.c
gnunet/src/transport/gnunet-service-transport_validation.h
gnunet/src/transport/gnunet-transport.c
gnunet/src/transport/plugin_transport_http_server.c
gnunet/src/transport/test_plugin_transport.c
gnunet/src/util/Makefile.am
gnunet/src/util/common_logging.c
gnunet/src/util/crypto_ecc.c
gnunet/src/util/gnunet-ecc.c
gnunet/src/vpn/gnunet-vpn.c
Log:
separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA
Modified: gnunet/src/ats-tool/gnunet-ats.c
===================================================================
--- gnunet/src/ats-tool/gnunet-ats.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/ats-tool/gnunet-ats.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -352,7 +352,7 @@
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))
{
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/core/gnunet-service-core.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -91,7 +91,7 @@
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 @@
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)) ||
Modified: gnunet/src/core/gnunet-service-core_kx.c
===================================================================
--- gnunet/src/core/gnunet-service-core_kx.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/core/gnunet-service-core_kx.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -90,7 +90,7 @@
* 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 @@
* 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 @@
/**
* 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 @@
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 @@
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 @@
}
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 @@
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 @@
{
current_ekm.expiration_time = GNUNET_TIME_absolute_hton
(GNUNET_TIME_UNIT_FOREVER_ABS);
}
- GNUNET_CRYPTO_ecc_key_get_public_for_encryption (my_ephemeral_key,
- ¤t_ekm.ephemeral_key);
+ GNUNET_CRYPTO_ecdhe_key_get_public (my_ephemeral_key,
+ ¤t_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,
¤t_ekm.purpose,
¤t_ekm.signature));
}
@@ -1520,7 +1520,7 @@
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 @@
* 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);
+ GNUNET_break (0);
+ GNUNET_free (my_private_key);
+ my_private_key = NULL;
+ return GNUNET_SYSERR;
}
- else
- {
- my_ephemeral_key = my_private_key;
- sign_ephemeral_key ();
- }
+ 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 @@
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;
Modified: gnunet/src/core/gnunet-service-core_kx.h
===================================================================
--- gnunet/src/core/gnunet-service-core_kx.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/core/gnunet-service-core_kx.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -121,7 +121,7 @@
* @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);
/**
Modified: gnunet/src/dns/plugin_block_dns.c
===================================================================
--- gnunet/src/dns/plugin_block_dns.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/dns/plugin_block_dns.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -76,7 +76,7 @@
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 @@
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))
Modified: gnunet/src/exit/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/exit/gnunet-daemon-exit.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/exit/gnunet-daemon-exit.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -438,7 +438,7 @@
/**
* 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 @@
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 @@
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"),
Modified: gnunet/src/fs/fs_api.c
===================================================================
--- gnunet/src/fs/fs_api.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_api.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -1477,7 +1477,7 @@
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 @@
}
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 @@
( (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;
Modified: gnunet/src/fs/fs_api.h
===================================================================
--- gnunet/src/fs/fs_api.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_api.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -128,10 +128,10 @@
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 @@
*/
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 @@
/**
* 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 @@
/**
* 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 @@
/**
* Derived public key, hashes to 'uquery'.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey dpub;
+ struct GNUNET_CRYPTO_EcdsaPublicKey dpub;
/**
* The original keyword, used to derive the
Modified: gnunet/src/fs/fs_namespace.c
===================================================================
--- gnunet/src/fs/fs_namespace.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_namespace.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -92,7 +92,7 @@
/**
* 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 @@
*/
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 @@
"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 @@
*/
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 @@
/**
* Namespace we're publishing to.
*/
- struct GNUNET_CRYPTO_EccPrivateKey ns;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey ns;
/**
* Handle to the datastore.
@@ -434,7 +434,7 @@
*/
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 @@
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 @@
*/
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)
Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_publish.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -1152,7 +1152,7 @@
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 @@
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);
Modified: gnunet/src/fs/fs_publish_ksk.c
===================================================================
--- gnunet/src/fs/fs_publish_ksk.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_publish_ksk.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -170,7 +170,7 @@
pkc->dsh,
keyword + 1 /* skip '+' */,
NULL,
- GNUNET_CRYPTO_ecc_key_get_anonymous (),
+ GNUNET_CRYPTO_ecdsa_key_get_anonymous (),
pkc->meta,
pkc->uri,
&pkc->bo,
Modified: gnunet/src/fs/fs_publish_ublock.c
===================================================================
--- gnunet/src/fs/fs_publish_ublock.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_publish_ublock.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -46,7 +46,7 @@
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 @@
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 @@
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 @@
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 @@
"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 @@
&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,
Modified: gnunet/src/fs/fs_publish_ublock.h
===================================================================
--- gnunet/src/fs/fs_publish_ublock.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_publish_ublock.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -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 @@
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,
Modified: gnunet/src/fs/fs_search.c
===================================================================
--- gnunet/src/fs/fs_search.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_search.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -679,20 +679,20 @@
*/
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 @@
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 @@
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 @@
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 @@
{
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 @@
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)
Modified: gnunet/src/fs/fs_unindex.c
===================================================================
--- gnunet/src/fs/fs_unindex.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_unindex.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -490,10 +490,10 @@
}
{
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 @@
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 @@
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);
Modified: gnunet/src/fs/fs_uri.c
===================================================================
--- gnunet/src/fs/fs_uri.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/fs_uri.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -118,7 +118,7 @@
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 @@
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 @@
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 @@
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 @@
*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 @@
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 @@
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 @@
_("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_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 @@
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 @@
* @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 @@
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 @@
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 @@
*/
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 @@
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 @@
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,
Modified: gnunet/src/fs/gnunet-publish.c
===================================================================
--- gnunet/src/fs/gnunet-publish.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/gnunet-publish.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -438,7 +438,7 @@
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 @@
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);
Modified: gnunet/src/fs/plugin_block_fs.c
===================================================================
--- gnunet/src/fs/plugin_block_fs.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/plugin_block_fs.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -105,13 +105,13 @@
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))
Modified: gnunet/src/fs/test_fs_namespace.c
===================================================================
--- gnunet/src/fs/test_fs_namespace.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/test_fs_namespace.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -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 @@
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 @@
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 @@
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 @@
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;
Modified: gnunet/src/fs/test_fs_namespace_list_updateable.c
===================================================================
--- gnunet/src/fs/test_fs_namespace_list_updateable.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/fs/test_fs_namespace_list_updateable.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -33,7 +33,7 @@
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 @@
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;
Modified: gnunet/src/fs/test_fs_uri.c
===================================================================
--- gnunet/src/fs/test_fs_uri.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/fs/test_fs_uri.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -163,8 +163,8 @@
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 @@
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);
Modified: gnunet/src/gns/gns.h
===================================================================
--- gnunet/src/gns/gns.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/gns.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -63,7 +63,7 @@
/**
* 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 @@
/**
* 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 */
};
Modified: gnunet/src/gns/gns_api.c
===================================================================
--- gnunet/src/gns/gns_api.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/gns_api.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -527,10 +527,10 @@
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)
{
Modified: gnunet/src/gns/gnunet-dns2gns.c
===================================================================
--- gnunet/src/gns/gnunet-dns2gns.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/gnunet-dns2gns.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -143,7 +143,7 @@
/**
* 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 @@
}
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)) )
{
Modified: gnunet/src/gns/gnunet-gns-helper-service-w32.c
===================================================================
--- gnunet/src/gns/gnunet-gns-helper-service-w32.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/gns/gnunet-gns-helper-service-w32.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -61,9 +61,9 @@
*/
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 @@
};
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 @@
{
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 @@
{
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);
}
Modified: gnunet/src/gns/gnunet-gns-proxy.c
===================================================================
--- gnunet/src/gns/gnunet-gns-proxy.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/gnunet-gns-proxy.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -623,12 +623,12 @@
/**
* 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 @@
&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;
}
Modified: gnunet/src/gns/gnunet-gns.c
===================================================================
--- gnunet/src/gns/gnunet-gns.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/gnunet-gns.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -191,8 +191,8 @@
* @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 @@
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 @@
* @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 @@
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 @@
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 @@
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 @@
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 @@
&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);
}
Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/gnunet-service-gns.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -318,7 +318,7 @@
*/
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 @@
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 @@
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 @@
{ &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 @@
&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))
{
Modified: gnunet/src/gns/gnunet-service-gns_interceptor.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_interceptor.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/gns/gnunet-service-gns_interceptor.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -75,7 +75,7 @@
/**
* 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 @@
* @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,
Modified: gnunet/src/gns/gnunet-service-gns_interceptor.h
===================================================================
--- gnunet/src/gns/gnunet-service-gns_interceptor.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/gns/gnunet-service-gns_interceptor.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -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);
/**
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -112,7 +112,7 @@
/**
* The zone of the GNS authority
*/
- struct GNUNET_CRYPTO_EccPublicSignKey gns_authority;
+ struct GNUNET_CRYPTO_EcdsaPublicKey gns_authority;
struct
{
@@ -230,7 +230,7 @@
/**
* 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 @@
/**
* 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 @@
/* 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 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
* @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 @@
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);
Modified: gnunet/src/gns/gnunet-service-gns_resolver.h
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/gns/gnunet-service-gns_resolver.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -83,10 +83,10 @@
* @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);
Modified: gnunet/src/gns/gnunet-service-gns_shorten.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_shorten.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/gns/gnunet-service-gns_shorten.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -65,7 +65,7 @@
* 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 @@
/**
* 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 @@
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_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 @@
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 @@
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 @@
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 @@
*/
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 @@
*/
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;
Modified: gnunet/src/gns/gnunet-service-gns_shorten.h
===================================================================
--- gnunet/src/gns/gnunet-service-gns_shorten.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/gns/gnunet-service-gns_shorten.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -59,8 +59,8 @@
*/
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
Modified: gnunet/src/gns/plugin_block_gns.c
===================================================================
--- gnunet/src/gns/plugin_block_gns.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/plugin_block_gns.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -85,7 +85,7 @@
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);
Modified: gnunet/src/gns/test_gns_proxy.c
===================================================================
--- gnunet/src/gns/test_gns_proxy.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/gns/test_gns_proxy.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -364,7 +364,7 @@
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 @@
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",
Modified: gnunet/src/gns/test_gns_pseu_shorten.c
===================================================================
--- gnunet/src/gns/test_gns_pseu_shorten.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/gns/test_gns_pseu_shorten.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -69,16 +69,16 @@
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
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 @@
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);
Modified: gnunet/src/gns/test_gns_revocation.c
===================================================================
--- gnunet/src/gns/test_gns_revocation.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/gns/test_gns_revocation.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -181,12 +181,12 @@
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 @@
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;
Modified: gnunet/src/gns/test_gns_simple_shorten.c
===================================================================
--- gnunet/src/gns/test_gns_simple_shorten.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/gns/test_gns_simple_shorten.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -61,10 +61,10 @@
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 @@
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 @@
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);
Modified: gnunet/src/gns/test_gns_simple_srv_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_srv_lookup.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/gns/test_gns_simple_srv_lookup.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -182,12 +182,12 @@
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 @@
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;
Modified: gnunet/src/gns/test_gns_simple_zkey_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_zkey_lookup.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/gns/test_gns_simple_zkey_lookup.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -199,11 +199,11 @@
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 @@
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;
Modified: gnunet/src/hello/gnunet-hello.c
===================================================================
--- gnunet/src/hello/gnunet-hello.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/hello/gnunet-hello.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -111,7 +111,7 @@
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;
Modified: gnunet/src/hello/hello.c
===================================================================
--- gnunet/src/hello/hello.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/hello/hello.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -59,7 +59,7 @@
/**
* The public key of the peer.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
+ struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
};
GNUNET_NETWORK_STRUCT_END
@@ -218,7 +218,7 @@
* @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 @@
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 @@
*/
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 @@
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 @@
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 @@
*/
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)
{
Modified: gnunet/src/hello/test_friend_hello.c
===================================================================
--- gnunet/src/hello/test_friend_hello.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/hello/test_friend_hello.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -93,8 +93,8 @@
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;
Modified: gnunet/src/hello/test_hello.c
===================================================================
--- gnunet/src/hello/test_hello.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/hello/test_hello.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -93,8 +93,8 @@
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;
Modified: gnunet/src/identity/gnunet-identity.c
===================================================================
--- gnunet/src/identity/gnunet-identity.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/identity/gnunet-identity.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -226,7 +226,7 @@
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 @@
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);
Modified: gnunet/src/identity/gnunet-service-identity.c
===================================================================
--- gnunet/src/identity/gnunet-service-identity.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/identity/gnunet-service-identity.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -58,7 +58,7 @@
/**
* Private key of the ego.
*/
- struct GNUNET_CRYPTO_EccPrivateKey *pk;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
/**
* String identifier for the ego.
@@ -370,10 +370,10 @@
* @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 @@
}
}
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 @@
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 @@
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);
Modified: gnunet/src/identity/identity.h
===================================================================
--- gnunet/src/identity/identity.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/identity/identity.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -81,7 +81,7 @@
/**
* 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 @@
/**
* 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 @@
/**
* The private key
*/
- struct GNUNET_CRYPTO_EccPrivateKey private_key;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
/* followed by 0-terminated identity name */
Modified: gnunet/src/identity/identity_api.c
===================================================================
--- gnunet/src/identity/identity_api.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/identity/identity_api.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -40,7 +40,7 @@
/**
* 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 @@
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 @@
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 @@
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 @@
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 @@
}
/* 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 @@
* @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 @@
*/
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 @@
{
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))
{
Modified: gnunet/src/include/block_dns.h
===================================================================
--- gnunet/src/include/block_dns.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/include/block_dns.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -37,7 +37,7 @@
/**
* 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
Modified: gnunet/src/include/block_fs.h
===================================================================
--- gnunet/src/include/block_fs.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/include/block_fs.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -48,7 +48,7 @@
/**
* 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 @@
/**
* 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 */
Modified: gnunet/src/include/block_regex.h
===================================================================
--- gnunet/src/include/block_regex.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/include/block_regex.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -72,7 +72,7 @@
/**
* The signature.
*/
- struct GNUNET_CRYPTO_EccSignature signature;
+ struct GNUNET_CRYPTO_EddsaSignature signature;
};
Modified: gnunet/src/include/gnunet_crypto_lib.h
===================================================================
--- gnunet/src/include/gnunet_crypto_lib.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/include/gnunet_crypto_lib.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -148,9 +148,10 @@
/**
- * @brief an ECC signature
+ * @brief an ECC signature using EdDSA.
+ * See https://gnunet.org/ed25519
*/
-struct GNUNET_CRYPTO_EccSignature
+struct GNUNET_CRYPTO_EddsaSignature
{
/**
@@ -166,13 +167,33 @@
};
+
/**
- * 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.
*
@@ -190,19 +211,43 @@
/**
+ * 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),
+ * 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];
+
+};
+
+
+/**
* The identity of the host (wraps the signing key of the peer).
*/
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,10 @@
/**
- * 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.
@@ -233,8 +279,34 @@
};
+/**
+ * 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.
+ */
+ unsigned char d[256 / 8];
+
+};
+
+
+/**
* @brief type for session keys
*/
struct GNUNET_CRYPTO_SymmetricSessionKey
@@ -743,11 +815,11 @@
* @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 @@
* @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 @@
* @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 @@
* @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,17 +882,16 @@
/**
- * 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
* Extract the public key for the given private key.
@@ -829,11 +900,10 @@
* @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);
-
/**
* @ingroup crypto
* Extract the public key for the given private key.
@@ -842,8 +912,8 @@
* @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);
/**
@@ -853,10 +923,20 @@
* @return string representing @a pub
*/
char *
-GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct
GNUNET_CRYPTO_EccPublicSignKey *pub);
+GNUNET_CRYPTO_ecdsa_public_key_to_string (const struct
GNUNET_CRYPTO_EcdsaPublicKey *pub);
/**
+ * Convert a public key to a string.
+ *
+ * @param pub key to convert
+ * @return string representing @a pub
+ */
+char *
+GNUNET_CRYPTO_eddsa_public_key_to_string (const struct
GNUNET_CRYPTO_EddsaPublicKey *pub);
+
+
+/**
* Convert a string representing a public key to a public key.
*
* @param enc encoded public key
@@ -865,23 +945,12 @@
* @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);
-
/**
- * 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);
-
-
-/**
* Convert a string representing a public key to a public key.
*
* @param enc encoded public key
@@ -890,9 +959,9 @@
* @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);
/**
@@ -910,12 +979,31 @@
* @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_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename);
/**
* @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_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename);
+
+
+/**
+ * @ingroup crypto
* Create a new private key by reading our peer's key from
* the file specified in the configuration.
*
@@ -923,8 +1011,8 @@
* @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);
/**
@@ -933,28 +1021,67 @@
*
* @return fresh private key; free using #GNUNET_free
*/
-struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_create (void);
+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);
+
+
+/**
+ * @ingroup crypto
+ * Create a new private key. Caller must free return value.
+ *
+ * @return fresh private key; free using #GNUNET_free
+ */
+struct GNUNET_CRYPTO_EcdhePrivateKey *
+GNUNET_CRYPTO_ecdhe_key_create (void);
+
+
+/**
+ * @ingroup crypto
* Clear memory that was used to store a private key.
*
* @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);
+
+
+/**
+ * @ingroup crypto
* Get the shared private key we use for anonymous users.
*
* @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 @@
* @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,19 @@
* 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)
@@ -1009,15 +1136,29 @@
* @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_eddsa_sign (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
+ const struct GNUNET_CRYPTO_EccSignaturePurpose
*purpose,
+ struct GNUNET_CRYPTO_EddsaSignature *sig);
/**
* @ingroup crypto
- * Verify signature.
+ * ECDSA 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_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
@@ -1025,14 +1166,32 @@
* @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_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 ECDSA 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_ecdsa_verify (uint32_t purpose,
+ const struct GNUNET_CRYPTO_EccSignaturePurpose
*validate,
+ const struct GNUNET_CRYPTO_EcdsaSignature *sig,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
+
+
+/**
+ * @ingroup crypto
* Derive a private key from a given private key and a label.
* Essentially calculates a private key 'h = H(l,P) * d mod n'
* where n is the size of the ECC group and P is the public
@@ -1044,10 +1203,10 @@
* 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 @@
* @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 */
Modified: gnunet/src/include/gnunet_fs_service.h
===================================================================
--- gnunet/src/include/gnunet_fs_service.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/include/gnunet_fs_service.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -337,7 +337,7 @@
* @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 @@
*/
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 @@
/**
* Public key of the namespace.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey pseudonym;
+ struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym;
} ns;
@@ -1962,7 +1962,7 @@
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 *
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 @@
*/
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);
Modified: gnunet/src/include/gnunet_gns_service.h
===================================================================
--- gnunet/src/include/gnunet_gns_service.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/include/gnunet_gns_service.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -107,10 +107,10 @@
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);
Modified: gnunet/src/include/gnunet_hello_lib.h
===================================================================
--- gnunet/src/include/gnunet_hello_lib.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/include/gnunet_hello_lib.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -198,7 +198,7 @@
* @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 @@
*/
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 @@
*/
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);
Modified: gnunet/src/include/gnunet_identity_service.h
===================================================================
--- gnunet/src/include/gnunet_identity_service.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_identity_service.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -76,7 +76,7 @@
* @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 @@
*/
void
GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego,
- struct GNUNET_CRYPTO_EccPublicSignKey *pk);
+ struct GNUNET_CRYPTO_EcdsaPublicKey *pk);
/**
Modified: gnunet/src/include/gnunet_multicast_service.h
===================================================================
--- gnunet/src/include/gnunet_multicast_service.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_multicast_service.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -112,7 +112,7 @@
*
* 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 @@
*/
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 @@
*/
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
(*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 @@
*/
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
(*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 @@
*/
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 @@
*/
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,
Modified: gnunet/src/include/gnunet_namestore_plugin.h
===================================================================
--- gnunet/src/include/gnunet_namestore_plugin.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_namestore_plugin.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -58,7 +58,7 @@
* @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 @@
* @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 @@
* @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 @@
* @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);
Modified: gnunet/src/include/gnunet_namestore_service.h
===================================================================
--- gnunet/src/include/gnunet_namestore_service.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_namestore_service.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -239,12 +239,12 @@
/**
* 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 @@
*/
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 @@
* @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 @@
*/
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 @@
*/
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 @@
*/
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 @@
* @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 @@
* 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 @@
*/
int
GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey,
- struct GNUNET_CRYPTO_EccPublicSignKey *pkey);
+ struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
/**
@@ -653,7 +653,7 @@
* @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 @@
* @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 @@
* @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 @@
*/
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);
Modified: gnunet/src/include/gnunet_psyc_service.h
===================================================================
--- gnunet/src/include/gnunet_psyc_service.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/include/gnunet_psyc_service.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -210,7 +210,7 @@
* 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 @@
*/
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
(*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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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);
Modified: gnunet/src/include/gnunet_psycstore_plugin.h
===================================================================
--- gnunet/src/include/gnunet_psycstore_plugin.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_psycstore_plugin.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -59,8 +59,8 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
int
(*state_update_signed) (void *cls,
- const struct GNUNET_CRYPTO_EccPublicSignKey
*channel_key);
+ const struct GNUNET_CRYPTO_EddsaPublicKey
*channel_key);
/**
@@ -296,7 +296,7 @@
*/
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 @@
*/
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 @@
*/
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);
Modified: gnunet/src/include/gnunet_psycstore_service.h
===================================================================
--- gnunet/src/include/gnunet_psycstore_service.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_psycstore_service.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -133,8 +133,8 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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,
Modified: gnunet/src/include/gnunet_revocation_service.h
===================================================================
--- gnunet/src/include/gnunet_revocation_service.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/include/gnunet_revocation_service.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -73,7 +73,7 @@
*/
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 *
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 @@
* @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 @@
* @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 */
Modified: gnunet/src/include/gnunet_testing_lib.h
===================================================================
--- gnunet/src/include/gnunet_testing_lib.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/include/gnunet_testing_lib.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -48,7 +48,7 @@
/**
* 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 @@
* 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);
Modified: gnunet/src/mesh/gnunet-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-mesh.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/mesh/gnunet-mesh.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -138,7 +138,7 @@
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))
{
Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -94,7 +94,7 @@
/**
* Own private key.
*/
-static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
/******************************************************************************/
@@ -156,7 +156,7 @@
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 @@
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,
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -717,7 +717,7 @@
/**
* 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 @@
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 @@
/* 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,
Modified: gnunet/src/mesh/gnunet-service-mesh_dht.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_dht.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/mesh/gnunet-service-mesh_dht.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -94,7 +94,7 @@
/**
* Own private key.
*/
-static struct GNUNET_CRYPTO_EccPrivateKey *private_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
/******************************************************************************/
Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -70,17 +70,17 @@
/**
* 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 @@
/**
* 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 @@
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",
Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -95,7 +95,7 @@
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.
Modified: gnunet/src/namestore/gnunet-namestore-fcfsd.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore-fcfsd.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/gnunet-namestore-fcfsd.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -196,7 +196,7 @@
/**
* 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 @@
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 @@
*/
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 @@
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 @@
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 @@
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 @@
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_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 @@
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 @@
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 @@
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 @@
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;
}
Modified: gnunet/src/namestore/gnunet-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/namestore/gnunet-namestore.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -41,7 +41,7 @@
/**
* 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 @@
*/
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 @@
*/
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 @@
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 @@
*/
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 @@
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 @@
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 @@
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 @@
}
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 @@
{
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 @@
}
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 @@
&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;
}
Modified: gnunet/src/namestore/gnunet-service-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-service-namestore.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/gnunet-service-namestore.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -64,7 +64,7 @@
/**
* 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 @@
/**
* 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 @@
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 @@
* @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 @@
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 @@
}
/* 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 @@
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 @@
*/
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 @@
*/
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 @@
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 @@
*/
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)
Modified: gnunet/src/namestore/namestore.h
===================================================================
--- gnunet/src/namestore/namestore.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/namestore.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -88,12 +88,12 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* Zone key.
*/
- struct GNUNET_CRYPTO_EccPrivateKey zone;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
};
@@ -349,7 +349,7 @@
/**
* Zone key. All zeros for "all zones".
*/
- struct GNUNET_CRYPTO_EccPrivateKey zone;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
};
Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/namestore/namestore_api.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -134,7 +134,7 @@
/**
* 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 @@
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 @@
*/
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 @@
*/
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 @@
*/
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)
{
Modified: gnunet/src/namestore/namestore_api_common.c
===================================================================
--- gnunet/src/namestore/namestore_api_common.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/namestore/namestore_api_common.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -98,13 +98,13 @@
* @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 @@
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 @@
* @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 @@
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 @@
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 @@
&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 @@
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 @@
*/
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 @@
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 @@
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 @@
{
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 @@
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 @@
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 @@
}
*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 @@
* @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 @@
* @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 @@
* 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 @@
*/
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 @@
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;
Modified: gnunet/src/namestore/namestore_api_monitor.c
===================================================================
--- gnunet/src/namestore/namestore_api_monitor.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/namestore_api_monitor.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -73,7 +73,7 @@
/**
* Monitored zone.
*/
- struct GNUNET_CRYPTO_EccPrivateKey zone;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey zone;
};
@@ -255,7 +255,7 @@
*/
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)
Modified: gnunet/src/namestore/plugin_namestore_postgres.c
===================================================================
--- gnunet/src/namestore/plugin_namestore_postgres.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/plugin_namestore_postgres.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -337,8 +337,8 @@
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_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 @@
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 @@
*/
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 @@
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 @@
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 @@
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 @@
*/
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 @@
*/
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;
Modified: gnunet/src/namestore/plugin_namestore_sqlite.c
===================================================================
--- gnunet/src/namestore/plugin_namestore_sqlite.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/plugin_namestore_sqlite.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -467,15 +467,15 @@
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 @@
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 @@
*/
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 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
*/
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 @@
{
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 @@
*/
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 @@
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,
Modified: gnunet/src/namestore/test_namestore_api_blocks.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_blocks.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/test_namestore_api_blocks.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -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 @@
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";
Modified: gnunet/src/namestore/test_namestore_api_cache_block.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_cache_block.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_cache_block.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -38,9 +38,9 @@
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 @@
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;
Modified: gnunet/src/namestore/test_namestore_api_lookup_public.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_lookup_public.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_lookup_public.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -38,9 +38,9 @@
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 @@
{
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 @@
(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 @@
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;
Modified: gnunet/src/namestore/test_namestore_api_monitoring.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_monitoring.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_monitoring.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -34,9 +34,9 @@
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 @@
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 @@
"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 @@
"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 @@
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);
Modified: gnunet/src/namestore/test_namestore_api_monitoring_existing.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_monitoring_existing.c
2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_monitoring_existing.c
2013-10-10 14:38:55 UTC (rev 30096)
@@ -35,9 +35,9 @@
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 @@
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 @@
"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 @@
"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 @@
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);
Modified: gnunet/src/namestore/test_namestore_api_put.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_put.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/test_namestore_api_put.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -41,9 +41,9 @@
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 @@
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 @@
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 */
Modified: gnunet/src/namestore/test_namestore_api_remove.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/test_namestore_api_remove.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -38,9 +38,9 @@
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 @@
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;
Modified: gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
2013-10-10 14:38:55 UTC (rev 30096)
@@ -38,9 +38,9 @@
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 @@
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);
Modified: gnunet/src/namestore/test_namestore_api_store.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_store.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/test_namestore_api_store.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -38,9 +38,9 @@
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 @@
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;
Modified: gnunet/src/namestore/test_namestore_api_store_update.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_store_update.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_store_update.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -46,9 +46,9 @@
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 @@
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;
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -34,9 +34,9 @@
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 @@
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 @@
}
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 @@
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 @@
*/
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 @@
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);
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
2013-10-10 14:38:55 UTC (rev 30096)
@@ -34,9 +34,9 @@
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 @@
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 @@
}
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 @@
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 @@
*/
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 @@
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);
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
2013-10-10 14:38:55 UTC (rev 30096)
@@ -34,9 +34,9 @@
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 @@
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 @@
}
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 @@
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 @@
*/
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 @@
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);
Modified: gnunet/src/namestore/test_namestore_api_zone_to_name.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_to_name.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/namestore/test_namestore_api_zone_to_name.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -41,9 +41,9 @@
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 char * s_name;
-static struct GNUNET_CRYPTO_EccSignature *s_signature;
+static struct GNUNET_CRYPTO_EcdsaSignature *s_signature;
static int res;
@@ -96,12 +96,12 @@
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 @@
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 @@
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));
Modified: gnunet/src/namestore/test_plugin_namestore.c
===================================================================
--- gnunet/src/namestore/test_plugin_namestore.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/namestore/test_plugin_namestore.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -81,14 +81,14 @@
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 @@
}
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 @@
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),
Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/nse/gnunet-service-nse.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -199,7 +199,7 @@
/**
* Signature (over range specified in purpose).
*/
- struct GNUNET_CRYPTO_EccSignature signature;
+ struct GNUNET_CRYPTO_EddsaSignature signature;
};
GNUNET_NETWORK_STRUCT_END
@@ -288,7 +288,7 @@
/**
* 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 @@
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 @@
* @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 @@
{
#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 @@
}
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 @@
{NULL, 0, 0}
};
char *proof;
- struct GNUNET_CRYPTO_EccPrivateKey *pk;
+ struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
cfg = c;
srv = server;
@@ -1474,10 +1474,10 @@
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))
Modified: gnunet/src/peerinfo/gnunet-service-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-service-peerinfo.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/peerinfo/gnunet-service-peerinfo.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -575,7 +575,7 @@
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 @@
{
struct GNUNET_HELLO_Message * res;
struct GNUNET_HELLO_Message * tmp;
- struct GNUNET_CRYPTO_EccPublicSignKey pk;
+ struct GNUNET_CRYPTO_EddsaPublicKey pk;
if (NULL != friend_hello)
{
Modified: gnunet/src/peerinfo-tool/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo-tool/gnunet-peerinfo.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/peerinfo-tool/gnunet-peerinfo.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -628,7 +628,7 @@
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 @@
"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);
}
Modified: gnunet/src/psycstore/plugin_psycstore_sqlite.c
===================================================================
--- gnunet/src/psycstore/plugin_psycstore_sqlite.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/psycstore/plugin_psycstore_sqlite.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -621,7 +621,7 @@
*/
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 @@
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 @@
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
* @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 @@
*/
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 @@
* @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 @@
* @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 @@
*/
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;
Modified: gnunet/src/psycstore/psycstore.h
===================================================================
--- gnunet/src/psycstore/psycstore.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/psycstore/psycstore.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -144,7 +144,7 @@
*/
uint32_t op_id GNUNET_PACKED;
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
};
@@ -167,12 +167,12 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* Channel's public key.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
struct GNUNET_HashCode hash;
};
@@ -357,7 +357,7 @@
/**
* 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 @@
/**
* Channel's public key.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey channel_key;
+ struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
uint64_t message_id GNUNET_PACKED;
Modified: gnunet/src/psycstore/psycstore_api.c
===================================================================
--- gnunet/src/psycstore/psycstore_api.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/psycstore/psycstore_api.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -655,8 +655,8 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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 @@
*/
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,
Modified: gnunet/src/psycstore/test_plugin_psycstore.c
===================================================================
--- gnunet/src/psycstore/test_plugin_psycstore.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/psycstore/test_plugin_psycstore.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -50,11 +50,11 @@
*/
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 @@
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 @@
- 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;
Modified: gnunet/src/psycstore/test_psycstore.c
===================================================================
--- gnunet/src/psycstore/test_psycstore.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/psycstore/test_psycstore.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -56,11 +56,11 @@
*/
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 @@
- 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 @@
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,
Modified: gnunet/src/regex/gnunet-daemon-regexprofiler.c
===================================================================
--- gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -98,7 +98,7 @@
/**
* 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 @@
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",
Modified: gnunet/src/regex/gnunet-service-regex.c
===================================================================
--- gnunet/src/regex/gnunet-service-regex.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/regex/gnunet-service-regex.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -102,7 +102,7 @@
/**
* 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 @@
{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 ();
Modified: gnunet/src/regex/plugin_block_regex.c
===================================================================
--- gnunet/src/regex/plugin_block_regex.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/regex/plugin_block_regex.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -186,7 +186,7 @@
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))
Modified: gnunet/src/regex/regex_internal_dht.c
===================================================================
--- gnunet/src/regex/regex_internal_dht.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/regex/regex_internal_dht.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -62,7 +62,7 @@
/**
* 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 @@
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 @@
*/
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)
Modified: gnunet/src/regex/regex_internal_lib.h
===================================================================
--- gnunet/src/regex/regex_internal_lib.h 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/regex/regex_internal_lib.h 2013-10-10 14:38:55 UTC (rev
30096)
@@ -182,7 +182,7 @@
*/
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);
Modified: gnunet/src/revocation/gnunet-revocation.c
===================================================================
--- gnunet/src/revocation/gnunet-revocation.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/revocation/gnunet-revocation.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -193,12 +193,12 @@
/**
* 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 @@
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 @@
{
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 @@
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))
{
Modified: gnunet/src/revocation/gnunet-service-revocation.c
===================================================================
--- gnunet/src/revocation/gnunet-service-revocation.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/revocation/gnunet-service-revocation.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -147,7 +147,7 @@
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 @@
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 @@
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 @@
}
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,
Modified: gnunet/src/revocation/revocation.h
===================================================================
--- gnunet/src/revocation/revocation.h 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/revocation/revocation.h 2013-10-10 14:38:55 UTC (rev 30096)
@@ -48,7 +48,7 @@
/**
* Key to check.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey key;
+ struct GNUNET_CRYPTO_EcdsaPublicKey key;
};
@@ -98,7 +98,7 @@
/**
* Signature confirming revocation.
*/
- struct GNUNET_CRYPTO_EccSignature signature;
+ struct GNUNET_CRYPTO_EcdsaSignature signature;
/**
* Must have purpose #GNUNET_SIGNATURE_PURPOSE_REVOCATION,
@@ -109,7 +109,7 @@
/**
* Key to revoke.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey public_key;
+ struct GNUNET_CRYPTO_EcdsaPublicKey public_key;
};
Modified: gnunet/src/revocation/revocation_api.c
===================================================================
--- gnunet/src/revocation/revocation_api.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/revocation/revocation_api.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -49,7 +49,7 @@
/**
* Key to check.
*/
- struct GNUNET_CRYPTO_EccPublicSignKey key;
+ struct GNUNET_CRYPTO_EcdsaPublicKey key;
/**
* Function to call with the result.
@@ -146,7 +146,7 @@
*/
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 @@
/**
* 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 @@
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 @@
*/
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 @@
* @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 @@
* @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));
}
Modified: gnunet/src/testing/gnunet-testing.c
===================================================================
--- gnunet/src/testing/gnunet-testing.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/testing/gnunet-testing.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -164,7 +164,7 @@
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 @@
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);
Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/testing/testing.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -701,12 +701,12 @@
* 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 @@
_("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 @@
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;
Modified: gnunet/src/topology/friends.c
===================================================================
--- gnunet/src/topology/friends.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/topology/friends.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -92,7 +92,7 @@
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 @@
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);
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/transport/gnunet-service-transport.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -70,7 +70,7 @@
/**
* 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 @@
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 @@
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);
Modified: gnunet/src/transport/gnunet-service-transport.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport.h 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/transport/gnunet-service-transport.h 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -55,7 +55,7 @@
/**
* Our private key.
*/
-extern struct GNUNET_CRYPTO_EccPrivateKey *GST_my_private_key;
+extern struct GNUNET_CRYPTO_EddsaPrivateKey *GST_my_private_key;
/**
* ATS handle.
Modified: gnunet/src/transport/gnunet-service-transport_blacklist.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_blacklist.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/transport/gnunet-service-transport_blacklist.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -254,7 +254,7 @@
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;
Modified: gnunet/src/transport/gnunet-service-transport_hello.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_hello.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/transport/gnunet-service-transport_hello.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -74,7 +74,7 @@
/**
* Signature for a 'struct TransportPongMessage' for this address.
*/
- struct GNUNET_CRYPTO_EccSignature pong_signature;
+ struct GNUNET_CRYPTO_EddsaSignature pong_signature;
};
@@ -307,7 +307,7 @@
*/
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;
Modified: gnunet/src/transport/gnunet-service-transport_hello.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_hello.h 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/transport/gnunet-service-transport_hello.h 2013-10-10
14:38:55 UTC (rev 30096)
@@ -93,7 +93,7 @@
*/
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);
Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -329,14 +329,14 @@
/**
* 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 @@
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 @@
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 @@
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 @@
}
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 @@
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))
{
Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/transport/gnunet-service-transport_validation.c 2013-10-10
14:38:55 UTC (rev 30096)
@@ -148,7 +148,7 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
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 @@
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 @@
*/
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 @@
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 @@
{
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 @@
*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 @@
/**
* 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 @@
{
/* 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 @@
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)
Modified: gnunet/src/transport/gnunet-service-transport_validation.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.h 2013-10-10
14:15:33 UTC (rev 30095)
+++ gnunet/src/transport/gnunet-service-transport_validation.h 2013-10-10
14:38:55 UTC (rev 30096)
@@ -134,7 +134,7 @@
*/
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
Modified: gnunet/src/transport/gnunet-transport.c
===================================================================
--- gnunet/src/transport/gnunet-transport.c 2013-10-10 14:15:33 UTC (rev
30095)
+++ gnunet/src/transport/gnunet-transport.c 2013-10-10 14:38:55 UTC (rev
30096)
@@ -809,7 +809,7 @@
}
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)))
{
Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/transport/plugin_transport_http_server.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -1013,7 +1013,7 @@
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))
{
Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c 2013-10-10 14:15:33 UTC
(rev 30095)
+++ gnunet/src/transport/test_plugin_transport.c 2013-10-10 14:38:55 UTC
(rev 30096)
@@ -49,7 +49,7 @@
/**
* 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 @@
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 @@
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);
Modified: gnunet/src/util/Makefile.am
===================================================================
--- gnunet/src/util/Makefile.am 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/util/Makefile.am 2013-10-10 14:38:55 UTC (rev 30096)
@@ -7,7 +7,7 @@
pkgcfgdir= $(pkgdatadir)/config.d/
dist_pkgcfg_DATA = \
- util.conf
+ util.conf
pkgcfg_DATA = \
resolver.conf
@@ -19,7 +19,7 @@
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 @@
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 @@
$(LIBGCRYPT_LIBS) \
$(LTLIBICONV) \
$(LTLIBINTL) \
- -lltdl $(Z_LIBS) -lunistring $(XLIB)
+ -lltdl $(Z_LIBS) -lunistring $(XLIB)
libgnunetutil_la_LDFLAGS = \
$(GN_LIB_LDFLAGS) \
@@ -126,17 +126,17 @@
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_resolver_SOURCES = \
- gnunet-resolver.c
+ gnunet-resolver.c
gnunet_resolver_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(GN_LIBINTL)
@@ -154,7 +154,7 @@
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_config_SOURCES = \
- gnunet-config.c
+ gnunet-config.c
gnunet_config_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(GN_LIBINTL)
@@ -172,7 +172,7 @@
gnunet_uri_SOURCES = \
- gnunet-uri.c
+ gnunet-uri.c
gnunet_uri_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(GN_LIBINTL)
@@ -210,7 +210,9 @@
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_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_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_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_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 @@
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_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 = \
Modified: gnunet/src/util/common_logging.c
===================================================================
--- gnunet/src/util/common_logging.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/util/common_logging.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -1096,7 +1096,7 @@
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 @@
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;
Modified: gnunet/src/util/crypto_ecc.c
===================================================================
--- gnunet/src/util/crypto_ecc.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/util/crypto_ecc.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -188,7 +188,7 @@
* @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;
@@ -218,6 +218,80 @@
/**
+ * 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.
*
@@ -226,9 +300,9 @@
* @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_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;
@@ -257,9 +331,9 @@
* @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_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;
@@ -280,25 +354,56 @@
/**
+ * 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_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;
+
+ 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);
+}
+
+
+/**
* 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_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,35 +416,60 @@
* @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_ecc_public_sign_key_to_string (const struct
GNUNET_CRYPTO_EccPublicSignKey *pub)
+GNUNET_CRYPTO_ecdsa_public_key_to_string (const struct
GNUNET_CRYPTO_EcdsaPublicKey *pub)
{
char *pubkeybuf;
- size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8;
+ size_t keylen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
char *end;
if (keylen % 5 > 0)
@@ -347,7 +477,7 @@
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_EcdsaPublicKey),
pubkeybuf,
keylen);
if (NULL == end)
@@ -361,6 +491,37 @@
/**
+ * Convert a public key to a string.
+ *
+ * @param pub key to convert
+ * @return string representing @a pub
+ */
+char *
+GNUNET_CRYPTO_eddsa_public_key_to_string (const struct
GNUNET_CRYPTO_EddsaPublicKey *pub)
+{
+ char *pubkeybuf;
+ size_t keylen = (sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)) * 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_EddsaPublicKey),
+ pubkeybuf,
+ keylen);
+ if (NULL == end)
+ {
+ GNUNET_free (pubkeybuf);
+ return NULL;
+ }
+ *end = '\0';
+ return pubkeybuf;
+}
+
+
+/**
* Convert a string representing a public key to a public key.
*
* @param enc encoded public key
@@ -369,11 +530,11 @@
* @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,13 +544,42 @@
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;
+}
+
+
+/**
* Convert the given public key from the network format to the
* S-expression that can be used by libgcrypt.
*
@@ -397,7 +587,7 @@
* @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,7 @@
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);
@@ -425,33 +615,143 @@
/**
+ * 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);
+
+ /* 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;
+}
+
+
+/**
* @ingroup crypto
* Clear memory that was used to store a private key.
*
* @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));
+}
+
+
+/**
* Create a new private key. Caller must free return value.
*
* @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;
+ int rc;
+
+ if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL,
"(genkey(ecdsa(curve \"" CURVE "\")))")))
{
LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
@@ -479,26 +779,74 @@
return NULL;
}
gcry_sexp_release (priv_sexp);
- priv = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+ 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_EccPrivateKey *
-GNUNET_CRYPTO_ecc_key_get_anonymous ()
+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_EccPrivateKey anonymous;
+ static struct GNUNET_CRYPTO_EcdsaPrivateKey anonymous;
static int once;
if (once)
@@ -542,10 +890,10 @@
* @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_EddsaPrivateKey *
+GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename)
{
- struct GNUNET_CRYPTO_EccPrivateKey *priv;
+ struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
struct GNUNET_DISK_FileHandle *fd;
unsigned int cnt;
int ec;
@@ -581,7 +929,7 @@
cnt = 0;
while (GNUNET_YES !=
GNUNET_DISK_file_lock (fd, 0,
- sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+ sizeof (struct
GNUNET_CRYPTO_EddsaPrivateKey),
GNUNET_YES))
{
short_wait ();
@@ -595,14 +943,14 @@
}
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_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_EccPrivateKey)))
+ 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;
@@ -620,7 +968,7 @@
{
if (GNUNET_YES !=
GNUNET_DISK_file_lock (fd, 0,
- sizeof (struct GNUNET_CRYPTO_EccPrivateKey),
+ sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey),
GNUNET_NO))
{
if (0 == ++cnt % 60)
@@ -642,7 +990,7 @@
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_EddsaPrivateKey)))
LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
@@ -650,36 +998,190 @@
}
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_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_EccPrivateKey)))
+ 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"),
+ _("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_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;
+ }
+ 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;
+}
+
+
+/**
+ * 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_EcdsaPrivateKey *
+GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename)
+{
+ struct GNUNET_CRYPTO_EcdsaPrivateKey *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_EcdsaPrivateKey),
+ 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_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_EcdsaPrivateKey)))
+ 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_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename);
+ return NULL;
+ }
+ cnt = 0;
+ while (1)
+ {
+ if (GNUNET_YES !=
+ GNUNET_DISK_file_lock (fd, 0,
+ sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
+ 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 key.\n"));
+ ("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_EcdsaPrivateKey)))
+ 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_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_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"),
+ filename, (unsigned int) fs,
+ (unsigned int) sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
+ 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;
}
- 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 @@
* @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 @@
* @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 @@
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,7 @@
* @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;
@@ -774,6 +1276,34 @@
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;
+ int rc;
+
+ GNUNET_CRYPTO_hash (purpose, ntohl (purpose->size), &hc);
+ if (0 != (rc = gcry_sexp_build (&data, NULL,
"(data(flags rfc6979)(hash %s %b))",
"sha512",
sizeof (hc),
@@ -795,9 +1325,9 @@
* @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 @@
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,
@@ -837,6 +1367,56 @@
/**
+ * 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.
*
* @param purpose what is the purpose that the signature should have?
@@ -846,11 +1426,10 @@
* @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,8 @@
}
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);
@@ -890,7 +1469,7 @@
if (0 != rc)
{
LOG (GNUNET_ERROR_TYPE_INFO,
- _("ECC signature verification failed at %s:%d: %s\n"), __FILE__,
+ _("ECDSA signature verification failed at %s:%d: %s\n"), __FILE__,
__LINE__, gcry_strerror (rc));
return GNUNET_SYSERR;
}
@@ -898,7 +1477,69 @@
}
+
/**
+ * 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);
+ 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,
+ _("EdDSA signature verification failed at %s:%d: %s\n"), __FILE__,
+ __LINE__, gcry_strerror (rc));
+ return GNUNET_SYSERR;
+ }
+ return GNUNET_OK;
+}
+
+
+/**
* Convert the given public key from the network format to the
* S-expression that can be used by libgcrypt.
*
@@ -906,7 +1547,7 @@
* @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 @@
/**
- * 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 @@
* @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 @@
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 @@
* @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 @@
* 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_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 @@
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 @@
* @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 @@
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);
}
Modified: gnunet/src/util/gnunet-ecc.c
===================================================================
--- gnunet/src/util/gnunet-ecc.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/util/gnunet-ecc.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -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 @@
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 @@
{
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 @@
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 @@
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);
Modified: gnunet/src/vpn/gnunet-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-vpn.c 2013-10-10 14:15:33 UTC (rev 30095)
+++ gnunet/src/vpn/gnunet-vpn.c 2013-10-10 14:38:55 UTC (rev 30096)
@@ -226,7 +226,7 @@
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))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30096 - in gnunet/src: ats-tool core dns exit fs gns hello identity include mesh namestore nse peerinfo peerinfo-tool psycstore regex revocation testing topology transport util vpn,
gnunet <=