1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-06-05 06:16:25 +08:00

Update GCM buffer overlap documentation

This commit updates GCM buffer overlap documentation to explicitly
support overlapping encryption/decryption buffers for GCM.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit is contained in:
Harry Ramsey 2024-11-07 09:20:38 +00:00
parent 5098d0474a
commit c7b1a9099a

View File

@ -115,10 +115,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
@ -287,9 +286,11 @@ int mbedtls_gcm_update_ad(mbedtls_gcm_context *ctx,
* to this function during an operation, then it is
* correct to use \p output_size = \p input_length.
*
* \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 input The buffer holding the input data. If \p input_length