diff options
Diffstat (limited to 'src/util/test_crypto_aes_weak.c')
-rw-r--r-- | src/util/test_crypto_aes_weak.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/util/test_crypto_aes_weak.c b/src/util/test_crypto_aes_weak.c index f54835b3d..a0161b575 100644 --- a/src/util/test_crypto_aes_weak.c +++ b/src/util/test_crypto_aes_weak.c | |||
@@ -94,9 +94,10 @@ testWeakKey () | |||
94 | weak_key.crc32 = | 94 | weak_key.crc32 = |
95 | htonl (GNUNET_CRYPTO_crc32_n (&weak_key, GNUNET_CRYPTO_AES_KEY_LENGTH)); | 95 | htonl (GNUNET_CRYPTO_crc32_n (&weak_key, GNUNET_CRYPTO_AES_KEY_LENGTH)); |
96 | 96 | ||
97 | size = GNUNET_CRYPTO_aes_encrypt (WEAK_KEY_TESTSTRING, | 97 | size = |
98 | strlen (WEAK_KEY_TESTSTRING) + 1, | 98 | GNUNET_CRYPTO_aes_encrypt (WEAK_KEY_TESTSTRING, |
99 | &weak_key, &INITVALUE, result); | 99 | strlen (WEAK_KEY_TESTSTRING) + 1, &weak_key, |
100 | &INITVALUE, result); | ||
100 | 101 | ||
101 | if (size == -1) | 102 | if (size == -1) |
102 | { | 103 | { |
@@ -139,8 +140,8 @@ getWeakKeys () | |||
139 | /*printf("Got to run number %d.\n", number_of_runs); */ | 140 | /*printf("Got to run number %d.\n", number_of_runs); */ |
140 | GNUNET_CRYPTO_aes_create_session_key (&sessionkey); | 141 | GNUNET_CRYPTO_aes_create_session_key (&sessionkey); |
141 | 142 | ||
142 | rc = gcry_cipher_open (&handle, | 143 | rc = gcry_cipher_open (&handle, GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB, |
143 | GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB, 0); | 144 | 0); |
144 | 145 | ||
145 | if (rc) | 146 | if (rc) |
146 | { | 147 | { |
@@ -188,8 +189,8 @@ main (int argc, char *argv[]) | |||
188 | } | 189 | } |
189 | else | 190 | else |
190 | { | 191 | { |
191 | printf ("\n%d weak keys found in %d runs.\n", | 192 | printf ("\n%d weak keys found in %d runs.\n", weak_keys, |
192 | weak_keys, MAX_WEAK_KEY_TRIALS); | 193 | MAX_WEAK_KEY_TRIALS); |
193 | } | 194 | } |
194 | } | 195 | } |
195 | 196 | ||