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/hello/hello.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/hello/hello.c')
-rw-r--r-- | src/hello/hello.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/hello/hello.c b/src/hello/hello.c index 6261dcb6b..37acc5996 100644 --- a/src/hello/hello.c +++ b/src/hello/hello.c | |||
@@ -59,7 +59,7 @@ struct GNUNET_HELLO_Message | |||
59 | /** | 59 | /** |
60 | * The public key of the peer. | 60 | * The public key of the peer. |
61 | */ | 61 | */ |
62 | struct GNUNET_CRYPTO_EccPublicSignKey publicKey; | 62 | struct GNUNET_CRYPTO_EddsaPublicKey publicKey; |
63 | 63 | ||
64 | }; | 64 | }; |
65 | GNUNET_NETWORK_STRUCT_END | 65 | GNUNET_NETWORK_STRUCT_END |
@@ -218,7 +218,7 @@ get_hello_address_size (const char *buf, | |||
218 | * @return the hello message | 218 | * @return the hello message |
219 | */ | 219 | */ |
220 | struct GNUNET_HELLO_Message * | 220 | struct GNUNET_HELLO_Message * |
221 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey, | 221 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *publicKey, |
222 | GNUNET_HELLO_GenerateAddressListCallback addrgen, | 222 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
223 | void *addrgen_cls, | 223 | void *addrgen_cls, |
224 | int friend_only) | 224 | int friend_only) |
@@ -249,7 +249,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey, | |||
249 | hello->friend_only = htonl (friend_only); | 249 | hello->friend_only = htonl (friend_only); |
250 | 250 | ||
251 | memcpy (&hello->publicKey, publicKey, | 251 | memcpy (&hello->publicKey, publicKey, |
252 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); | 252 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)); |
253 | memcpy (&hello[1], buffer, used); | 253 | memcpy (&hello[1], buffer, used); |
254 | return hello; | 254 | return hello; |
255 | } | 255 | } |
@@ -530,7 +530,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello) | |||
530 | */ | 530 | */ |
531 | int | 531 | int |
532 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 532 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
533 | struct GNUNET_CRYPTO_EccPublicSignKey *publicKey) | 533 | struct GNUNET_CRYPTO_EddsaPublicKey *publicKey) |
534 | { | 534 | { |
535 | uint16_t ret = ntohs (hello->header.size); | 535 | uint16_t ret = ntohs (hello->header.size); |
536 | 536 | ||
@@ -669,7 +669,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, | |||
669 | 669 | ||
670 | if (0 != | 670 | if (0 != |
671 | memcmp (&h1->publicKey, &h2->publicKey, | 671 | memcmp (&h1->publicKey, &h2->publicKey, |
672 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) | 672 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey))) |
673 | return GNUNET_TIME_UNIT_ZERO_ABS; | 673 | return GNUNET_TIME_UNIT_ZERO_ABS; |
674 | ec.expiration_limit = now; | 674 | ec.expiration_limit = now; |
675 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; | 675 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; |
@@ -871,7 +871,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, | |||
871 | struct GNUNET_HELLO_ComposeUriContext ctx; | 871 | struct GNUNET_HELLO_ComposeUriContext ctx; |
872 | ctx.plugins_find = plugins_find; | 872 | ctx.plugins_find = plugins_find; |
873 | 873 | ||
874 | char *pkey = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&(hello->publicKey)); | 874 | char *pkey = GNUNET_CRYPTO_eddsa_public_key_to_string (&(hello->publicKey)); |
875 | 875 | ||
876 | GNUNET_asprintf (&(ctx.uri), | 876 | GNUNET_asprintf (&(ctx.uri), |
877 | "%s%s", | 877 | "%s%s", |
@@ -1044,7 +1044,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer) | |||
1044 | */ | 1044 | */ |
1045 | int | 1045 | int |
1046 | GNUNET_HELLO_parse_uri (const char *uri, | 1046 | GNUNET_HELLO_parse_uri (const char *uri, |
1047 | struct GNUNET_CRYPTO_EccPublicSignKey *pubkey, | 1047 | struct GNUNET_CRYPTO_EddsaPublicKey *pubkey, |
1048 | struct GNUNET_HELLO_Message **hello, | 1048 | struct GNUNET_HELLO_Message **hello, |
1049 | GNUNET_HELLO_TransportPluginsFind plugins_find) | 1049 | GNUNET_HELLO_TransportPluginsFind plugins_find) |
1050 | { | 1050 | { |