diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-28 17:02:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-28 17:02:19 +0000 |
commit | 8ec56983556915364a1f35dd8bacadbcbcf54fb0 (patch) | |
tree | 257f20a43ad0344173b8f3423f3dcf11ae7eb830 /src | |
parent | 426c12fc1188f90db6969f48efec0163fa805dc5 (diff) | |
download | gnunet-8ec56983556915364a1f35dd8bacadbcbcf54fb0.tar.gz gnunet-8ec56983556915364a1f35dd8bacadbcbcf54fb0.zip |
-ecc signing working
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 9 | ||||
-rw-r--r-- | src/util/Makefile.am | 1 | ||||
-rw-r--r-- | src/util/crypto_ecc.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index ff7bffdbb..1e2af8925 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -91,16 +91,15 @@ enum GNUNET_CRYPTO_Quality | |||
91 | /** | 91 | /** |
92 | * Length of a hash value | 92 | * Length of a hash value |
93 | */ | 93 | */ |
94 | #define GNUNET_CRYPTO_HASH_LENGTH 512/8 | 94 | #define GNUNET_CRYPTO_HASH_LENGTH (512/8) |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * FIXME: what is an acceptable value here? | 97 | * Maximum length of an ECC signature. |
98 | * Note: round to multiple of 8 minus 2. | 98 | * Note: round up to multiple of 8 minus 2 for alignment. |
99 | */ | 99 | */ |
100 | #define GNUNET_CRYPTO_ECC_SIGNATURE_DATA_ENCODING_LENGTH 138 | 100 | #define GNUNET_CRYPTO_ECC_SIGNATURE_DATA_ENCODING_LENGTH 190 |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * FIXME: what is an acceptable value here? | ||
104 | * Maximum length of the public key (q-point, Q = dP) when encoded. | 103 | * Maximum length of the public key (q-point, Q = dP) when encoded. |
105 | */ | 104 | */ |
106 | #define GNUNET_CRYPTO_ECC_MAX_PUBLIC_KEY_LENGTH 140 | 105 | #define GNUNET_CRYPTO_ECC_MAX_PUBLIC_KEY_LENGTH 140 |
diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 239f3c91e..7983d61db 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am | |||
@@ -211,6 +211,7 @@ check_PROGRAMS = \ | |||
211 | test_crypto_aes \ | 211 | test_crypto_aes \ |
212 | test_crypto_aes_weak \ | 212 | test_crypto_aes_weak \ |
213 | test_crypto_crc \ | 213 | test_crypto_crc \ |
214 | test_crypto_ecc \ | ||
214 | test_crypto_hash \ | 215 | test_crypto_hash \ |
215 | test_crypto_hkdf \ | 216 | test_crypto_hkdf \ |
216 | test_crypto_ksk \ | 217 | test_crypto_ksk \ |
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index cfc5deb25..81429e3c4 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -942,7 +942,7 @@ data_to_pkcs1 (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose) | |||
942 | gcry_sexp_t data; | 942 | gcry_sexp_t data; |
943 | 943 | ||
944 | GNUNET_CRYPTO_short_hash (purpose, ntohl (purpose->size), &hc); | 944 | GNUNET_CRYPTO_short_hash (purpose, ntohl (purpose->size), &hc); |
945 | #define FORMATSTRING "(4:data(32:01234567890123456789012345678901))" | 945 | #define FORMATSTRING "(4:data(5:flags3:raw)(5:value32:01234567890123456789012345678901))" |
946 | #define FORMATSTRING2 "(4:data(4:hash6:sha25632:01234567890123456789012345678901))" | 946 | #define FORMATSTRING2 "(4:data(4:hash6:sha25632:01234567890123456789012345678901))" |
947 | bufSize = strlen (FORMATSTRING) + 1; | 947 | bufSize = strlen (FORMATSTRING) + 1; |
948 | { | 948 | { |