From e30660eaff5f945f92dcea5153dbafb2f11210d7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 3 Oct 2013 22:13:50 +0000 Subject: [PATCH] -fix IV --- src/util/crypto_symmetric.c | 16 ++++++++-------- src/util/test_crypto_symmetric.c | 9 +++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c index 3cc546652..97e2a4cfb 100644 --- a/src/util/crypto_symmetric.c +++ b/src/util/crypto_symmetric.c @@ -121,11 +121,11 @@ setup_cipher_twofish (gcry_cipher_hd_t *handle, * @returns the size of the encrypted block, -1 for errors */ ssize_t -GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t len, - const struct GNUNET_CRYPTO_SymmetricSessionKey * - sessionkey, - const struct GNUNET_CRYPTO_SymmetricInitializationVector * - iv, void *result) +GNUNET_CRYPTO_symmetric_encrypt (const void *block, + size_t len, + const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, + const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, + void *result) { gcry_cipher_hd_t handle; char tmp[len]; @@ -156,9 +156,9 @@ GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t len, */ ssize_t GNUNET_CRYPTO_symmetric_decrypt (const void *block, size_t size, - const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, - const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, - void *result) + const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, + const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, + void *result) { gcry_cipher_hd_t handle; char tmp[size]; diff --git a/src/util/test_crypto_symmetric.c b/src/util/test_crypto_symmetric.c index 90214a4b5..b0321e8ef 100644 --- a/src/util/test_crypto_symmetric.c +++ b/src/util/test_crypto_symmetric.c @@ -107,9 +107,10 @@ verifyCrypto () memcpy (key.twofish_key, raw_key_twofish, GNUNET_CRYPTO_AES_KEY_LENGTH); if (GNUNET_CRYPTO_AES_KEY_LENGTH != GNUNET_CRYPTO_symmetric_encrypt (plain, GNUNET_CRYPTO_AES_KEY_LENGTH, &key, - (const struct - GNUNET_CRYPTO_SymmetricInitializationVector *) - "testtesttesttest", result)) + (const struct + GNUNET_CRYPTO_SymmetricInitializationVector *) + "testtesttesttesttesttesttesttest", + result)) { printf ("Wrong return value from encrypt block.\n"); ret = 1; @@ -131,7 +132,7 @@ verifyCrypto () GNUNET_CRYPTO_symmetric_decrypt (result, GNUNET_CRYPTO_AES_KEY_LENGTH, &key, (const struct GNUNET_CRYPTO_SymmetricInitializationVector *) - "testtesttesttest", res)) + "testtesttesttesttesttesttesttest", res)) { printf ("Wrong return value from decrypt block.\n"); ret = 1; -- 2.25.1