Update name of mbedtls_mpi_montg_init()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
parent
2701deaa4b
commit
b7438d1f62
4 changed files with 7 additions and 7 deletions
|
@ -1547,7 +1547,7 @@ int mbedtls_mpi_mod_int( mbedtls_mpi_uint *r, const mbedtls_mpi *A, mbedtls_mpi_
|
|||
|
||||
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)
|
||||
|
|
|
@ -377,7 +377,7 @@ mbedtls_mpi_uint mbedtls_mpi_core_mla( mbedtls_mpi_uint *d, size_t d_len,
|
|||
/*
|
||||
* 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];
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ mbedtls_mpi_uint mbedtls_mpi_core_mla( mbedtls_mpi_uint *A, size_t A_limbs,
|
|||
*
|
||||
* \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 @@ mbedtls_mpi_uint mbedtls_mpi_montg_init( const mbedtls_mpi_uint *N );
|
|||
* 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.
|
||||
|
|
|
@ -2035,8 +2035,8 @@ void mpi_montg_init( char * input_N, char * input_mm )
|
|||
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 @@ void mpi_core_montmul( int limbs_AN4, int limbs_B4,
|
|||
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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue