aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_crypto_ecdhe.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-05 17:35:25 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-05 17:35:25 +0000
commit62cb95a862cb8d730b8c87930195332a54f26dca (patch)
treeae4673a67e3a4bbb01665dadb88b506256bc4090 /src/util/test_crypto_ecdhe.c
parent5ff9d6c06021db8efad154660843ed4f3617fd98 (diff)
downloadgnunet-62cb95a862cb8d730b8c87930195332a54f26dca.tar.gz
gnunet-62cb95a862cb8d730b8c87930195332a54f26dca.zip
Werner Koch wrote:
Hi, find attach the patch which makes all 3 test cases work with Ed25519. There are some minor hacks in the test cases to allow enabling of Libgcrypt debugging and also some minor output style changes. There is one FIXME in the code: /* FIXME: mpi_print creates an unsigned integer - is that intended or should we convert it to a signed integer (2-compl)? */ mpi_print (xbuf, sizeof (xbuf), result_x); X may be positive or negative but GCRYMPI_FMT_USG ignores the sign. Thus this is not what we actually want. Should we change it to 2-comp (GCRYMPI_FMT_STD) so that we have a proper value? Given that the curve is 255 bit this should alwas fit int the 256 bit buffer. Another option would be to use the EdDSA method for the sign but that is optimized to easily recover x and would be more work. Or we store the sign in the high bit. t all depends on what you want to write into the protocol specs. I would also like to revert the way we distinguish between Ed25519 with and without ECDSA: The way we do it right now is by assuming the Ed25519 is always used with EdDSA unless a flag has been set. This is a bit surprising and requiring the "(flags eddsa)" would be a less surprising interface. Salam-Shalom, Werner
Diffstat (limited to 'src/util/test_crypto_ecdhe.c')
-rw-r--r--src/util/test_crypto_ecdhe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/test_crypto_ecdhe.c b/src/util/test_crypto_ecdhe.c
index a6f96d9f1..dd017897e 100644
--- a/src/util/test_crypto_ecdhe.c
+++ b/src/util/test_crypto_ecdhe.c
@@ -38,14 +38,16 @@ main (int argc, char *argv[])
38 struct GNUNET_HashCode ecdh1; 38 struct GNUNET_HashCode ecdh1;
39 struct GNUNET_HashCode ecdh2; 39 struct GNUNET_HashCode ecdh2;
40 40
41 if (! gcry_check_version ("1.5.0")) 41 if (! gcry_check_version ("1.6.0"))
42 { 42 {
43 FPRINTF (stderr, 43 FPRINTF (stderr,
44 _ 44 _
45 ("libgcrypt has not the expected version (version %s is required).\n"), 45 ("libgcrypt has not the expected version (version %s is required).\n"),
46 "1.5.0"); 46 "1.6.0");
47 return 0; 47 return 0;
48 } 48 }
49 if (getenv ("GNUNET_GCRYPT_DEBUG"))
50 gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u , 0);
49 GNUNET_log_setup ("test-crypto-ecdhe", "WARNING", NULL); 51 GNUNET_log_setup ("test-crypto-ecdhe", "WARNING", NULL);
50 52
51 priv1 = GNUNET_CRYPTO_ecdhe_key_create (); 53 priv1 = GNUNET_CRYPTO_ecdhe_key_create ();