diff --git a/include/mbedtls/gcm.h b/include/mbedtls/gcm.h index 1ad0e9e96f..ae6d4f36c8 100644 --- a/include/mbedtls/gcm.h +++ b/include/mbedtls/gcm.h @@ -107,10 +107,9 @@ int mbedtls_gcm_setkey(mbedtls_gcm_context *ctx, /** * \brief This function performs GCM encryption or decryption of a buffer. * - * \note For encryption, the output buffer can be the same as the - * input buffer. 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. * * \warning When this function performs a decryption, it outputs the * authentication tag and does not verify that the data is @@ -243,9 +242,11 @@ int mbedtls_gcm_starts(mbedtls_gcm_context *ctx, * Bytes. Only the last call before calling * mbedtls_gcm_finish() can be less than 16 Bytes. * - * \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 //no-check-names 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 input data. This must be a multiple of