From ffb6efd3834a3b0a48f4fa572fb7cb4f3236a4a0 Mon Sep 17 00:00:00 2001 From: Mathieu Briand Date: Wed, 7 Feb 2018 10:29:27 +0100 Subject: [PATCH] Fix doxygen documentation for CCM encryption Fix valid tag length values for mbedtls_ccm_encrypt_and_tag() function. Add valid value ranges for mbedtls_ccm_auth_decrypt() parameters. Signed-off-by: Mathieu Briand --- include/mbedtls/ccm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/ccm.h b/include/mbedtls/ccm.h index 5a9ee4a1c..630b7fdf6 100644 --- a/include/mbedtls/ccm.h +++ b/include/mbedtls/ccm.h @@ -105,7 +105,7 @@ void mbedtls_ccm_free( mbedtls_ccm_context *ctx ); * Must be at least \p length Bytes wide. * \param tag The buffer holding the tag. * \param tag_len The length of the tag to generate in Bytes: - * 4, 6, 8, 10, 14 or 16. + * 4, 6, 8, 10, 12, 14 or 16. * * \note The tag is written to a separate buffer. To concatenate * the \p tag with the \p output, as done in RFC-3610: @@ -131,10 +131,13 @@ int mbedtls_ccm_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length, * \param iv_len The length of the IV in Bytes: 7, 8, 9, 10, 11, 12, or 13. * \param add The additional data field. * \param add_len The length of additional data in Bytes. + * Must be less than 2^16 - 2^8. * \param input The buffer holding the input data. * \param output The buffer holding the output data. + * Must be at least \p length Bytes wide. * \param tag The buffer holding the tag. * \param tag_len The length of the tag in Bytes. + * 4, 6, 8, 10, 12, 14 or 16. * * \return 0 if successful and authenticated, or * #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match.