weak_key.key[30] = (char) (0xaa);
weak_key.key[31] = (char) (0xaa);
/* memset(&weak_key, 0, 32); */
- weak_key.crc32 =
- htonl (GNUNET_CRYPTO_crc32_n (&weak_key, GNUNET_CRYPTO_AES_KEY_LENGTH));
-
- size = GNUNET_CRYPTO_aes_encrypt (WEAK_KEY_TESTSTRING,
- strlen (WEAK_KEY_TESTSTRING) + 1,
- &weak_key, &INITVALUE, result);
+ size =
+ GNUNET_CRYPTO_aes_encrypt (WEAK_KEY_TESTSTRING,
+ strlen (WEAK_KEY_TESTSTRING) + 1, &weak_key,
+ &INITVALUE, result);
if (size == -1)
{
{
if (number_of_runs % 1000 == 0)
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
/*printf("Got to run number %d.\n", number_of_runs); */
GNUNET_CRYPTO_aes_create_session_key (&sessionkey);
- rc = gcry_cipher_open (&handle,
- GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB, 0);
+ rc = gcry_cipher_open (&handle, GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB,
+ 0);
if (rc)
{
int weak_keys;
GNUNET_log_setup ("test-crypto-aes-weak", "WARNING", NULL);
- GNUNET_CRYPTO_random_disable_entropy_gathering ();
if (GENERATE_WEAK_KEYS)
{
weak_keys = getWeakKeys ();
}
else
{
- printf ("\n%d weak keys found in %d runs.\n",
- weak_keys, MAX_WEAK_KEY_TRIALS);
+ printf ("\n%d weak keys found in %d runs.\n", weak_keys,
+ MAX_WEAK_KEY_TRIALS);
}
}