Add an explicit mbedtls_mpi_core_montmul_working_limbs() function

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove 2022-12-12 17:06:27 +00:00
parent 30f3b4d601
commit 28ff92cc3a
5 changed files with 38 additions and 3 deletions

View file

@ -178,6 +178,10 @@ void mbedtls_mpi_mod_raw_sub( mbedtls_mpi_uint *X,
* \brief Returns the number of limbs of working memory required for
* a call to `mbedtls_mpi_mod_raw_inv_prime()`.
*
* \note This will always be at least
* `mbedtls_mpi_core_montmul_working_limbs(AN_limbs)`,
* i.e. sufficient for a call to `mbedtls_mpi_core_montmul()`.
*
* \param AN_limbs The number of limbs in the input `A` and the modulus `N`
* (they must be the same size) that will be given to
* `mbedtls_mpi_mod_raw_inv_prime()`.