diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-19 11:52:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-19 11:52:07 +0000 |
commit | 6c84d4e050d5a56787ead683abc3b0db9b238fff (patch) | |
tree | d30bec1224c49fb089f0818d3457c176bb2c184c | |
parent | 755b04521a5b37ceac529df984c9ca1e466741c6 (diff) | |
download | gnunet-6c84d4e050d5a56787ead683abc3b0db9b238fff.tar.gz gnunet-6c84d4e050d5a56787ead683abc3b0db9b238fff.zip |
-use faster Eddsa key gen
-rw-r--r-- | src/util/crypto_ecc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index a29e27a44..dc3f206e7 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -494,7 +494,7 @@ GNUNET_CRYPTO_ecdhe_key_create () | |||
494 | 494 | ||
495 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, | 495 | if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL, |
496 | "(genkey(ecc(curve \"" CURVE "\")" | 496 | "(genkey(ecc(curve \"" CURVE "\")" |
497 | "(flags)))"))) | 497 | "(flags eddsa)))"))) |
498 | { | 498 | { |
499 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); | 499 | LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc); |
500 | return NULL; | 500 | return NULL; |
@@ -1586,7 +1586,7 @@ eddsa_d_to_a (gcry_mpi_t d) | |||
1586 | gcry_mpi_t a; | 1586 | gcry_mpi_t a; |
1587 | 1587 | ||
1588 | b = 256 / 8; /* number of bytes in `d` */ | 1588 | b = 256 / 8; /* number of bytes in `d` */ |
1589 | 1589 | ||
1590 | /* Note that we clear DIGEST so we can use it as input to left pad | 1590 | /* Note that we clear DIGEST so we can use it as input to left pad |
1591 | the key with zeroes for hashing. */ | 1591 | the key with zeroes for hashing. */ |
1592 | memset (hvec, 0, sizeof hvec); | 1592 | memset (hvec, 0, sizeof hvec); |
@@ -1658,7 +1658,7 @@ GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, | |||
1658 | /* NOW, because this is EdDSA, HASH 'd' first! */ | 1658 | /* NOW, because this is EdDSA, HASH 'd' first! */ |
1659 | a = eddsa_d_to_a (d); | 1659 | a = eddsa_d_to_a (d); |
1660 | gcry_mpi_release (d); | 1660 | gcry_mpi_release (d); |
1661 | 1661 | ||
1662 | /* then call the 'multiply' function, to compute the product */ | 1662 | /* then call the 'multiply' function, to compute the product */ |
1663 | result = gcry_mpi_point_new (0); | 1663 | result = gcry_mpi_point_new (0); |
1664 | gcry_mpi_ec_mul (result, a, q, ctx); | 1664 | gcry_mpi_ec_mul (result, a, q, ctx); |