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/identity/gnunet-service-identity.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/identity/gnunet-service-identity.c')
-rw-r--r-- | src/identity/gnunet-service-identity.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c index c61286bd5..e0c0bd783 100644 --- a/src/identity/gnunet-service-identity.c +++ b/src/identity/gnunet-service-identity.c | |||
@@ -58,7 +58,7 @@ struct Ego | |||
58 | /** | 58 | /** |
59 | * Private key of the ego. | 59 | * Private key of the ego. |
60 | */ | 60 | */ |
61 | struct GNUNET_CRYPTO_EccPrivateKey *pk; | 61 | struct GNUNET_CRYPTO_EcdsaPrivateKey *pk; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * String identifier for the ego. | 64 | * String identifier for the ego. |
@@ -370,10 +370,10 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
370 | * @return 0 if the keys are equal | 370 | * @return 0 if the keys are equal |
371 | */ | 371 | */ |
372 | static int | 372 | static int |
373 | key_cmp (const struct GNUNET_CRYPTO_EccPrivateKey *pk1, | 373 | key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1, |
374 | const struct GNUNET_CRYPTO_EccPrivateKey *pk2) | 374 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2) |
375 | { | 375 | { |
376 | return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EccPrivateKey)); | 376 | return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)); |
377 | } | 377 | } |
378 | 378 | ||
379 | 379 | ||
@@ -517,7 +517,7 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
517 | } | 517 | } |
518 | } | 518 | } |
519 | ego = GNUNET_new (struct Ego); | 519 | ego = GNUNET_new (struct Ego); |
520 | ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); | 520 | ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); |
521 | *ego->pk = crm->private_key; | 521 | *ego->pk = crm->private_key; |
522 | ego->identifier = GNUNET_strdup (str); | 522 | ego->identifier = GNUNET_strdup (str); |
523 | GNUNET_CONTAINER_DLL_insert (ego_head, | 523 | GNUNET_CONTAINER_DLL_insert (ego_head, |
@@ -526,10 +526,10 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
526 | send_result_code (client, 0, NULL); | 526 | send_result_code (client, 0, NULL); |
527 | fn = get_ego_filename (ego); | 527 | fn = get_ego_filename (ego); |
528 | (void) GNUNET_DISK_directory_create_for_file (fn); | 528 | (void) GNUNET_DISK_directory_create_for_file (fn); |
529 | if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) != | 529 | if (sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey) != |
530 | GNUNET_DISK_fn_write (fn, | 530 | GNUNET_DISK_fn_write (fn, |
531 | &crm->private_key, | 531 | &crm->private_key, |
532 | sizeof (struct GNUNET_CRYPTO_EccPrivateKey), | 532 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey), |
533 | GNUNET_DISK_PERM_USER_READ | | 533 | GNUNET_DISK_PERM_USER_READ | |
534 | GNUNET_DISK_PERM_USER_WRITE)) | 534 | GNUNET_DISK_PERM_USER_WRITE)) |
535 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, | 535 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, |
@@ -819,7 +819,7 @@ process_ego_file (void *cls, | |||
819 | return GNUNET_OK; | 819 | return GNUNET_OK; |
820 | } | 820 | } |
821 | ego = GNUNET_new (struct Ego); | 821 | ego = GNUNET_new (struct Ego); |
822 | ego->pk = GNUNET_CRYPTO_ecc_key_create_from_file (filename); | 822 | ego->pk = GNUNET_CRYPTO_ecdsa_key_create_from_file (filename); |
823 | if (NULL == ego->pk) | 823 | if (NULL == ego->pk) |
824 | { | 824 | { |
825 | GNUNET_free (ego); | 825 | GNUNET_free (ego); |