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 <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2021-05-26 09:46:09 +02:00
parent 266694ea42
commit 5905f91ba1

View File

@ -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 * \param mode The operation to perform: #MBEDTLS_CCM_ENCRYPT or
* #MBEDTLS_CCM_DECRYPT or #MBEDTLS_CCM_STAR_ENCRYPT or * #MBEDTLS_CCM_DECRYPT or #MBEDTLS_CCM_STAR_ENCRYPT or
* #MBEDTLS_CCM_STAR_DECRYPT. * #MBEDTLS_CCM_STAR_DECRYPT.
* \param iv The initialization vector. This must be a readable buffer of * \param iv The initialization vector. This must be a readable buffer
* at least \p iv_len Bytes. * of at least \p iv_len Bytes.
* \param iv_len The length of the IV. * \param iv_len The length of the IV in bytes.
* \param ad_len The length of the additional data in bytes. * \param total_ad_len The total length of additional data in bytes.
* \param body_len The length of the data to encrypt or decrypt in bytes. * \param total_input_len The total length of input data to encrypt or decrypt
* in bytes.
* *
* \return \c 0 on success. * \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 mbedtls_ccm_starts( mbedtls_ccm_context *ctx,
int mode, int mode,
const unsigned char *iv, const unsigned char *iv,
size_t iv_len, size_t iv_len,
size_t ad_len, size_t total_ad_len,
size_t body_len ); size_t total_input_len );
/** /**
* \brief This function feeds an input buffer as associated data * \brief This function feeds an input buffer as associated data