From 4782823ec3ae1af9a9437bebcf9da1710514e1e7 Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Tue, 20 Sep 2022 13:51:50 +0100 Subject: [PATCH] Ensure we explicitly document the modulus for fixed-width arithmetic Signed-off-by: Tom Cosgrove --- library/bignum_core.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/bignum_core.h b/library/bignum_core.h index 2b3b8b6197..cbeab244c6 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -167,6 +167,8 @@ int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *A, * return carry; * ``` * + * This function operates modulo `2^(biL*limbs)`. + * * \param[in,out] X The pointer to the (little-endian) array * representing the bignum to accumulate onto. * \param[in] A The pointer to the (little-endian) array @@ -217,6 +219,8 @@ mbedtls_mpi_uint mbedtls_mpi_core_sub( mbedtls_mpi_uint *X, * \p X may be aliased to \p A (when \p X_limbs == \p A_limbs), but may not * otherwise overlap. * + * This function operates modulo `2^(biL*X_limbs)`. + * * \param[in,out] X The pointer to the (little-endian) array * representing the bignum to accumulate onto. * \param X_limbs The number of limbs of \p X. This must be