From 6cb2c84f120227755f51661fdaa2b98efd4677b1 Mon Sep 17 00:00:00 2001 From: Kareem Date: Tue, 16 May 2023 14:31:51 -0700 Subject: [PATCH] Update AES documentation to clarify block size requirement. Fix parameter ordering in wc_ChaCha20Poly1305_Decrypt documentation. --- doc/dox_comments/header_files/aes.h | 8 ++++++++ doc/dox_comments/header_files/chacha20_poly1305.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/dox_comments/header_files/aes.h b/doc/dox_comments/header_files/aes.h index 1b281ba51..3a9b974f9 100644 --- a/doc/dox_comments/header_files/aes.h +++ b/doc/dox_comments/header_files/aes.h @@ -136,8 +136,10 @@ int wc_AesCbcEncrypt(Aes* aes, byte* out, \param aes pointer to the AES object used to decrypt data. \param out pointer to the output buffer in which to store the plain text of the decrypted message. + size must be a multiple of AES_BLOCK_LENGTH, padded if necessary \param in pointer to the input buffer containing cipher text to be decrypted. + size must be a multiple of AES_BLOCK_LENGTH, padded if necessary \param sz size of input message. _Example_ @@ -176,7 +178,9 @@ int wc_AesCbcDecrypt(Aes* aes, byte* out, \param aes pointer to the AES object used to decrypt data \param out pointer to the output buffer in which to store the cipher text of the encrypted message + size must be a multiple of AES_BLOCK_LENGTH, padded if necessary \param in pointer to the input buffer containing plain text to be encrypted + size must be a multiple of AES_BLOCK_LENGTH, padded if necessary \param sz size of the input plain text _Example_ @@ -353,7 +357,9 @@ int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len); \param aes - pointer to the AES object used to encrypt data \param out pointer to the output buffer in which to store the cipher text + size must match in's size (sz) \param in pointer to the input buffer holding the message to encrypt + size must be a multiple of AES_BLOCK_LENGTH, padded if necessary \param sz length of the input message to encrypt \param iv pointer to the buffer containing the initialization vector \param ivSz length of the initialization vector @@ -403,7 +409,9 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, \param aes pointer to the AES object used to encrypt data \param out pointer to the output buffer in which to store the message text + size must match in's size (sz) \param in pointer to the input buffer holding the cipher text to decrypt + size must be a multiple of AES_BLOCK_LENGTH, padded if necessary \param sz length of the cipher text to decrypt \param iv pointer to the buffer containing the initialization vector \param ivSz length of the initialization vector diff --git a/doc/dox_comments/header_files/chacha20_poly1305.h b/doc/dox_comments/header_files/chacha20_poly1305.h index 6a8e59a7d..5a7f81950 100644 --- a/doc/dox_comments/header_files/chacha20_poly1305.h +++ b/doc/dox_comments/header_files/chacha20_poly1305.h @@ -97,7 +97,7 @@ int wc_ChaCha20Poly1305_Encrypt( byte plain[sizeof(cipher)]; int ret = wc_ChaCha20Poly1305_Decrypt(key, iv, inAAD, sizeof(inAAD), - cipher, sizeof(cipher), plain, authTag); + cipher, sizeof(cipher), authTag, plain); if(ret == MAC_CMP_FAILED_E) { // error during authentication