Update name of mbedtls_mpi_montg_init()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
diff --git a/library/bignum.c b/library/bignum.c
index de61952..19d59be 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1547,7 +1547,7 @@
static void mpi_montg_init( mbedtls_mpi_uint *mm, const mbedtls_mpi *N )
{
- *mm = mbedtls_mpi_montg_init( N->p );
+ *mm = mbedtls_mpi_core_montmul_init( N->p );
}
/** Montgomery multiplication: A = A * B * R^-1 mod N (HAC 14.36)
diff --git a/library/bignum_core.c b/library/bignum_core.c
index bb6e7cd..fa7fc85 100644
--- a/library/bignum_core.c
+++ b/library/bignum_core.c
@@ -377,7 +377,7 @@
/*
* Fast Montgomery initialization (thanks to Tom St Denis).
*/
-mbedtls_mpi_uint mbedtls_mpi_montg_init( const mbedtls_mpi_uint *N )
+mbedtls_mpi_uint mbedtls_mpi_core_montmul_init( const mbedtls_mpi_uint *N )
{
mbedtls_mpi_uint x = N[0];
diff --git a/library/bignum_core.h b/library/bignum_core.h
index 49ea485..746c1d9 100644
--- a/library/bignum_core.h
+++ b/library/bignum_core.h
@@ -240,7 +240,7 @@
*
* \return The initialisation value for fast Montgomery modular multiplication
*/
-mbedtls_mpi_uint mbedtls_mpi_montg_init( const mbedtls_mpi_uint *N );
+mbedtls_mpi_uint mbedtls_mpi_core_montmul_init( const mbedtls_mpi_uint *N );
/**
* \brief Montgomery multiplication: X = A * B * R^-1 mod N (HAC 14.36)
@@ -260,7 +260,7 @@
* of limbs as \p A.
* \param[in] AN_limbs The number of limbs in \p X, \p A and \p N.
* \param mm The Montgomery constant for \p N: -N^-1 mod 2^biL.
- * This can be calculated by `mbedtls_mpi_montg_init()`.
+ * This can be calculated by `mbedtls_mpi_core_montmul_init()`.
* \param[in,out] T Temporary storage of size at least 2*AN_limbs+1 limbs.
* Its initial content is unused and
* its final content is indeterminate.
diff --git a/tests/suites/test_suite_mpi.function b/tests/suites/test_suite_mpi.function
index 71912b1..2a09fe4 100644
--- a/tests/suites/test_suite_mpi.function
+++ b/tests/suites/test_suite_mpi.function
@@ -2035,8 +2035,8 @@
TEST_EQUAL( 1, N.s );
TEST_EQUAL( 1, mm.s );
- /* mbedtls_mpi_montg_init() only returns a result, no error possible */
- mbedtls_mpi_uint result = mbedtls_mpi_montg_init( N.p );
+ /* mbedtls_mpi_core_montmul_init() only returns a result, no error possible */
+ mbedtls_mpi_uint result = mbedtls_mpi_core_montmul_init( N.p );
/* Check we got the correct result */
TEST_EQUAL( result, mm.p[0] );
@@ -2096,7 +2096,7 @@
TEST_EQUAL( 0, mbedtls_mpi_grow( &T, limbs_AN * 2 + 1 ) );
/* Calculate the Montgomery constant (this is unit tested separately) */
- mbedtls_mpi_uint mm = mbedtls_mpi_montg_init( N.p );
+ mbedtls_mpi_uint mm = mbedtls_mpi_core_montmul_init( N.p );
TEST_EQUAL( 0, mbedtls_mpi_grow( &R, limbs_AN ) ); /* ensure it's got the right number of limbs */