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/fs | |
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/fs')
-rw-r--r-- | src/fs/fs_api.c | 6 | ||||
-rw-r--r-- | src/fs/fs_api.h | 36 | ||||
-rw-r--r-- | src/fs/fs_namespace.c | 18 | ||||
-rw-r--r-- | src/fs/fs_publish.c | 4 | ||||
-rw-r--r-- | src/fs/fs_publish_ksk.c | 2 | ||||
-rw-r--r-- | src/fs/fs_publish_ublock.c | 20 | ||||
-rw-r--r-- | src/fs/fs_publish_ublock.h | 4 | ||||
-rw-r--r-- | src/fs/fs_search.c | 28 | ||||
-rw-r--r-- | src/fs/fs_unindex.c | 16 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 40 | ||||
-rw-r--r-- | src/fs/gnunet-publish.c | 4 | ||||
-rw-r--r-- | src/fs/plugin_block_fs.c | 4 | ||||
-rw-r--r-- | src/fs/test_fs_namespace.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_namespace_list_updateable.c | 4 | ||||
-rw-r--r-- | src/fs/test_fs_uri.c | 8 |
15 files changed, 103 insertions, 103 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 04057bc98..688bdf282 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -1477,7 +1477,7 @@ deserialize_publish_file (void *cls, const char *filename) | |||
1477 | int32_t all_done; | 1477 | int32_t all_done; |
1478 | int32_t have_ns; | 1478 | int32_t have_ns; |
1479 | char *fi_root; | 1479 | char *fi_root; |
1480 | struct GNUNET_CRYPTO_EccPrivateKey ns; | 1480 | struct GNUNET_CRYPTO_EcdsaPrivateKey ns; |
1481 | char *fi_pos; | 1481 | char *fi_pos; |
1482 | char *emsg; | 1482 | char *emsg; |
1483 | 1483 | ||
@@ -1522,7 +1522,7 @@ deserialize_publish_file (void *cls, const char *filename) | |||
1522 | } | 1522 | } |
1523 | if (GNUNET_YES == have_ns) | 1523 | if (GNUNET_YES == have_ns) |
1524 | { | 1524 | { |
1525 | pc->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); | 1525 | pc->ns = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); |
1526 | *pc->ns = ns; | 1526 | *pc->ns = ns; |
1527 | } | 1527 | } |
1528 | if ((0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) && | 1528 | if ((0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) && |
@@ -1637,7 +1637,7 @@ GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc) | |||
1637 | ( (NULL != pc->ns) && | 1637 | ( (NULL != pc->ns) && |
1638 | (GNUNET_OK != GNUNET_BIO_write (wh, | 1638 | (GNUNET_OK != GNUNET_BIO_write (wh, |
1639 | pc->ns, | 1639 | pc->ns, |
1640 | sizeof (struct GNUNET_CRYPTO_EccPrivateKey)) ) )) | 1640 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)) ) )) |
1641 | { | 1641 | { |
1642 | GNUNET_break (0); | 1642 | GNUNET_break (0); |
1643 | goto cleanup; | 1643 | goto cleanup; |
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index 5858c916c..4b0965f15 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h | |||
@@ -128,10 +128,10 @@ struct Location | |||
128 | struct GNUNET_TIME_Absolute expirationTime; | 128 | struct GNUNET_TIME_Absolute expirationTime; |
129 | 129 | ||
130 | /** | 130 | /** |
131 | * RSA signature over the GNUNET_EC_FileIdentifier, | 131 | * Signature over the GNUNET_EC_FileIdentifier, |
132 | * GNUNET_hash of the peer and expiration time. | 132 | * peer identity and expiration time. |
133 | */ | 133 | */ |
134 | struct GNUNET_CRYPTO_EccSignature contentSignature; | 134 | struct GNUNET_CRYPTO_EddsaSignature contentSignature; |
135 | 135 | ||
136 | }; | 136 | }; |
137 | 137 | ||
@@ -140,24 +140,24 @@ struct Location | |||
140 | */ | 140 | */ |
141 | enum GNUNET_FS_UriType | 141 | enum GNUNET_FS_UriType |
142 | { | 142 | { |
143 | /** | 143 | /** |
144 | * Content-hash-key (simple file). | 144 | * Content-hash-key (simple file). |
145 | */ | 145 | */ |
146 | GNUNET_FS_URI_CHK, | 146 | GNUNET_FS_URI_CHK, |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * Signed key space (file in namespace). | 149 | * Signed key space (file in namespace). |
150 | */ | 150 | */ |
151 | GNUNET_FS_URI_SKS, | 151 | GNUNET_FS_URI_SKS, |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * Keyword search key (query with keywords). | 154 | * Keyword search key (query with keywords). |
155 | */ | 155 | */ |
156 | GNUNET_FS_URI_KSK, | 156 | GNUNET_FS_URI_KSK, |
157 | 157 | ||
158 | /** | 158 | /** |
159 | * Location (chk with identity of hosting peer). | 159 | * Location (chk with identity of hosting peer). |
160 | */ | 160 | */ |
161 | GNUNET_FS_URI_LOC | 161 | GNUNET_FS_URI_LOC |
162 | }; | 162 | }; |
163 | 163 | ||
@@ -198,7 +198,7 @@ struct GNUNET_FS_Uri | |||
198 | /** | 198 | /** |
199 | * Identifier of the namespace. | 199 | * Identifier of the namespace. |
200 | */ | 200 | */ |
201 | struct GNUNET_CRYPTO_EccPublicSignKey ns; | 201 | struct GNUNET_CRYPTO_EcdsaPublicKey ns; |
202 | 202 | ||
203 | /** | 203 | /** |
204 | * Human-readable identifier chosen for this entry in the | 204 | * Human-readable identifier chosen for this entry in the |
@@ -1171,7 +1171,7 @@ struct GNUNET_FS_PublishContext | |||
1171 | /** | 1171 | /** |
1172 | * Namespace that we are publishing in, NULL if we have no namespace. | 1172 | * Namespace that we are publishing in, NULL if we have no namespace. |
1173 | */ | 1173 | */ |
1174 | struct GNUNET_CRYPTO_EccPrivateKey *ns; | 1174 | struct GNUNET_CRYPTO_EcdsaPrivateKey *ns; |
1175 | 1175 | ||
1176 | /** | 1176 | /** |
1177 | * ID of the content in the namespace, NULL if we have no namespace. | 1177 | * ID of the content in the namespace, NULL if we have no namespace. |
@@ -1461,7 +1461,7 @@ struct SearchRequestEntry | |||
1461 | /** | 1461 | /** |
1462 | * Derived public key, hashes to 'uquery'. | 1462 | * Derived public key, hashes to 'uquery'. |
1463 | */ | 1463 | */ |
1464 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; | 1464 | struct GNUNET_CRYPTO_EcdsaPublicKey dpub; |
1465 | 1465 | ||
1466 | /** | 1466 | /** |
1467 | * The original keyword, used to derive the | 1467 | * The original keyword, used to derive the |
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index f4cd82978..39bb39701 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c | |||
@@ -92,7 +92,7 @@ struct GNUNET_FS_UpdateInformationGraph | |||
92 | /** | 92 | /** |
93 | * Private key for the namespace. | 93 | * Private key for the namespace. |
94 | */ | 94 | */ |
95 | struct GNUNET_CRYPTO_EccPrivateKey ns; | 95 | struct GNUNET_CRYPTO_EcdsaPrivateKey ns; |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Hash map mapping identifiers of update nodes | 98 | * Hash map mapping identifiers of update nodes |
@@ -127,11 +127,11 @@ struct GNUNET_FS_UpdateInformationGraph | |||
127 | */ | 127 | */ |
128 | static char * | 128 | static char * |
129 | get_update_information_directory (struct GNUNET_FS_Handle *h, | 129 | get_update_information_directory (struct GNUNET_FS_Handle *h, |
130 | const struct GNUNET_CRYPTO_EccPrivateKey *ns) | 130 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns) |
131 | { | 131 | { |
132 | char *dn; | 132 | char *dn; |
133 | char *ret; | 133 | char *ret; |
134 | struct GNUNET_CRYPTO_EccPublicSignKey pub; | 134 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
135 | struct GNUNET_HashCode hc; | 135 | struct GNUNET_HashCode hc; |
136 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; | 136 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; |
137 | 137 | ||
@@ -143,7 +143,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h, | |||
143 | "fs", "UPDATE_DIR"); | 143 | "fs", "UPDATE_DIR"); |
144 | return NULL; | 144 | return NULL; |
145 | } | 145 | } |
146 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &pub); | 146 | GNUNET_CRYPTO_ecdsa_key_get_public (ns, &pub); |
147 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); | 147 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); |
148 | GNUNET_CRYPTO_hash_to_enc (&hc, | 148 | GNUNET_CRYPTO_hash_to_enc (&hc, |
149 | &enc); | 149 | &enc); |
@@ -241,7 +241,7 @@ END: | |||
241 | */ | 241 | */ |
242 | static struct GNUNET_FS_UpdateInformationGraph * | 242 | static struct GNUNET_FS_UpdateInformationGraph * |
243 | read_update_information_graph (struct GNUNET_FS_Handle *h, | 243 | read_update_information_graph (struct GNUNET_FS_Handle *h, |
244 | const struct GNUNET_CRYPTO_EccPrivateKey *ns) | 244 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns) |
245 | { | 245 | { |
246 | struct GNUNET_FS_UpdateInformationGraph *uig; | 246 | struct GNUNET_FS_UpdateInformationGraph *uig; |
247 | char *fn; | 247 | char *fn; |
@@ -346,7 +346,7 @@ struct GNUNET_FS_PublishSksContext | |||
346 | /** | 346 | /** |
347 | * Namespace we're publishing to. | 347 | * Namespace we're publishing to. |
348 | */ | 348 | */ |
349 | struct GNUNET_CRYPTO_EccPrivateKey ns; | 349 | struct GNUNET_CRYPTO_EcdsaPrivateKey ns; |
350 | 350 | ||
351 | /** | 351 | /** |
352 | * Handle to the datastore. | 352 | * Handle to the datastore. |
@@ -434,7 +434,7 @@ sks_publish_cont (void *cls, | |||
434 | */ | 434 | */ |
435 | struct GNUNET_FS_PublishSksContext * | 435 | struct GNUNET_FS_PublishSksContext * |
436 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | 436 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, |
437 | const struct GNUNET_CRYPTO_EccPrivateKey *ns, | 437 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
438 | const char *identifier, const char *update, | 438 | const char *identifier, const char *update, |
439 | const struct GNUNET_CONTAINER_MetaData *meta, | 439 | const struct GNUNET_CONTAINER_MetaData *meta, |
440 | const struct GNUNET_FS_Uri *uri, | 440 | const struct GNUNET_FS_Uri *uri, |
@@ -448,7 +448,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
448 | sks_uri = GNUNET_new (struct GNUNET_FS_Uri); | 448 | sks_uri = GNUNET_new (struct GNUNET_FS_Uri); |
449 | sks_uri->type = GNUNET_FS_URI_SKS; | 449 | sks_uri->type = GNUNET_FS_URI_SKS; |
450 | sks_uri->data.sks.identifier = GNUNET_strdup (identifier); | 450 | sks_uri->data.sks.identifier = GNUNET_strdup (identifier); |
451 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, | 451 | GNUNET_CRYPTO_ecdsa_key_get_public (ns, |
452 | &sks_uri->data.sks.ns); | 452 | &sks_uri->data.sks.ns); |
453 | 453 | ||
454 | psc = GNUNET_new (struct GNUNET_FS_PublishSksContext); | 454 | psc = GNUNET_new (struct GNUNET_FS_PublishSksContext); |
@@ -679,7 +679,7 @@ find_trees (void *cls, | |||
679 | */ | 679 | */ |
680 | void | 680 | void |
681 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h, | 681 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h, |
682 | const struct GNUNET_CRYPTO_EccPrivateKey *ns, | 682 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
683 | const char *next_id, | 683 | const char *next_id, |
684 | GNUNET_FS_IdentifierProcessor ip, | 684 | GNUNET_FS_IdentifierProcessor ip, |
685 | void *ip_cls) | 685 | void *ip_cls) |
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 387ede6a1..05645f0ab 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -1152,7 +1152,7 @@ finish_reserve (void *cls, int success, | |||
1152 | struct GNUNET_FS_PublishContext * | 1152 | struct GNUNET_FS_PublishContext * |
1153 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | 1153 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, |
1154 | struct GNUNET_FS_FileInformation *fi, | 1154 | struct GNUNET_FS_FileInformation *fi, |
1155 | const struct GNUNET_CRYPTO_EccPrivateKey *ns, | 1155 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
1156 | const char *nid, | 1156 | const char *nid, |
1157 | const char *nuid, | 1157 | const char *nuid, |
1158 | enum GNUNET_FS_PublishOptions options) | 1158 | enum GNUNET_FS_PublishOptions options) |
@@ -1177,7 +1177,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | |||
1177 | ret->fi = fi; | 1177 | ret->fi = fi; |
1178 | if (NULL != ns) | 1178 | if (NULL != ns) |
1179 | { | 1179 | { |
1180 | ret->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); | 1180 | ret->ns = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); |
1181 | *ret->ns = *ns; | 1181 | *ret->ns = *ns; |
1182 | GNUNET_assert (NULL != nid); | 1182 | GNUNET_assert (NULL != nid); |
1183 | ret->nid = GNUNET_strdup (nid); | 1183 | ret->nid = GNUNET_strdup (nid); |
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c index 6aac94011..67157f408 100644 --- a/src/fs/fs_publish_ksk.c +++ b/src/fs/fs_publish_ksk.c | |||
@@ -170,7 +170,7 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
170 | pkc->dsh, | 170 | pkc->dsh, |
171 | keyword + 1 /* skip '+' */, | 171 | keyword + 1 /* skip '+' */, |
172 | NULL, | 172 | NULL, |
173 | GNUNET_CRYPTO_ecc_key_get_anonymous (), | 173 | GNUNET_CRYPTO_ecdsa_key_get_anonymous (), |
174 | pkc->meta, | 174 | pkc->meta, |
175 | pkc->uri, | 175 | pkc->uri, |
176 | &pkc->bo, | 176 | &pkc->bo, |
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c index 18f4804d1..791366073 100644 --- a/src/fs/fs_publish_ublock.c +++ b/src/fs/fs_publish_ublock.c | |||
@@ -46,7 +46,7 @@ static void | |||
46 | derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey, | 46 | derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey, |
47 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, | 47 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
48 | const char *label, | 48 | const char *label, |
49 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub) | 49 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub) |
50 | { | 50 | { |
51 | struct GNUNET_HashCode key; | 51 | struct GNUNET_HashCode key; |
52 | 52 | ||
@@ -73,7 +73,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_SymmetricSessionKey *skey, | |||
73 | void | 73 | void |
74 | GNUNET_FS_ublock_decrypt_ (const void *input, | 74 | GNUNET_FS_ublock_decrypt_ (const void *input, |
75 | size_t input_len, | 75 | size_t input_len, |
76 | const struct GNUNET_CRYPTO_EccPublicSignKey *ns, | 76 | const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, |
77 | const char *label, | 77 | const char *label, |
78 | void *output) | 78 | void *output) |
79 | { | 79 | { |
@@ -158,7 +158,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
158 | struct GNUNET_DATASTORE_Handle *dsh, | 158 | struct GNUNET_DATASTORE_Handle *dsh, |
159 | const char *label, | 159 | const char *label, |
160 | const char *ulabel, | 160 | const char *ulabel, |
161 | const struct GNUNET_CRYPTO_EccPrivateKey *ns, | 161 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
162 | const struct GNUNET_CONTAINER_MetaData *meta, | 162 | const struct GNUNET_CONTAINER_MetaData *meta, |
163 | const struct GNUNET_FS_Uri *uri, | 163 | const struct GNUNET_FS_Uri *uri, |
164 | const struct GNUNET_FS_BlockOptions *bo, | 164 | const struct GNUNET_FS_BlockOptions *bo, |
@@ -169,8 +169,8 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
169 | struct GNUNET_HashCode query; | 169 | struct GNUNET_HashCode query; |
170 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 170 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
171 | struct GNUNET_CRYPTO_SymmetricSessionKey skey; | 171 | struct GNUNET_CRYPTO_SymmetricSessionKey skey; |
172 | struct GNUNET_CRYPTO_EccPrivateKey *nsd; | 172 | struct GNUNET_CRYPTO_EcdsaPrivateKey *nsd; |
173 | struct GNUNET_CRYPTO_EccPublicSignKey pub; | 173 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
174 | char *uris; | 174 | char *uris; |
175 | size_t size; | 175 | size_t size; |
176 | char *kbe; | 176 | char *kbe; |
@@ -225,7 +225,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
225 | "Publishing under identifier `%s'\n", | 225 | "Publishing under identifier `%s'\n", |
226 | label); | 226 | label); |
227 | /* get public key of the namespace */ | 227 | /* get public key of the namespace */ |
228 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, | 228 | GNUNET_CRYPTO_ecdsa_key_get_public (ns, |
229 | &pub); | 229 | &pub); |
230 | derive_ublock_encryption_key (&skey, &iv, | 230 | derive_ublock_encryption_key (&skey, &iv, |
231 | label, &pub); | 231 | label, &pub); |
@@ -238,15 +238,15 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
238 | &ub_enc[1]); | 238 | &ub_enc[1]); |
239 | ub_enc->purpose.size = htonl (ulen + slen + mdsize + | 239 | ub_enc->purpose.size = htonl (ulen + slen + mdsize + |
240 | sizeof (struct UBlock) | 240 | sizeof (struct UBlock) |
241 | - sizeof (struct GNUNET_CRYPTO_EccSignature)); | 241 | - sizeof (struct GNUNET_CRYPTO_EcdsaSignature)); |
242 | ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); | 242 | ub_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK); |
243 | 243 | ||
244 | /* derive signing-key from 'label' and public key of the namespace */ | 244 | /* derive signing-key from 'label' and public key of the namespace */ |
245 | nsd = GNUNET_CRYPTO_ecc_key_derive (ns, label, "fs-ublock"); | 245 | nsd = GNUNET_CRYPTO_ecdsa_private_key_derive (ns, label, "fs-ublock"); |
246 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (nsd, | 246 | GNUNET_CRYPTO_ecdsa_key_get_public (nsd, |
247 | &ub_enc->verification_key); | 247 | &ub_enc->verification_key); |
248 | GNUNET_assert (GNUNET_OK == | 248 | GNUNET_assert (GNUNET_OK == |
249 | GNUNET_CRYPTO_ecc_sign (nsd, | 249 | GNUNET_CRYPTO_ecdsa_sign (nsd, |
250 | &ub_enc->purpose, | 250 | &ub_enc->purpose, |
251 | &ub_enc->signature)); | 251 | &ub_enc->signature)); |
252 | GNUNET_CRYPTO_hash (&ub_enc->verification_key, | 252 | GNUNET_CRYPTO_hash (&ub_enc->verification_key, |
diff --git a/src/fs/fs_publish_ublock.h b/src/fs/fs_publish_ublock.h index ed8d599a8..0b22366d5 100644 --- a/src/fs/fs_publish_ublock.h +++ b/src/fs/fs_publish_ublock.h | |||
@@ -46,7 +46,7 @@ | |||
46 | void | 46 | void |
47 | GNUNET_FS_ublock_decrypt_ (const void *input, | 47 | GNUNET_FS_ublock_decrypt_ (const void *input, |
48 | size_t input_len, | 48 | size_t input_len, |
49 | const struct GNUNET_CRYPTO_EccPublicSignKey *ns, | 49 | const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, |
50 | const char *label, | 50 | const char *label, |
51 | void *output); | 51 | void *output); |
52 | 52 | ||
@@ -89,7 +89,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
89 | struct GNUNET_DATASTORE_Handle *dsh, | 89 | struct GNUNET_DATASTORE_Handle *dsh, |
90 | const char *label, | 90 | const char *label, |
91 | const char *ulabel, | 91 | const char *ulabel, |
92 | const struct GNUNET_CRYPTO_EccPrivateKey *ns, | 92 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
93 | const struct GNUNET_CONTAINER_MetaData *meta, | 93 | const struct GNUNET_CONTAINER_MetaData *meta, |
94 | const struct GNUNET_FS_Uri *uri, | 94 | const struct GNUNET_FS_Uri *uri, |
95 | const struct GNUNET_FS_BlockOptions *bo, | 95 | const struct GNUNET_FS_BlockOptions *bo, |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 11af03646..bc3561856 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -679,20 +679,20 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update, | |||
679 | */ | 679 | */ |
680 | static int | 680 | static int |
681 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | 681 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, |
682 | const struct GNUNET_CRYPTO_EccPublicSignKey *dpub, | 682 | const struct GNUNET_CRYPTO_EcdsaPublicKey *dpub, |
683 | const void *edata, | 683 | const void *edata, |
684 | size_t edata_size, | 684 | size_t edata_size, |
685 | char *data) | 685 | char *data) |
686 | { | 686 | { |
687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 687 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon; |
688 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; | 688 | struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub; |
689 | unsigned int i; | 689 | unsigned int i; |
690 | 690 | ||
691 | /* find key */ | 691 | /* find key */ |
692 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) | 692 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) |
693 | if (0 == memcmp (dpub, | 693 | if (0 == memcmp (dpub, |
694 | &sc->requests[i].dpub, | 694 | &sc->requests[i].dpub, |
695 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) | 695 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) |
696 | break; | 696 | break; |
697 | if (i == sc->uri->data.ksk.keywordCount) | 697 | if (i == sc->uri->data.ksk.keywordCount) |
698 | { | 698 | { |
@@ -701,8 +701,8 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | |||
701 | return GNUNET_SYSERR; | 701 | return GNUNET_SYSERR; |
702 | } | 702 | } |
703 | /* decrypt */ | 703 | /* decrypt */ |
704 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 704 | anon = GNUNET_CRYPTO_ecdsa_key_get_anonymous (); |
705 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); | 705 | GNUNET_CRYPTO_ecdsa_key_get_public (anon, &anon_pub); |
706 | GNUNET_FS_ublock_decrypt_ (edata, edata_size, | 706 | GNUNET_FS_ublock_decrypt_ (edata, edata_size, |
707 | &anon_pub, | 707 | &anon_pub, |
708 | sc->requests[i].keyword, | 708 | sc->requests[i].keyword, |
@@ -1035,7 +1035,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
1035 | struct MessageBuilderContext mbc; | 1035 | struct MessageBuilderContext mbc; |
1036 | size_t msize; | 1036 | size_t msize; |
1037 | struct SearchMessage *sm; | 1037 | struct SearchMessage *sm; |
1038 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; | 1038 | struct GNUNET_CRYPTO_EcdsaPublicKey dpub; |
1039 | unsigned int sqms; | 1039 | unsigned int sqms; |
1040 | uint32_t options; | 1040 | uint32_t options; |
1041 | 1041 | ||
@@ -1102,7 +1102,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
1102 | sm->type = htonl (GNUNET_BLOCK_TYPE_FS_UBLOCK); | 1102 | sm->type = htonl (GNUNET_BLOCK_TYPE_FS_UBLOCK); |
1103 | sm->anonymity_level = htonl (sc->anonymity); | 1103 | sm->anonymity_level = htonl (sc->anonymity); |
1104 | memset (&sm->target, 0, sizeof (struct GNUNET_HashCode)); | 1104 | memset (&sm->target, 0, sizeof (struct GNUNET_HashCode)); |
1105 | GNUNET_CRYPTO_ecc_public_key_derive (&sc->uri->data.sks.ns, | 1105 | GNUNET_CRYPTO_ecdsa_public_key_derive (&sc->uri->data.sks.ns, |
1106 | sc->uri->data.sks.identifier, | 1106 | sc->uri->data.sks.identifier, |
1107 | "fs-ublock", | 1107 | "fs-ublock", |
1108 | &dpub); | 1108 | &dpub); |
@@ -1271,16 +1271,16 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1271 | { | 1271 | { |
1272 | unsigned int i; | 1272 | unsigned int i; |
1273 | const char *keyword; | 1273 | const char *keyword; |
1274 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 1274 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon; |
1275 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; | 1275 | struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub; |
1276 | struct SearchRequestEntry *sre; | 1276 | struct SearchRequestEntry *sre; |
1277 | 1277 | ||
1278 | GNUNET_assert (NULL == sc->client); | 1278 | GNUNET_assert (NULL == sc->client); |
1279 | if (GNUNET_FS_uri_test_ksk (sc->uri)) | 1279 | if (GNUNET_FS_uri_test_ksk (sc->uri)) |
1280 | { | 1280 | { |
1281 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); | 1281 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); |
1282 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 1282 | anon = GNUNET_CRYPTO_ecdsa_key_get_anonymous (); |
1283 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); | 1283 | GNUNET_CRYPTO_ecdsa_key_get_public (anon, &anon_pub); |
1284 | sc->requests = | 1284 | sc->requests = |
1285 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * | 1285 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * |
1286 | sc->uri->data.ksk.keywordCount); | 1286 | sc->uri->data.ksk.keywordCount); |
@@ -1289,12 +1289,12 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1289 | keyword = &sc->uri->data.ksk.keywords[i][1]; | 1289 | keyword = &sc->uri->data.ksk.keywords[i][1]; |
1290 | sre = &sc->requests[i]; | 1290 | sre = &sc->requests[i]; |
1291 | sre->keyword = GNUNET_strdup (keyword); | 1291 | sre->keyword = GNUNET_strdup (keyword); |
1292 | GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub, | 1292 | GNUNET_CRYPTO_ecdsa_public_key_derive (&anon_pub, |
1293 | keyword, | 1293 | keyword, |
1294 | "fs-ublock", | 1294 | "fs-ublock", |
1295 | &sre->dpub); | 1295 | &sre->dpub); |
1296 | GNUNET_CRYPTO_hash (&sre->dpub, | 1296 | GNUNET_CRYPTO_hash (&sre->dpub, |
1297 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), | 1297 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), |
1298 | &sre->uquery); | 1298 | &sre->uquery); |
1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); | 1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); |
1300 | if (sre->mandatory) | 1300 | if (sre->mandatory) |
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index 7e189d697..14ab0fd69 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c | |||
@@ -490,10 +490,10 @@ process_kblock_for_unindex (void *cls, | |||
490 | } | 490 | } |
491 | { | 491 | { |
492 | char pt[size - sizeof (struct UBlock)]; | 492 | char pt[size - sizeof (struct UBlock)]; |
493 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; | 493 | struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub; |
494 | const char *keyword; | 494 | const char *keyword; |
495 | 495 | ||
496 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (), | 496 | GNUNET_CRYPTO_ecdsa_key_get_public (GNUNET_CRYPTO_ecdsa_key_get_anonymous (), |
497 | &anon_pub); | 497 | &anon_pub); |
498 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; | 498 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; |
499 | GNUNET_FS_ublock_decrypt_ (&ub[1], size - sizeof (struct UBlock), | 499 | GNUNET_FS_ublock_decrypt_ (&ub[1], size - sizeof (struct UBlock), |
@@ -550,9 +550,9 @@ void | |||
550 | GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) | 550 | GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) |
551 | { | 551 | { |
552 | const char *keyword; | 552 | const char *keyword; |
553 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 553 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *anon; |
554 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; | 554 | struct GNUNET_CRYPTO_EcdsaPublicKey anon_pub; |
555 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; | 555 | struct GNUNET_CRYPTO_EcdsaPublicKey dpub; |
556 | 556 | ||
557 | if (NULL == uc->dsh) | 557 | if (NULL == uc->dsh) |
558 | uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); | 558 | uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); |
@@ -570,10 +570,10 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) | |||
570 | unindex_finish (uc); | 570 | unindex_finish (uc); |
571 | return; | 571 | return; |
572 | } | 572 | } |
573 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 573 | anon = GNUNET_CRYPTO_ecdsa_key_get_anonymous (); |
574 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); | 574 | GNUNET_CRYPTO_ecdsa_key_get_public (anon, &anon_pub); |
575 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; | 575 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; |
576 | GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub, | 576 | GNUNET_CRYPTO_ecdsa_public_key_derive (&anon_pub, |
577 | keyword, | 577 | keyword, |
578 | "fs-ublock", | 578 | "fs-ublock", |
579 | &dpub); | 579 | &dpub); |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index e64fabeba..578fc6820 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -118,7 +118,7 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | |||
118 | case GNUNET_FS_URI_LOC: | 118 | case GNUNET_FS_URI_LOC: |
119 | GNUNET_CRYPTO_hash (&uri->data.loc.fi, | 119 | GNUNET_CRYPTO_hash (&uri->data.loc.fi, |
120 | sizeof (struct FileIdentifier) + | 120 | sizeof (struct FileIdentifier) + |
121 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), | 121 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), |
122 | key); | 122 | key); |
123 | break; | 123 | break; |
124 | default: | 124 | default: |
@@ -357,7 +357,7 @@ static struct GNUNET_FS_Uri * | |||
357 | uri_sks_parse (const char *s, char **emsg) | 357 | uri_sks_parse (const char *s, char **emsg) |
358 | { | 358 | { |
359 | struct GNUNET_FS_Uri *ret; | 359 | struct GNUNET_FS_Uri *ret; |
360 | struct GNUNET_CRYPTO_EccPublicSignKey ns; | 360 | struct GNUNET_CRYPTO_EcdsaPublicKey ns; |
361 | size_t pos; | 361 | size_t pos; |
362 | char *end; | 362 | char *end; |
363 | 363 | ||
@@ -559,7 +559,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
559 | unsigned long long exptime; | 559 | unsigned long long exptime; |
560 | unsigned long long flen; | 560 | unsigned long long flen; |
561 | struct GNUNET_TIME_Absolute et; | 561 | struct GNUNET_TIME_Absolute et; |
562 | struct GNUNET_CRYPTO_EccSignature sig; | 562 | struct GNUNET_CRYPTO_EddsaSignature sig; |
563 | struct LocUriAssembly ass; | 563 | struct LocUriAssembly ass; |
564 | int ret; | 564 | int ret; |
565 | size_t slen; | 565 | size_t slen; |
@@ -604,7 +604,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
604 | npos++; | 604 | npos++; |
605 | ret = | 605 | ret = |
606 | enc2bin (&s[npos], &ass.peer, | 606 | enc2bin (&s[npos], &ass.peer, |
607 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); | 607 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); |
608 | if (ret == -1) | 608 | if (ret == -1) |
609 | { | 609 | { |
610 | *emsg = | 610 | *emsg = |
@@ -617,7 +617,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
617 | *emsg = GNUNET_strdup (_("SKS URI malformed (could not find signature)")); | 617 | *emsg = GNUNET_strdup (_("SKS URI malformed (could not find signature)")); |
618 | goto ERR; | 618 | goto ERR; |
619 | } | 619 | } |
620 | ret = enc2bin (&s[npos], &sig, sizeof (struct GNUNET_CRYPTO_EccSignature)); | 620 | ret = enc2bin (&s[npos], &sig, sizeof (struct GNUNET_CRYPTO_EcdsaSignature)); |
621 | if (ret == -1) | 621 | if (ret == -1) |
622 | { | 622 | { |
623 | *emsg = GNUNET_strdup (_("SKS URI malformed (could not decode signature)")); | 623 | *emsg = GNUNET_strdup (_("SKS URI malformed (could not decode signature)")); |
@@ -641,8 +641,8 @@ uri_loc_parse (const char *s, char **emsg) | |||
641 | et.abs_value_us = exptime * 1000LL * 1000LL; | 641 | et.abs_value_us = exptime * 1000LL * 1000LL; |
642 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 642 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
643 | if (GNUNET_OK != | 643 | if (GNUNET_OK != |
644 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, | 644 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, |
645 | &ass.purpose, &sig, &ass.peer.public_key)) | 645 | &ass.purpose, &sig, &ass.peer.public_key)) |
646 | { | 646 | { |
647 | *emsg = | 647 | *emsg = |
648 | GNUNET_strdup (_("SKS URI malformed (signature failed validation)")); | 648 | GNUNET_strdup (_("SKS URI malformed (signature failed validation)")); |
@@ -894,8 +894,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
894 | struct GNUNET_TIME_Absolute expiration_time) | 894 | struct GNUNET_TIME_Absolute expiration_time) |
895 | { | 895 | { |
896 | struct GNUNET_FS_Uri *uri; | 896 | struct GNUNET_FS_Uri *uri; |
897 | struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; | 897 | struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key; |
898 | struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; | 898 | struct GNUNET_CRYPTO_EddsaPublicKey my_public_key; |
899 | char *keyfile; | 899 | char *keyfile; |
900 | struct LocUriAssembly ass; | 900 | struct LocUriAssembly ass; |
901 | struct GNUNET_TIME_Absolute et; | 901 | struct GNUNET_TIME_Absolute et; |
@@ -910,7 +910,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
910 | _("Lacking key configuration settings.\n")); | 910 | _("Lacking key configuration settings.\n")); |
911 | return NULL; | 911 | return NULL; |
912 | } | 912 | } |
913 | if (NULL == (my_private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile))) | 913 | if (NULL == (my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile))) |
914 | { | 914 | { |
915 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 915 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
916 | _("Could not access hostkey file `%s'.\n"), keyfile); | 916 | _("Could not access hostkey file `%s'.\n"), keyfile); |
@@ -920,7 +920,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
920 | GNUNET_free (keyfile); | 920 | GNUNET_free (keyfile); |
921 | /* we round expiration time to full seconds for SKS URIs */ | 921 | /* we round expiration time to full seconds for SKS URIs */ |
922 | et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL; | 922 | et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL; |
923 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); | 923 | GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, &my_public_key); |
924 | ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); | 924 | ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); |
925 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); | 925 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); |
926 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 926 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
@@ -932,8 +932,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
932 | uri->data.loc.expirationTime = et; | 932 | uri->data.loc.expirationTime = et; |
933 | uri->data.loc.peer.public_key = my_public_key; | 933 | uri->data.loc.peer.public_key = my_public_key; |
934 | GNUNET_assert (GNUNET_OK == | 934 | GNUNET_assert (GNUNET_OK == |
935 | GNUNET_CRYPTO_ecc_sign (my_private_key, &ass.purpose, | 935 | GNUNET_CRYPTO_eddsa_sign (my_private_key, &ass.purpose, |
936 | &uri->data.loc.contentSignature)); | 936 | &uri->data.loc.contentSignature)); |
937 | GNUNET_free (my_private_key); | 937 | GNUNET_free (my_private_key); |
938 | return uri; | 938 | return uri; |
939 | } | 939 | } |
@@ -947,7 +947,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
947 | * @return an FS URI for the given namespace and identifier | 947 | * @return an FS URI for the given namespace and identifier |
948 | */ | 948 | */ |
949 | struct GNUNET_FS_Uri * | 949 | struct GNUNET_FS_Uri * |
950 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, | 950 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, |
951 | const char *id) | 951 | const char *id) |
952 | { | 952 | { |
953 | struct GNUNET_FS_Uri *ns_uri; | 953 | struct GNUNET_FS_Uri *ns_uri; |
@@ -1258,7 +1258,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
1258 | case GNUNET_FS_URI_SKS: | 1258 | case GNUNET_FS_URI_SKS: |
1259 | if ((0 == | 1259 | if ((0 == |
1260 | memcmp (&u1->data.sks.ns, &u2->data.sks.ns, | 1260 | memcmp (&u1->data.sks.ns, &u2->data.sks.ns, |
1261 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) && | 1261 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) && |
1262 | (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) | 1262 | (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) |
1263 | 1263 | ||
1264 | return GNUNET_YES; | 1264 | return GNUNET_YES; |
@@ -1285,7 +1285,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
1285 | if (memcmp | 1285 | if (memcmp |
1286 | (&u1->data.loc, &u2->data.loc, | 1286 | (&u1->data.loc, &u2->data.loc, |
1287 | sizeof (struct FileIdentifier) + | 1287 | sizeof (struct FileIdentifier) + |
1288 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + | 1288 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) + |
1289 | sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + | 1289 | sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + |
1290 | sizeof (unsigned short)) != 0) | 1290 | sizeof (unsigned short)) != 0) |
1291 | return GNUNET_NO; | 1291 | return GNUNET_NO; |
@@ -1319,7 +1319,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri) | |||
1319 | */ | 1319 | */ |
1320 | int | 1320 | int |
1321 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 1321 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
1322 | struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym) | 1322 | struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym) |
1323 | { | 1323 | { |
1324 | if (!GNUNET_FS_uri_test_sks (uri)) | 1324 | if (!GNUNET_FS_uri_test_sks (uri)) |
1325 | { | 1325 | { |
@@ -1927,7 +1927,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri) | |||
1927 | if (GNUNET_FS_URI_SKS != uri->type) | 1927 | if (GNUNET_FS_URI_SKS != uri->type) |
1928 | return NULL; | 1928 | return NULL; |
1929 | ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, | 1929 | ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, |
1930 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), | 1930 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), |
1931 | buf, | 1931 | buf, |
1932 | sizeof (buf)); | 1932 | sizeof (buf)); |
1933 | GNUNET_assert (NULL != ret); | 1933 | GNUNET_assert (NULL != ret); |
@@ -2032,10 +2032,10 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) | |||
2032 | GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); | 2032 | GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); |
2033 | peerId = | 2033 | peerId = |
2034 | bin2enc (&uri->data.loc.peer, | 2034 | bin2enc (&uri->data.loc.peer, |
2035 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); | 2035 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); |
2036 | peerSig = | 2036 | peerSig = |
2037 | bin2enc (&uri->data.loc.contentSignature, | 2037 | bin2enc (&uri->data.loc.contentSignature, |
2038 | sizeof (struct GNUNET_CRYPTO_EccSignature)); | 2038 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature)); |
2039 | GNUNET_asprintf (&ret, | 2039 | GNUNET_asprintf (&ret, |
2040 | "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, | 2040 | "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, |
2041 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, | 2041 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, |
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index 83dd45a28..7f7423ae5 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c | |||
@@ -438,7 +438,7 @@ static void | |||
438 | uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri, | 438 | uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri, |
439 | const char *emsg) | 439 | const char *emsg) |
440 | { | 440 | { |
441 | const struct GNUNET_CRYPTO_EccPrivateKey *priv; | 441 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv; |
442 | 442 | ||
443 | if (NULL != emsg) | 443 | if (NULL != emsg) |
444 | { | 444 | { |
@@ -520,7 +520,7 @@ static void | |||
520 | directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) | 520 | directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) |
521 | { | 521 | { |
522 | struct GNUNET_FS_FileInformation *fi; | 522 | struct GNUNET_FS_FileInformation *fi; |
523 | const struct GNUNET_CRYPTO_EccPrivateKey *priv; | 523 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv; |
524 | 524 | ||
525 | fi = get_file_information (directory_scan_result); | 525 | fi = get_file_information (directory_scan_result); |
526 | GNUNET_FS_share_tree_free (directory_scan_result); | 526 | GNUNET_FS_share_tree_free (directory_scan_result); |
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c index 9f6791bb5..36e7f0796 100644 --- a/src/fs/plugin_block_fs.c +++ b/src/fs/plugin_block_fs.c | |||
@@ -105,13 +105,13 @@ block_plugin_fs_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | |||
105 | GNUNET_break_op (0); | 105 | GNUNET_break_op (0); |
106 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 106 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
107 | } | 107 | } |
108 | if (reply_block_size != ntohl (ub->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature)) | 108 | if (reply_block_size != ntohl (ub->purpose.size) + sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) |
109 | { | 109 | { |
110 | GNUNET_break_op (0); | 110 | GNUNET_break_op (0); |
111 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 111 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
112 | } | 112 | } |
113 | if (GNUNET_OK != | 113 | if (GNUNET_OK != |
114 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK, | 114 | GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK, |
115 | &ub->purpose, | 115 | &ub->purpose, |
116 | &ub->signature, | 116 | &ub->signature, |
117 | &ub->verification_key)) | 117 | &ub->verification_key)) |
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index b0358e809..c78008122 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "gnunet_fs_service.h" | 29 | #include "gnunet_fs_service.h" |
30 | 30 | ||
31 | 31 | ||
32 | static struct GNUNET_CRYPTO_EccPublicSignKey nsid; | 32 | static struct GNUNET_CRYPTO_EcdsaPublicKey nsid; |
33 | 33 | ||
34 | static struct GNUNET_FS_Uri *sks_expect_uri; | 34 | static struct GNUNET_FS_Uri *sks_expect_uri; |
35 | 35 | ||
@@ -237,7 +237,7 @@ static void | |||
237 | adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | 237 | adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) |
238 | { | 238 | { |
239 | struct GNUNET_CONTAINER_MetaData *meta; | 239 | struct GNUNET_CONTAINER_MetaData *meta; |
240 | struct GNUNET_CRYPTO_EccPrivateKey *ns; | 240 | struct GNUNET_CRYPTO_EcdsaPrivateKey *ns; |
241 | struct GNUNET_FS_BlockOptions bo; | 241 | struct GNUNET_FS_BlockOptions bo; |
242 | 242 | ||
243 | if (NULL != emsg) | 243 | if (NULL != emsg) |
@@ -247,7 +247,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
247 | GNUNET_FS_stop (fs); | 247 | GNUNET_FS_stop (fs); |
248 | return; | 248 | return; |
249 | } | 249 | } |
250 | ns = GNUNET_CRYPTO_ecc_key_create (); | 250 | ns = GNUNET_CRYPTO_ecdsa_key_create (); |
251 | meta = GNUNET_CONTAINER_meta_data_create (); | 251 | meta = GNUNET_CONTAINER_meta_data_create (); |
252 | sks_expect_uri = GNUNET_FS_uri_dup (uri); | 252 | sks_expect_uri = GNUNET_FS_uri_dup (uri); |
253 | bo.content_priority = 1; | 253 | bo.content_priority = 1; |
@@ -255,7 +255,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
255 | bo.replication_level = 0; | 255 | bo.replication_level = 0; |
256 | bo.expiration_time = | 256 | bo.expiration_time = |
257 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); | 257 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); |
258 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &nsid); | 258 | GNUNET_CRYPTO_ecdsa_key_get_public (ns, &nsid); |
259 | GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri, | 259 | GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri, |
260 | &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL); | 260 | &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL); |
261 | GNUNET_CONTAINER_meta_data_destroy (meta); | 261 | GNUNET_CONTAINER_meta_data_destroy (meta); |
@@ -266,13 +266,13 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
266 | static void | 266 | static void |
267 | testNamespace () | 267 | testNamespace () |
268 | { | 268 | { |
269 | struct GNUNET_CRYPTO_EccPrivateKey *ns; | 269 | struct GNUNET_CRYPTO_EcdsaPrivateKey *ns; |
270 | struct GNUNET_FS_BlockOptions bo; | 270 | struct GNUNET_FS_BlockOptions bo; |
271 | struct GNUNET_CONTAINER_MetaData *meta; | 271 | struct GNUNET_CONTAINER_MetaData *meta; |
272 | struct GNUNET_FS_Uri *ksk_uri; | 272 | struct GNUNET_FS_Uri *ksk_uri; |
273 | struct GNUNET_FS_Uri *sks_uri; | 273 | struct GNUNET_FS_Uri *sks_uri; |
274 | 274 | ||
275 | ns = GNUNET_CRYPTO_ecc_key_create (); | 275 | ns = GNUNET_CRYPTO_ecdsa_key_create (); |
276 | meta = GNUNET_CONTAINER_meta_data_create (); | 276 | meta = GNUNET_CONTAINER_meta_data_create (); |
277 | ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL); | 277 | ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL); |
278 | bo.content_priority = 1; | 278 | bo.content_priority = 1; |
diff --git a/src/fs/test_fs_namespace_list_updateable.c b/src/fs/test_fs_namespace_list_updateable.c index 69fc6542c..e8cfb2b77 100644 --- a/src/fs/test_fs_namespace_list_updateable.c +++ b/src/fs/test_fs_namespace_list_updateable.c | |||
@@ -33,7 +33,7 @@ static struct GNUNET_FS_Handle *fs; | |||
33 | 33 | ||
34 | static int err; | 34 | static int err; |
35 | 35 | ||
36 | static struct GNUNET_CRYPTO_EccPrivateKey *ns; | 36 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *ns; |
37 | 37 | ||
38 | static struct GNUNET_CONTAINER_MetaData *meta; | 38 | static struct GNUNET_CONTAINER_MetaData *meta; |
39 | 39 | ||
@@ -127,7 +127,7 @@ sks_cont_this (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
127 | static void | 127 | static void |
128 | testNamespace () | 128 | testNamespace () |
129 | { | 129 | { |
130 | ns = GNUNET_CRYPTO_ecc_key_create (); | 130 | ns = GNUNET_CRYPTO_ecdsa_key_create (); |
131 | GNUNET_assert (NULL != ns); | 131 | GNUNET_assert (NULL != ns); |
132 | bo.content_priority = 1; | 132 | bo.content_priority = 1; |
133 | bo.anonymity_level = 1; | 133 | bo.anonymity_level = 1; |
diff --git a/src/fs/test_fs_uri.c b/src/fs/test_fs_uri.c index 1e1bd8fb8..2fc5b2a2d 100644 --- a/src/fs/test_fs_uri.c +++ b/src/fs/test_fs_uri.c | |||
@@ -163,8 +163,8 @@ testNamespace (int i) | |||
163 | char *uri; | 163 | char *uri; |
164 | struct GNUNET_FS_Uri *ret; | 164 | struct GNUNET_FS_Uri *ret; |
165 | char *emsg; | 165 | char *emsg; |
166 | struct GNUNET_CRYPTO_EccPrivateKey *ph; | 166 | struct GNUNET_CRYPTO_EcdsaPrivateKey *ph; |
167 | struct GNUNET_CRYPTO_EccPublicSignKey id; | 167 | struct GNUNET_CRYPTO_EcdsaPublicKey id; |
168 | char buf[1024]; | 168 | char buf[1024]; |
169 | char ubuf[1024]; | 169 | char ubuf[1024]; |
170 | char *sret; | 170 | char *sret; |
@@ -193,8 +193,8 @@ testNamespace (int i) | |||
193 | GNUNET_assert (0); | 193 | GNUNET_assert (0); |
194 | } | 194 | } |
195 | GNUNET_free (emsg); | 195 | GNUNET_free (emsg); |
196 | ph = GNUNET_CRYPTO_ecc_key_create (); | 196 | ph = GNUNET_CRYPTO_ecdsa_key_create (); |
197 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ph, &id); | 197 | GNUNET_CRYPTO_ecdsa_key_get_public (ph, &id); |
198 | sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), | 198 | sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), |
199 | ubuf, sizeof (ubuf) - 1); | 199 | ubuf, sizeof (ubuf) - 1); |
200 | GNUNET_assert (NULL != sret); | 200 | GNUNET_assert (NULL != sret); |