diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-10 14:38:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-10 14:38:55 +0000 |
commit | 9351b1e9bdf2b067b6db06562c26ba658cff42b8 (patch) | |
tree | 68dc4ab447e7e8b6a20a706858cd36238c1c7c5f /src/namestore/test_namestore_api_zone_to_name.c | |
parent | 8beabcd96c0cf1e1873c0b5ff96e537f1beb0b34 (diff) | |
download | gnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.tar.gz gnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.zip |
separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA
Diffstat (limited to 'src/namestore/test_namestore_api_zone_to_name.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_to_name.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index 1eeed1001..973cc18a0 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -41,9 +41,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
41 | 41 | ||
42 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 42 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; | 44 | static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; | 46 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; |
47 | 47 | ||
48 | static struct GNUNET_TIME_Absolute expire; | 48 | static struct GNUNET_TIME_Absolute expire; |
49 | 49 | ||
@@ -53,7 +53,7 @@ static struct GNUNET_CRYPTO_ShortHashCode s_zone_value; | |||
53 | 53 | ||
54 | static char * s_name; | 54 | static char * s_name; |
55 | 55 | ||
56 | static struct GNUNET_CRYPTO_EccSignature *s_signature; | 56 | static struct GNUNET_CRYPTO_EcdsaSignature *s_signature; |
57 | 57 | ||
58 | static int res; | 58 | static int res; |
59 | 59 | ||
@@ -96,12 +96,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
96 | 96 | ||
97 | static void | 97 | static void |
98 | zone_to_name_proc (void *cls, | 98 | zone_to_name_proc (void *cls, |
99 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, | 99 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, |
100 | struct GNUNET_TIME_Absolute expire, | 100 | struct GNUNET_TIME_Absolute expire, |
101 | const char *n, | 101 | const char *n, |
102 | unsigned int rd_count, | 102 | unsigned int rd_count, |
103 | const struct GNUNET_NAMESTORE_RecordData *rd, | 103 | const struct GNUNET_NAMESTORE_RecordData *rd, |
104 | const struct GNUNET_CRYPTO_EccSignature *signature) | 104 | const struct GNUNET_CRYPTO_EcdsaSignature *signature) |
105 | { | 105 | { |
106 | int fail = GNUNET_NO; | 106 | int fail = GNUNET_NO; |
107 | 107 | ||
@@ -123,7 +123,7 @@ zone_to_name_proc (void *cls, | |||
123 | fail = GNUNET_YES; | 123 | fail = GNUNET_YES; |
124 | GNUNET_break (0); | 124 | GNUNET_break (0); |
125 | } | 125 | } |
126 | if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))) | 126 | if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))) |
127 | { | 127 | { |
128 | fail = GNUNET_YES; | 128 | fail = GNUNET_YES; |
129 | GNUNET_break (0); | 129 | GNUNET_break (0); |
@@ -173,14 +173,14 @@ run (void *cls, | |||
173 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 173 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
174 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 174 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
175 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 175 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
176 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); | 176 | privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file); |
177 | GNUNET_free (hostkey_file); | 177 | GNUNET_free (hostkey_file); |
178 | GNUNET_assert (privkey != NULL); | 178 | GNUNET_assert (privkey != NULL); |
179 | /* get public key */ | 179 | /* get public key */ |
180 | GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey); | 180 | GNUNET_CRYPTO_ecdsa_key_get_public(privkey, &pubkey); |
181 | 181 | ||
182 | /* zone hash */ | 182 | /* zone hash */ |
183 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &s_zone); | 183 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), &s_zone); |
184 | GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); | 184 | GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); |
185 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); | 185 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); |
186 | 186 | ||