From 9351b1e9bdf2b067b6db06562c26ba658cff42b8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 10 Oct 2013 14:38:55 +0000 Subject: separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA --- src/gns/gns.h | 4 +-- src/gns/gns_api.c | 4 +-- src/gns/gnunet-dns2gns.c | 4 +-- src/gns/gnunet-gns-helper-service-w32.c | 16 +++++----- src/gns/gnunet-gns-proxy.c | 6 ++-- src/gns/gnunet-gns.c | 22 +++++++------- src/gns/gnunet-service-gns.c | 12 ++++---- src/gns/gnunet-service-gns_interceptor.c | 4 +-- src/gns/gnunet-service-gns_interceptor.h | 2 +- src/gns/gnunet-service-gns_resolver.c | 28 ++++++++--------- src/gns/gnunet-service-gns_resolver.h | 4 +-- src/gns/gnunet-service-gns_shorten.c | 24 +++++++-------- src/gns/gnunet-service-gns_shorten.h | 4 +-- src/gns/plugin_block_gns.c | 2 +- src/gns/test_gns_proxy.c | 4 +-- src/gns/test_gns_pseu_shorten.c | 52 ++++++++++++++++---------------- src/gns/test_gns_revocation.c | 18 +++++------ src/gns/test_gns_simple_shorten.c | 42 +++++++++++++------------- src/gns/test_gns_simple_srv_lookup.c | 18 +++++------ src/gns/test_gns_simple_zkey_lookup.c | 18 +++++------ 20 files changed, 144 insertions(+), 144 deletions(-) (limited to 'src/gns') diff --git a/src/gns/gns.h b/src/gns/gns.h index 571b62dc7..17a7c7323 100644 --- a/src/gns/gns.h +++ b/src/gns/gns.h @@ -63,7 +63,7 @@ struct GNUNET_GNS_ClientLookupMessage /** * Zone that is to be used for lookup */ - struct GNUNET_CRYPTO_EccPublicSignKey zone; + struct GNUNET_CRYPTO_EcdsaPublicKey zone; /** * Only check cached results @@ -83,7 +83,7 @@ struct GNUNET_GNS_ClientLookupMessage /** * The key for shorten, if @e have_key is set */ - struct GNUNET_CRYPTO_EccPrivateKey shorten_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_key; /* Followed by the name to look up */ }; diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 75c2f9530..3d58922ad 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c @@ -527,10 +527,10 @@ GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr) struct GNUNET_GNS_LookupRequest* GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, const char *name, - const struct GNUNET_CRYPTO_EccPublicSignKey *zone, + const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, int type, int only_cached, - const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key, GNUNET_GNS_LookupResultProcessor proc, void *proc_cls) { diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 42d5ef0e2..6b7afdb59 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c @@ -143,7 +143,7 @@ static unsigned int listen_port = 53; /** * Which GNS zone do we translate incoming DNS requests to? */ -static struct GNUNET_CRYPTO_EccPublicSignKey my_zone; +static struct GNUNET_CRYPTO_EcdsaPublicKey my_zone; /** * '-z' option with the main zone to use. @@ -741,7 +741,7 @@ run (void *cls, char *const *args, const char *cfgfile, } if ( (NULL == gns_zone_str) || (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_sign_key_from_string (gns_zone_str, + GNUNET_CRYPTO_ecdsa_public_key_from_string (gns_zone_str, strlen (gns_zone_str), &my_zone)) ) { diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c index 26a3f688a..78eb1e0a3 100644 --- a/src/gns/gnunet-gns-helper-service-w32.c +++ b/src/gns/gnunet-gns-helper-service-w32.c @@ -61,9 +61,9 @@ struct request */ static struct GNUNET_GNS_Handle *gns; -static struct GNUNET_CRYPTO_EccPublicSignKey *zone = NULL; +static struct GNUNET_CRYPTO_EcdsaPublicKey *zone = NULL; static struct GNUNET_HashCode user_zone; -struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL; +struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key = NULL; /** @@ -662,8 +662,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, }; char* keyfile; - struct GNUNET_CRYPTO_EccPrivateKey *key = NULL; - struct GNUNET_CRYPTO_EccPublicSignKey pkey; + struct GNUNET_CRYPTO_EcdsaPrivateKey *key = NULL; + struct GNUNET_CRYPTO_EcdsaPublicKey pkey; struct GNUNET_CRYPTO_HashAsciiEncoded zonename; if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", @@ -677,9 +677,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, { if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) { - key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); - GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), + key = GNUNET_CRYPTO_ecdsa_key_create_from_file (keyfile); + GNUNET_CRYPTO_ecdsa_key_get_public (key, &pkey); + GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), &user_zone); GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -700,7 +700,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, { if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) { - shorten_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); + shorten_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (keyfile); } GNUNET_free(keyfile); } diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index a67f7356e..276ea70b0 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -623,12 +623,12 @@ static struct Socks5Request *s5r_tail; /** * The users local GNS master zone */ -static struct GNUNET_CRYPTO_EccPublicSignKey local_gns_zone; +static struct GNUNET_CRYPTO_EcdsaPublicKey local_gns_zone; /** * The users local shorten zone */ -static struct GNUNET_CRYPTO_EccPrivateKey local_shorten_zone; +static struct GNUNET_CRYPTO_EcdsaPrivateKey local_shorten_zone; /** * Is shortening enabled? @@ -2864,7 +2864,7 @@ main (int argc, char *const *argv) &run, NULL)) ? 0 : 1; MHD_destroy_response (curl_failure_response); GNUNET_free_non_null ((char *) argv); - GNUNET_CRYPTO_ecc_key_clear (&local_shorten_zone); + GNUNET_CRYPTO_ecdsa_key_clear (&local_shorten_zone); return ret; } diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index 713f94b92..0a4275f0d 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c @@ -191,8 +191,8 @@ process_lookup_result (void *cls, uint32_t rd_count, * @param shorten_key private key used for shortening, can be NULL */ static void -lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey, - const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key) +lookup_with_keys (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key) { if (NULL != lookup_type) rtype = GNUNET_NAMESTORE_typename_to_number (lookup_type); @@ -238,7 +238,7 @@ identity_shorten_cb (void *cls, void **ctx, const char *name) { - struct GNUNET_CRYPTO_EccPublicSignKey *pkeym = cls; + struct GNUNET_CRYPTO_EcdsaPublicKey *pkeym = cls; id_op = NULL; if (NULL == ego) @@ -257,12 +257,12 @@ identity_shorten_cb (void *cls, * @param pkey public key to use for the zone */ static void -lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey) +lookup_with_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) { - struct GNUNET_CRYPTO_EccPublicSignKey *pkeym; + struct GNUNET_CRYPTO_EcdsaPublicKey *pkeym; GNUNET_assert (NULL != pkey); - pkeym = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey); + pkeym = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey); *pkeym = *pkey; id_op = GNUNET_IDENTITY_get (identity, "gns-short", @@ -287,7 +287,7 @@ static void identity_zone_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) { - struct GNUNET_CRYPTO_EccPublicSignKey pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey pkey; el = NULL; if (NULL == ego) @@ -325,7 +325,7 @@ identity_master_cb (void *cls, void **ctx, const char *name) { - struct GNUNET_CRYPTO_EccPublicSignKey pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey pkey; id_op = NULL; if (NULL == ego) @@ -352,7 +352,7 @@ static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { - struct GNUNET_CRYPTO_EccPublicSignKey pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey pkey; cfg = c; gns = GNUNET_GNS_connect (cfg); @@ -368,7 +368,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL != public_key) { if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_sign_key_from_string (public_key, + GNUNET_CRYPTO_ecdsa_public_key_from_string (public_key, strlen (public_key), &pkey)) { @@ -395,7 +395,7 @@ run (void *cls, char *const *args, const char *cfgfile, &lookup_name[strlen (lookup_name) - 4])) ) { /* no zone required, use 'anonymous' zone */ - GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (), + GNUNET_CRYPTO_ecdsa_key_get_public (GNUNET_CRYPTO_ecdsa_key_get_anonymous (), &pkey); lookup_with_public_key (&pkey); } diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 8fcd75e7c..d3728ee00 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -318,7 +318,7 @@ dht_put_continuation (void *cls, */ static void put_gns_record (void *cls, - const struct GNUNET_CRYPTO_EccPrivateKey *key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, const char *name, unsigned int rd_count, const struct GNUNET_NAMESTORE_RecordData *rd) @@ -414,8 +414,8 @@ put_gns_record (void *cls, rd_public, rd_public_count); block_size = ntohl (block->purpose.size) - + sizeof (struct GNUNET_CRYPTO_EccSignature) - + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); + + sizeof (struct GNUNET_CRYPTO_EcdsaSignature) + + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey); GNUNET_NAMESTORE_query_from_private_key (key, name, &query); @@ -528,7 +528,7 @@ handle_lookup (void *cls, struct ClientLookupHandle *clh; char *nameptr = name; const char *utf_in; - const struct GNUNET_CRYPTO_EccPrivateKey *key; + const struct GNUNET_CRYPTO_EcdsaPrivateKey *key; uint16_t msg_size; const struct GNUNET_GNS_ClientLookupMessage *sh_msg; @@ -630,7 +630,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, { &handle_lookup, NULL, GNUNET_MESSAGE_TYPE_GNS_LOOKUP, 0}, {NULL, NULL, 0, 0} }; - struct GNUNET_CRYPTO_EccPublicSignKey dns_root; + struct GNUNET_CRYPTO_EcdsaPublicKey dns_root; unsigned long long max_parallel_bg_queries = 0; char *dns_root_name; @@ -683,7 +683,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, &dns_root_name)) { if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_sign_key_from_string (dns_root_name, + GNUNET_CRYPTO_ecdsa_public_key_from_string (dns_root_name, strlen (dns_root_name), &dns_root)) { diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c index 8cb1951bf..61568c438 100644 --- a/src/gns/gnunet-service-gns_interceptor.c +++ b/src/gns/gnunet-service-gns_interceptor.c @@ -75,7 +75,7 @@ static struct GNUNET_DNS_Handle *dns_handle; /** * Key of the zone we start lookups in. */ -static struct GNUNET_CRYPTO_EccPublicSignKey zone; +static struct GNUNET_CRYPTO_EcdsaPublicKey zone; /** * Head of the DLL. @@ -353,7 +353,7 @@ handle_dns_request (void *cls, * @return #GNUNET_OK on success */ int -GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone, +GNS_interceptor_init (const struct GNUNET_CRYPTO_EcdsaPublicKey *gnu_zone, const struct GNUNET_CONFIGURATION_Handle *c) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, diff --git a/src/gns/gnunet-service-gns_interceptor.h b/src/gns/gnunet-service-gns_interceptor.h index 509875645..bfcc54017 100644 --- a/src/gns/gnunet-service-gns_interceptor.h +++ b/src/gns/gnunet-service-gns_interceptor.h @@ -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); /** diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 43d50aed5..4b26803ff 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -112,7 +112,7 @@ struct AuthorityChain /** * The zone of the GNS authority */ - struct GNUNET_CRYPTO_EccPublicSignKey gns_authority; + struct GNUNET_CRYPTO_EcdsaPublicKey gns_authority; struct { @@ -230,7 +230,7 @@ struct GNS_ResolverHandle /** * The top-level GNS authoritative zone to query */ - struct GNUNET_CRYPTO_EccPublicSignKey authority_zone; + struct GNUNET_CRYPTO_EcdsaPublicKey authority_zone; /** * called when resolution phase finishes @@ -286,7 +286,7 @@ struct GNS_ResolverHandle /** * Private key of the shorten zone, NULL to not shorten. */ - struct GNUNET_CRYPTO_EccPrivateKey *shorten_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key; /** * ID of a task associated with the resolution process. @@ -1421,9 +1421,9 @@ handle_gns_resolution_result (void *cls, /* tigger shortening */ if (NULL != rh->shorten_key) { - struct GNUNET_CRYPTO_EccPublicSignKey pub; + struct GNUNET_CRYPTO_EcdsaPublicKey pub; - if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) + if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) { GNUNET_break_op (0); break; @@ -1454,7 +1454,7 @@ handle_gns_resolution_result (void *cls, { case GNUNET_NAMESTORE_TYPE_PKEY: /* delegation to another zone */ - if (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != + if (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) != rd[i].data_size) { GNUNET_break_op (0); @@ -1468,7 +1468,7 @@ handle_gns_resolution_result (void *cls, ac->gns_authority = GNUNET_YES; memcpy (&ac->authority_info.gns_authority, rd[i].data, - sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); ac->label = resolver_lookup_get_next_label (rh); /* tigger shortening */ if (NULL != rh->shorten_key) @@ -1719,8 +1719,8 @@ handle_dht_response (void *cls, block = data; if (size != ntohl (block->purpose.size) + - sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + - sizeof (struct GNUNET_CRYPTO_EccSignature)) + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) + + sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) { /* how did this pass DHT block validation!? */ GNUNET_break (0); @@ -1768,7 +1768,7 @@ handle_namestore_block_response (void *cls, struct GNS_ResolverHandle *rx; struct AuthorityChain *ac = rh->ac_tail; const char *label = ac->label; - const struct GNUNET_CRYPTO_EccPublicSignKey *auth = &ac->authority_info.gns_authority; + const struct GNUNET_CRYPTO_EcdsaPublicKey *auth = &ac->authority_info.gns_authority; struct GNUNET_HashCode query; GNUNET_NAMESTORE_query_from_public_key (auth, @@ -1947,7 +1947,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) if ( (NULL == x) || (NULL == y) || (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_sign_key_from_string (pkey, + GNUNET_CRYPTO_ecdsa_public_key_from_string (pkey, strlen (pkey), &rh->authority_zone)) ) { @@ -1995,10 +1995,10 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) * @return handle to cancel operation */ struct GNS_ResolverHandle * -GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, +GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, uint32_t record_type, const char *name, - const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key, int only_cached, GNS_ResultProcessor proc, void *proc_cls) { @@ -2022,7 +2022,7 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, rh->name_resolution_pos = strlen (name); if (NULL != shorten_key) { - rh->shorten_key = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); + rh->shorten_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); *rh->shorten_key = *shorten_key; } start_resolver_lookup (rh); diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h index e9916c778..06273766a 100644 --- a/src/gns/gnunet-service-gns_resolver.h +++ b/src/gns/gnunet-service-gns_resolver.h @@ -83,10 +83,10 @@ typedef void (*GNS_ResultProcessor)(void *cls, * @return handle to cancel operation */ struct GNS_ResolverHandle * -GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, +GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, uint32_t record_type, const char *name, - const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key, int only_cached, GNS_ResultProcessor proc, void *proc_cls); diff --git a/src/gns/gnunet-service-gns_shorten.c b/src/gns/gnunet-service-gns_shorten.c index ff2cab097..f0c96716a 100644 --- a/src/gns/gnunet-service-gns_shorten.c +++ b/src/gns/gnunet-service-gns_shorten.c @@ -65,7 +65,7 @@ struct GetPseuAuthorityHandle * Private key of the (shorten) zone to store the resulting * pseudonym in. */ - struct GNUNET_CRYPTO_EccPrivateKey shorten_zone_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_zone_key; /** * Original label (used if no PSEU record is found). @@ -80,7 +80,7 @@ struct GetPseuAuthorityHandle /** * The zone for which we are trying to find the PSEU record. */ - struct GNUNET_CRYPTO_EccPublicSignKey target_zone; + struct GNUNET_CRYPTO_EcdsaPublicKey target_zone; /** * Handle for DHT lookups. Should be NULL if no lookups are in progress @@ -195,7 +195,7 @@ process_pseu_block_ns (void *cls, const struct GNUNET_NAMESTORE_Block *block) { struct GetPseuAuthorityHandle *gph = cls; - struct GNUNET_CRYPTO_EccPublicSignKey pub; + struct GNUNET_CRYPTO_EcdsaPublicKey pub; gph->namestore_task = NULL; if (NULL == block) @@ -203,7 +203,7 @@ process_pseu_block_ns (void *cls, process_pseu_lookup_ns (gph, 0, NULL); return; } - GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, + GNUNET_CRYPTO_ecdsa_key_get_public (&gph->shorten_zone_key, &pub); if (GNUNET_OK != GNUNET_NAMESTORE_block_decrypt (block, @@ -229,10 +229,10 @@ static void perform_pseu_lookup (struct GetPseuAuthorityHandle *gph, const char *label) { - struct GNUNET_CRYPTO_EccPublicSignKey pub; + struct GNUNET_CRYPTO_EcdsaPublicKey pub; struct GNUNET_HashCode query; - GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, + GNUNET_CRYPTO_ecdsa_key_get_public (&gph->shorten_zone_key, &pub); GNUNET_free_non_null (gph->current_label); gph->current_label = GNUNET_strdup (label); @@ -287,7 +287,7 @@ process_pseu_lookup_ns (void *cls, GNUNET_NAMESTORE_z2s (&gph->target_zone), gph->current_label); new_pkey.expiration_time = UINT64_MAX; - new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); + new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey); new_pkey.data = &gph->target_zone; new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY; new_pkey.flags = GNUNET_NAMESTORE_RF_NONE @@ -437,8 +437,8 @@ process_auth_discovery_dht_result (void* cls, block = data; if (size != ntohl (block->purpose.size) + - sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + - sizeof (struct GNUNET_CRYPTO_EccSignature)) + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) + + sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) { /* how did this pass DHT block validation!? */ GNUNET_break (0); @@ -472,7 +472,7 @@ process_auth_discovery_dht_result (void* cls, */ static void process_zone_to_name_discover (void *cls, - const struct GNUNET_CRYPTO_EccPrivateKey *zone_key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, const char *name, unsigned int rd_len, const struct GNUNET_NAMESTORE_RecordData *rd) @@ -519,8 +519,8 @@ process_zone_to_name_discover (void *cls, */ void GNS_shorten_start (const char *original_label, - const struct GNUNET_CRYPTO_EccPublicSignKey *pub, - const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone) + const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone) { struct GetPseuAuthorityHandle *gph; diff --git a/src/gns/gnunet-service-gns_shorten.h b/src/gns/gnunet-service-gns_shorten.h index ed3bdf11f..5f583eeb5 100644 --- a/src/gns/gnunet-service-gns_shorten.h +++ b/src/gns/gnunet-service-gns_shorten.h @@ -59,8 +59,8 @@ GNS_shorten_done (void); */ void GNS_shorten_start (const char *original_label, - const struct GNUNET_CRYPTO_EccPublicSignKey *pub, - const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone); + const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone); #endif diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c index 932900910..ad2e6594e 100644 --- a/src/gns/plugin_block_gns.c +++ b/src/gns/plugin_block_gns.c @@ -85,7 +85,7 @@ block_plugin_gns_evaluate (void *cls, enum GNUNET_BLOCK_Type type, return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; } block = reply_block; - if (ntohl (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != + if (ntohl (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EcdsaSignature) + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) != reply_block_size) { GNUNET_break_op (0); diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index 8563eda2f..66a2eb091 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c @@ -364,7 +364,7 @@ run (void *cls, struct GNUNET_TESTING_Peer *peer) { enum MHD_FLAG flags; - struct GNUNET_CRYPTO_EccPrivateKey *host_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *host_key; struct GNUNET_NAMESTORE_RecordData rd; char *zone_keyfile; @@ -421,7 +421,7 @@ run (void *cls, return; } - host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); + host_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (zone_keyfile); rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_DNSPARSER_TYPE_A, "127.0.0.1", diff --git a/src/gns/test_gns_pseu_shorten.c b/src/gns/test_gns_pseu_shorten.c index a4c337067..f4c628cb0 100644 --- a/src/gns/test_gns_pseu_shorten.c +++ b/src/gns/test_gns_pseu_shorten.c @@ -69,16 +69,16 @@ static struct GNUNET_DHT_Handle *dht_handle; static const struct GNUNET_CONFIGURATION_Handle *cfg; -static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; -static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; -static struct GNUNET_CRYPTO_EccPublicSignKey our_pkey; -static struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey; -static struct GNUNET_CRYPTO_EccPublicSignKey short_pkey; -static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; -static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; -static struct GNUNET_CRYPTO_EccPrivateKey *our_key; -static struct GNUNET_CRYPTO_EccPrivateKey *priv_key; -static struct GNUNET_CRYPTO_EccPrivateKey *short_key; +static struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey; +static struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey; +static struct GNUNET_CRYPTO_EcdsaPublicKey our_pkey; +static struct GNUNET_CRYPTO_EcdsaPublicKey priv_pkey; +static struct GNUNET_CRYPTO_EcdsaPublicKey short_pkey; +static struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key; +static struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key; +static struct GNUNET_CRYPTO_EcdsaPrivateKey *our_key; +static struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; +static struct GNUNET_CRYPTO_EcdsaPrivateKey *short_key; static struct GNUNET_CRYPTO_ShortHashCode alice_hash; static struct GNUNET_CRYPTO_ShortHashCode bob_hash; static struct GNUNET_CRYPTO_ShortHashCode our_zone; @@ -265,7 +265,7 @@ put_pseu_dht (void *cls, int success) struct GNUNET_HashCode zone_hash_double; uint32_t rd_payload_length; char* nrb_data = NULL; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaSignature *sig; struct GNUNET_NAMESTORE_RecordData rd; memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData)); @@ -316,7 +316,7 @@ put_pseu_dht (void *cls, int success) } GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash); GNUNET_CRYPTO_short_hash(&alice_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -353,7 +353,7 @@ put_www_dht (void *cls, int success) struct GNUNET_HashCode zone_hash_double; uint32_t rd_payload_length; char* nrb_data = NULL; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaSignature *sig; struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); @@ -405,7 +405,7 @@ put_www_dht (void *cls, int success) } GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); GNUNET_CRYPTO_short_hash(&alice_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -441,7 +441,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg) struct GNUNET_HashCode zone_hash_double; uint32_t rd_payload_length; char* nrb_data = NULL; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaSignature *sig; struct GNUNET_NAMESTORE_RecordData rd; rd.expiration_time = UINT64_MAX; @@ -488,7 +488,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg) GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE, strlen (TEST_AUTHORITY_ALICE), &name_hash); GNUNET_CRYPTO_short_hash (&bob_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -616,21 +616,21 @@ do_check (void *cls, GNUNET_free (private_keyfile); return; } - our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile); - priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile); - short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile); - bob_key = GNUNET_CRYPTO_ecc_key_create (); - alice_key = GNUNET_CRYPTO_ecc_key_create (); + our_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (our_keyfile); + priv_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (private_keyfile); + short_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (shorten_keyfile); + bob_key = GNUNET_CRYPTO_ecdsa_key_create (); + alice_key = GNUNET_CRYPTO_ecdsa_key_create (); GNUNET_free (our_keyfile); GNUNET_free (shorten_keyfile); GNUNET_free (private_keyfile); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (our_key, &our_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &priv_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (short_key, &short_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey); GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); GNUNET_CRYPTO_short_hash (&alice_pkey, sizeof(alice_pkey), &alice_hash); GNUNET_CRYPTO_short_hash (&our_pkey, sizeof(our_pkey), &our_zone); diff --git a/src/gns/test_gns_revocation.c b/src/gns/test_gns_revocation.c index 30fe5eb66..5be15759a 100644 --- a/src/gns/test_gns_revocation.c +++ b/src/gns/test_gns_revocation.c @@ -181,12 +181,12 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; - struct GNUNET_CRYPTO_EccPrivateKey *alice_key; - struct GNUNET_CRYPTO_EccPrivateKey *bob_key; + struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey; + struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaSignature *sig; char* alice_keyfile; cfg = ccfg; @@ -210,11 +210,11 @@ do_check (void *cls, return; } - alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); - bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); + alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (alice_keyfile); + bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; diff --git a/src/gns/test_gns_simple_shorten.c b/src/gns/test_gns_simple_shorten.c index 1b383a0bd..a4cfa26dc 100644 --- a/src/gns/test_gns_simple_shorten.c +++ b/src/gns/test_gns_simple_shorten.c @@ -61,10 +61,10 @@ static struct GNUNET_GNS_Handle *gns_handle; const struct GNUNET_CONFIGURATION_Handle *cfg; -struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey; -struct GNUNET_CRYPTO_EccPublicSignKey short_pkey; -struct GNUNET_CRYPTO_EccPrivateKey *priv_key; -struct GNUNET_CRYPTO_EccPrivateKey *short_key; +struct GNUNET_CRYPTO_EcdsaPublicKey priv_pkey; +struct GNUNET_CRYPTO_EcdsaPublicKey short_pkey; +struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; +struct GNUNET_CRYPTO_EcdsaPrivateKey *short_key; struct GNUNET_CRYPTO_ShortHashCode priv_zone; struct GNUNET_CRYPTO_ShortHashCode short_zone; @@ -170,15 +170,15 @@ void do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicSignKey our_pkey; - struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; - struct GNUNET_CRYPTO_EccPrivateKey *our_key; - struct GNUNET_CRYPTO_EccPrivateKey *alice_key; - struct GNUNET_CRYPTO_EccPrivateKey *bob_key; + struct GNUNET_CRYPTO_EcdsaPublicKey our_pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey; + struct GNUNET_CRYPTO_EcdsaPrivateKey *our_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; struct GNUNET_CRYPTO_ShortHashCode alice_hash; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaSignature *sig; char* our_keyfile; char* private_keyfile; char* shorten_keyfile; @@ -226,22 +226,22 @@ void do_check (void *cls, return; } - our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile); + our_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (our_keyfile); GNUNET_free(our_keyfile); - bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_ALICE); - priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile); - short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile); + bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB); + alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_ALICE); + priv_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (private_keyfile); + short_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (shorten_keyfile); GNUNET_free(shorten_keyfile); GNUNET_free(private_keyfile); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (our_key, &our_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &priv_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (short_key, &short_pkey); GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone); GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone); diff --git a/src/gns/test_gns_simple_srv_lookup.c b/src/gns/test_gns_simple_srv_lookup.c index 76e564f41..f31ae6daa 100644 --- a/src/gns/test_gns_simple_srv_lookup.c +++ b/src/gns/test_gns_simple_srv_lookup.c @@ -182,12 +182,12 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; - struct GNUNET_CRYPTO_EccPrivateKey *alice_key; - struct GNUNET_CRYPTO_EccPrivateKey *bob_key; + struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey; + struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaSignature *sig; char* alice_keyfile; struct GNUNET_TUN_DnsSrvRecord *srv_data; struct GNUNET_TIME_Absolute et; @@ -213,11 +213,11 @@ do_check (void *cls, return; } - alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); - bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); + alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (alice_keyfile); + bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; diff --git a/src/gns/test_gns_simple_zkey_lookup.c b/src/gns/test_gns_simple_zkey_lookup.c index 52a550ebf..a808d2d9d 100644 --- a/src/gns/test_gns_simple_zkey_lookup.c +++ b/src/gns/test_gns_simple_zkey_lookup.c @@ -199,11 +199,11 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; - struct GNUNET_CRYPTO_EccPrivateKey *alice_key; - struct GNUNET_CRYPTO_EccPrivateKey *bob_key; - struct GNUNET_CRYPTO_EccSignature *sig; + struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey; + struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey; + struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key; + struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key; + struct GNUNET_CRYPTO_EcdsaSignature *sig; char* alice_keyfile; cfg = ccfg; @@ -227,11 +227,11 @@ do_check (void *cls, return; } - alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); - bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); + alice_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (alice_keyfile); + bob_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; -- cgit v1.2.3