aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/crypto_aes.c')
-rw-r--r--src/util/crypto_aes.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/util/crypto_aes.c b/src/util/crypto_aes.c
index 8fa935d9f..6db932b5b 100644
--- a/src/util/crypto_aes.c
+++ b/src/util/crypto_aes.c
@@ -72,9 +72,9 @@ GNUNET_CRYPTO_aes_check_session_key (const struct GNUNET_CRYPTO_AesSessionKey
72 * @param result the output parameter in which to store the encrypted result 72 * @param result the output parameter in which to store the encrypted result
73 * @returns the size of the encrypted block, -1 for errors 73 * @returns the size of the encrypted block, -1 for errors
74 */ 74 */
75int 75ssize_t
76GNUNET_CRYPTO_aes_encrypt (const void *block, 76GNUNET_CRYPTO_aes_encrypt (const void *block,
77 uint16_t len, 77 size_t len,
78 const struct GNUNET_CRYPTO_AesSessionKey 78 const struct GNUNET_CRYPTO_AesSessionKey
79 *sessionkey, 79 *sessionkey,
80 const struct GNUNET_CRYPTO_AesInitializationVector 80 const struct GNUNET_CRYPTO_AesInitializationVector
@@ -88,7 +88,7 @@ GNUNET_CRYPTO_aes_encrypt (const void *block,
88 (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH))) 88 (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH)))
89 { 89 {
90 GNUNET_break (0); 90 GNUNET_break (0);
91 return GNUNET_SYSERR; 91 return -1;
92 } 92 }
93 GNUNET_assert (0 == gcry_cipher_open (&handle, 93 GNUNET_assert (0 == gcry_cipher_open (&handle,
94 GCRY_CIPHER_AES256, 94 GCRY_CIPHER_AES256,
@@ -115,8 +115,9 @@ GNUNET_CRYPTO_aes_encrypt (const void *block,
115 * @param result address to store the result at 115 * @param result address to store the result at
116 * @return -1 on failure, size of decrypted block on success 116 * @return -1 on failure, size of decrypted block on success
117 */ 117 */
118int 118ssize_t
119GNUNET_CRYPTO_aes_decrypt (const void *block, uint16_t size, 119GNUNET_CRYPTO_aes_decrypt (const void *block,
120 size_t size,
120 const struct GNUNET_CRYPTO_AesSessionKey 121 const struct GNUNET_CRYPTO_AesSessionKey
121 *sessionkey, 122 *sessionkey,
122 const struct GNUNET_CRYPTO_AesInitializationVector 123 const struct GNUNET_CRYPTO_AesInitializationVector
@@ -130,7 +131,7 @@ GNUNET_CRYPTO_aes_decrypt (const void *block, uint16_t size,
130 (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH))) 131 (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH)))
131 { 132 {
132 GNUNET_break (0); 133 GNUNET_break (0);
133 return GNUNET_SYSERR; 134 return -1;
134 } 135 }
135 GNUNET_assert (0 == gcry_cipher_open (&handle, 136 GNUNET_assert (0 == gcry_cipher_open (&handle,
136 GCRY_CIPHER_AES256, 137 GCRY_CIPHER_AES256,