From 9892d1460705541f11df6659cfe104a67b794b5f Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Wed, 13 Nov 2024 19:27:31 +0000 Subject: [PATCH] Fix documentation for GCM decryption functions This commit fixes documentation specifying buffer overlap on GCM decryption functions. Signed-off-by: Harry Ramsey --- include/mbedtls/gcm.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/mbedtls/gcm.h b/include/mbedtls/gcm.h index 43d0aa7f1c..390ed4c6d0 100644 --- a/include/mbedtls/gcm.h +++ b/include/mbedtls/gcm.h @@ -178,9 +178,11 @@ int mbedtls_gcm_crypt_and_tag(mbedtls_gcm_context *ctx, * \brief This function performs a GCM authenticated decryption of a * buffer. * - * \note For decryption, the output buffer cannot be the same as - * input buffer. If the buffers overlap, the output buffer - * must trail at least 8 Bytes behind the input buffer. + * \note The output buffer \p output can be the same as the input + * buffer \p input. If \p output is greater than \p input, they + * cannot overlap. Implementations which require + * MBEDTLS_GCM_ALT to be enabled may not provide support for + * overlapping buffers. * * \param ctx The GCM context. This must be initialized. * \param length The length of the ciphertext to decrypt, which is also @@ -289,8 +291,8 @@ int mbedtls_gcm_update_ad(mbedtls_gcm_context *ctx, * \note The output buffer \p output can be the same as the input * buffer \p input. If \p output is greater than \p input, they * cannot overlap. Implementations which require - * MBEDTLS_GCM_ALT //no-check-names to be enabled may not - * provide support for overlapping buffers. + * MBEDTLS_GCM_ALT to be enabled may not provide support for + * overlapping buffers. * * \param ctx The GCM context. This must be initialized. * \param input The buffer holding the input data. If \p input_length