diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-05 18:25:09 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-05 18:25:09 +0000 |
commit | 5d29fdeacef5200f67b4158519d16f67cf2da9e3 (patch) | |
tree | 16e77a3e887273cd3945f8e732a60a126351e56c | |
parent | 62cb95a862cb8d730b8c87930195332a54f26dca (diff) | |
download | gnunet-5d29fdeacef5200f67b4158519d16f67cf2da9e3.tar.gz gnunet-5d29fdeacef5200f67b4158519d16f67cf2da9e3.zip |
Werner Koch wrote:
Hi,
find attached a changed diff to crypto_ecc.c with the final Libgcrypt
interface. Use commit b9fd398 or later for your tests.
Shalom-Salam,
Werner
-rw-r--r-- | src/util/crypto_ecc.c | 14 | ||||
-rw-r--r-- | src/util/test_crypto_ecdsa.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 2bd89c402..dc69a59f3 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -213,7 +213,7 @@ decode_private_ecdsa_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv) | |||
213 | 213 | ||
214 | rc = gcry_sexp_build (&result, NULL, | 214 | rc = gcry_sexp_build (&result, NULL, |
215 | "(private-key(ecc(curve \"" CURVE "\")" | 215 | "(private-key(ecc(curve \"" CURVE "\")" |
216 | "(flags ecdsa)(d %b)))", | 216 | "(d %b)))", |
217 | (int)sizeof (priv->d), priv->d); | 217 | (int)sizeof (priv->d), priv->d); |
218 | if (0 != rc) | 218 | if (0 != rc) |
219 | { | 219 | { |
@@ -246,7 +246,7 @@ decode_private_eddsa_key (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv) | |||
246 | 246 | ||
247 | rc = gcry_sexp_build (&result, NULL, | 247 | rc = gcry_sexp_build (&result, NULL, |
248 | "(private-key(ecc(curve \"" CURVE "\")" | 248 | "(private-key(ecc(curve \"" CURVE "\")" |
249 | "(d %b)))", | 249 | "(flags eddsa)(d %b)))", |
250 | (int)sizeof (priv->d), priv->d); | 250 | (int)sizeof (priv->d), priv->d); |
251 | if (0 != rc) | 251 | if (0 != rc) |
252 | { | 252 | { |
@@ -279,7 +279,7 @@ decode_private_ecdhe_key (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv) | |||
279 | 279 | ||
280 | rc = gcry_sexp_build (&result, NULL, | 280 | rc = gcry_sexp_build (&result, NULL, |
281 | "(private-key(ecc(curve \"" CURVE "\")" | 281 | "(private-key(ecc(curve \"" CURVE "\")" |
282 | "(flags ecdsa)(d %b)))", | 282 | "(d %b)))", |
283 | (int)sizeof (priv->d), priv->d); | 283 | (int)sizeof (priv->d), priv->d); |
284 | if (0 != rc) | 284 | if (0 != rc) |
285 | { | 285 | { |
@@ -550,7 +550,7 @@ GNUNET_CRYPTO_ecdhe_key_create () | |||
550 | 550 | ||
551 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, | 551 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, |
552 | "(genkey(ecc(curve \"" CURVE "\")" | 552 | "(genkey(ecc(curve \"" CURVE "\")" |
553 | "(flags noparam ecdsa)))"))) | 553 | "(flags noparam)))"))) |
554 | { | 554 | { |
555 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); | 555 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); |
556 | return NULL; | 556 | return NULL; |
@@ -600,7 +600,7 @@ GNUNET_CRYPTO_ecdsa_key_create () | |||
600 | 600 | ||
601 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, | 601 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, |
602 | "(genkey(ecc(curve \"" CURVE "\")" | 602 | "(genkey(ecc(curve \"" CURVE "\")" |
603 | "(flags noparam ecdsa)))"))) | 603 | "(flags noparam)))"))) |
604 | { | 604 | { |
605 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); | 605 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); |
606 | return NULL; | 606 | return NULL; |
@@ -649,7 +649,7 @@ GNUNET_CRYPTO_eddsa_key_create () | |||
649 | 649 | ||
650 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, | 650 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, |
651 | "(genkey(ecc(curve \"" CURVE "\")" | 651 | "(genkey(ecc(curve \"" CURVE "\")" |
652 | "(flags noparam)))"))) | 652 | "(flags noparam eddsa)))"))) |
653 | { | 653 | { |
654 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); | 654 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); |
655 | return NULL; | 655 | return NULL; |
@@ -1152,7 +1152,7 @@ data_to_ecdsa_value (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose) | |||
1152 | 1152 | ||
1153 | GNUNET_CRYPTO_hash (purpose, ntohl (purpose->size), &hc); | 1153 | GNUNET_CRYPTO_hash (purpose, ntohl (purpose->size), &hc); |
1154 | if (0 != (rc = gcry_sexp_build (&data, NULL, | 1154 | if (0 != (rc = gcry_sexp_build (&data, NULL, |
1155 | "(data(flags ecdsa rfc6979)(hash %s %b))", | 1155 | "(data(flags rfc6979)(hash %s %b))", |
1156 | "sha512", | 1156 | "sha512", |
1157 | (int)sizeof (hc), &hc))) | 1157 | (int)sizeof (hc), &hc))) |
1158 | { | 1158 | { |
diff --git a/src/util/test_crypto_ecdsa.c b/src/util/test_crypto_ecdsa.c index bf5fcf571..4845db820 100644 --- a/src/util/test_crypto_ecdsa.c +++ b/src/util/test_crypto_ecdsa.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #define ITER 25 | 31 | #define ITER 25 |
32 | 32 | ||
33 | #define PERF GNUNET_NO | 33 | #define PERF GNUNET_YES |
34 | 34 | ||
35 | 35 | ||
36 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *key; | 36 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *key; |