return GNUNET_SYSERR;
}
if (size !=
- GNUNET_CRYPTO_aes_decrypt (&n->decrypt_key,
- in,
+ GNUNET_CRYPTO_aes_decrypt (in,
(uint16_t) size,
- (const struct
+ &n->decrypt_key,
+ (const struct
GNUNET_CRYPTO_AesInitializationVector *) iv,
out))
{
/**
* Decrypt a given block with the sessionkey.
*
- * @param sessionkey the key used to decrypt
* @param block the data to decrypt, encoded as returned by encrypt
* @param size how big is the block?
+ * @param sessionkey the key used to decrypt
* @param iv the initialization vector to use
* @param result address to store the result at
* @return -1 on failure, size of decrypted block on success
*/
-int GNUNET_CRYPTO_aes_decrypt (const struct GNUNET_CRYPTO_AesSessionKey
- *sessionkey, const void *block, uint16_t size,
- const struct
- GNUNET_CRYPTO_AesInitializationVector *iv,
+int GNUNET_CRYPTO_aes_decrypt (const void *block, uint16_t size,
+ const struct GNUNET_CRYPTO_AesSessionKey *sessionkey,
+ const struct GNUNET_CRYPTO_AesInitializationVector *iv,
void *result);
/**
* Decrypt a given block with the sessionkey.
- * @param sessionkey the key used to decrypt
+ *
* @param block the data to decrypt, encoded as returned by encrypt
* @param size the size of the block to decrypt
+ * @param sessionkey the key used to decrypt
* @param iv the initialization vector to use, use INITVALUE
* for streams.
* @param result address to store the result at
* @return -1 on failure, size of decrypted block on success
*/
int
-GNUNET_CRYPTO_aes_decrypt (const struct GNUNET_CRYPTO_AesSessionKey
- *sessionkey, const void *block, uint16_t size,
- const struct GNUNET_CRYPTO_AesInitializationVector
+GNUNET_CRYPTO_aes_decrypt (const void *block, uint16_t size,
+ const struct GNUNET_CRYPTO_AesSessionKey
+ *sessionkey,
+ const struct GNUNET_CRYPTO_AesInitializationVector
*iv, void *result)
{
gcry_cipher_hd_t handle;
printf ("symciphertest failed: encryptBlock returned %d\n", size);
return 1;
}
- size = GNUNET_CRYPTO_aes_decrypt (&key,
- result, size,
- (const struct
+ size = GNUNET_CRYPTO_aes_decrypt (result, size,
+ &key,
+ (const struct
GNUNET_CRYPTO_AesInitializationVector *)
INITVALUE, res);
if (strlen (TESTSTRING) + 1 != size)
res = GNUNET_malloc (GNUNET_CRYPTO_AES_KEY_LENGTH);
if (GNUNET_CRYPTO_AES_KEY_LENGTH !=
- GNUNET_CRYPTO_aes_decrypt (&key,
- result,
+ GNUNET_CRYPTO_aes_decrypt (result,
GNUNET_CRYPTO_AES_KEY_LENGTH,
- (const struct
+ &key,
+ (const struct
GNUNET_CRYPTO_AesInitializationVector *)
"testtesttesttest", res))
{
return 1;
}
- size = GNUNET_CRYPTO_aes_decrypt (&weak_key, result, size, &INITVALUE, res);
+ size = GNUNET_CRYPTO_aes_decrypt (result, size, &weak_key, &INITVALUE, res);
if ((strlen (WEAK_KEY_TESTSTRING) + 1) != size)
{