From d692ba4248c565c906cacdebb37840274e9444b4 Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Wed, 14 Dec 2022 09:53:45 +0000 Subject: [PATCH] Note that (as usual) for mbedtls_mpi_mod_inv() residues must be associated with the modulus Signed-off-by: Tom Cosgrove --- library/bignum_mod.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/bignum_mod.h b/library/bignum_mod.h index b2c36a978e..a708be6e9a 100644 --- a/library/bignum_mod.h +++ b/library/bignum_mod.h @@ -196,6 +196,9 @@ int mbedtls_mpi_mod_sub( mbedtls_mpi_mod_residue *X, /** * \brief Perform modular inversion of an MPI with respect to a modulus \p N. * + * \p A and \p X must be associated with the modulus \p N and will therefore + * have the same number of limbs as \p N. + * * \p X may be aliased to \p A. * * \warning Currently only supports prime moduli, but does not check for them.