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/gnunet-service-gns_shorten.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/gns/gnunet-service-gns_shorten.c') 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; -- cgit v1.2.3