Add note about aliasing of operands for mbedtls_mpi_mod_raw_add()

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove 2022-11-24 15:54:16 +00:00
parent 54d87bf5c2
commit abddad4af8

View file

@ -158,15 +158,19 @@ int mbedtls_mpi_mod_raw_write( const mbedtls_mpi_uint *A,
/**
* \brief Perform a known-size modular addition.
*
* Calculate `A + B modulo N` where \p A, \p B, and \p N have the same size.
* Calculate `A + B modulo N`.
*
* The number of limbs in each operand, and the result, is given by the
* modulus \p N.
*
* \p X may be aliased to \p A or \p B, or even both, but may not overlap
* either otherwise.
*
* \param[out] X The result of the modular addition.
* \param[in] A Little-endian presentation of the left operand. This
* must be smaller than \p N, and have the same number of
* limbs.
* must be smaller than \p N.
* \param[in] B Little-endian presentation of the right operand. This
* must be smaller than \p N, and have the same number of
* limbs.
* must be smaller than \p N.
* \param[in] N The address of the modulus.
*/
void mbedtls_mpi_mod_raw_add( mbedtls_mpi_uint *X,