From 5905f91ba126936084b634d0127784b16670ce6a Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Wed, 26 May 2021 09:46:09 +0200 Subject: [PATCH] Improve mbedtls_ccm_starts() description Change from `body` to `input` to refer to the input data. Add prefix total_ to the new length parameters to ease refering to them in the documentation of the other multi-part APIs. Add error code documentation. Signed-off-by: Ronald Cron --- include/mbedtls/ccm.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/include/mbedtls/ccm.h b/include/mbedtls/ccm.h index 0fc8ae4505..acb1482f40 100644 --- a/include/mbedtls/ccm.h +++ b/include/mbedtls/ccm.h @@ -301,20 +301,25 @@ int mbedtls_ccm_star_auth_decrypt( mbedtls_ccm_context *ctx, size_t length, * \param mode The operation to perform: #MBEDTLS_CCM_ENCRYPT or * #MBEDTLS_CCM_DECRYPT or #MBEDTLS_CCM_STAR_ENCRYPT or * #MBEDTLS_CCM_STAR_DECRYPT. - * \param iv The initialization vector. This must be a readable buffer of - * at least \p iv_len Bytes. - * \param iv_len The length of the IV. - * \param ad_len The length of the additional data in bytes. - * \param body_len The length of the data to encrypt or decrypt in bytes. + * \param iv The initialization vector. This must be a readable buffer + * of at least \p iv_len Bytes. + * \param iv_len The length of the IV in bytes. + * \param total_ad_len The total length of additional data in bytes. + * \param total_input_len The total length of input data to encrypt or decrypt + * in bytes. * * \return \c 0 on success. + * \return \#MBEDTLS_ERR_CCM_BAD_INPUT on failure: + * \p iv_len is invalid (lower than \c 7 or greater than + * \c 13), + * \p total_ad_len is greater than \c 0xFF00. */ int mbedtls_ccm_starts( mbedtls_ccm_context *ctx, int mode, const unsigned char *iv, size_t iv_len, - size_t ad_len, - size_t body_len ); + size_t total_ad_len, + size_t total_input_len ); /** * \brief This function feeds an input buffer as associated data