From 441907ec30a837e20bdd4cd7d6f4ec9e0b3928f0 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 13 Apr 2021 16:09:32 +0200 Subject: [PATCH] Remove alignment requirement for mbedtls_gcm_update: documentation Signed-off-by: Gilles Peskine --- ChangeLog.d/gcm-update.txt | 4 ++++ include/mbedtls/cipher.h | 5 ----- include/mbedtls/gcm.h | 7 +------ 3 files changed, 5 insertions(+), 11 deletions(-) create mode 100644 ChangeLog.d/gcm-update.txt diff --git a/ChangeLog.d/gcm-update.txt b/ChangeLog.d/gcm-update.txt new file mode 100644 index 000000000..4511fec32 --- /dev/null +++ b/ChangeLog.d/gcm-update.txt @@ -0,0 +1,4 @@ +Features + * The multi-part GCM interface (mbedtls_gcm_update() or + mbedtls_cipher_update()) no longer requires the size of partial inputs to + be a multiple of 16. diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h index bfc911fc1..eaa49b1ff 100644 --- a/include/mbedtls/cipher.h +++ b/include/mbedtls/cipher.h @@ -727,11 +727,6 @@ int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx, * Exception: For MBEDTLS_MODE_ECB, expects a single block * in size. For example, 16 Bytes for AES. * - * \note If the underlying cipher is used in GCM mode, all calls - * to this function, except for the last one before - * mbedtls_cipher_finish(), must have \p ilen as a - * multiple of the block size of the cipher. - * * \param ctx The generic cipher context. This must be initialized and * bound to a key. * \param input The buffer holding the input data. This must be a diff --git a/include/mbedtls/gcm.h b/include/mbedtls/gcm.h index 6b673616f..8a26ebb96 100644 --- a/include/mbedtls/gcm.h +++ b/include/mbedtls/gcm.h @@ -249,17 +249,12 @@ int mbedtls_gcm_starts( mbedtls_gcm_context *ctx, * \brief This function feeds an input buffer into an ongoing GCM * encryption or decryption operation. * - * ` The function expects input to be a multiple of 16 - * 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. * * \param ctx The GCM context. This must be initialized. - * \param length The length of the input data. This must be a multiple of - * 16 except in the last call before mbedtls_gcm_finish(). + * \param length The length of the input data. * \param input The buffer holding the input data. If \p length is greater * than zero, this must be a readable buffer of at least that * size in Bytes.