bignum_mod_raw: Added conversion methods for internal/public data representation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
9f1ecadc40
commit
5ad4a93596
2 changed files with 39 additions and 0 deletions
|
@ -127,7 +127,28 @@ int mbedtls_mpi_mod_raw_write( const mbedtls_mpi_uint *A,
|
|||
/* END MERGE SLOT 6 */
|
||||
|
||||
/* BEGIN MERGE SLOT 7 */
|
||||
int mbedtls_mpi_mod_raw_conv_inv( mbedtls_mpi_uint *X,
|
||||
const mbedtls_mpi_mod_modulus *modulus )
|
||||
{
|
||||
mbedtls_mpi_uint one = 1;
|
||||
mbedtls_mpi T;
|
||||
mbedtls_mpi_init( &T );
|
||||
mbedtls_mpi_core_montmul( X, X, &one, 1, m->p, m->limbs,
|
||||
m->rep.mont.mm, T.p );
|
||||
mbedtls_mpi_free( &T );
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
int mbedtls_mpi_mod_raw_conv_fwd( mbedtls_mpi_uint *X,
|
||||
const mbedtls_mpi_mod_modulus *modulus )
|
||||
{
|
||||
mbedtls_mpi T;
|
||||
mbedtls_mpi_init( &T );
|
||||
mbedtls_mpi_core_montmul( X, X, m->rep.mont.rr, 1, m->p, m->limbs,
|
||||
m->rep.mont.mm, T.p );
|
||||
mbedtls_mpi_free( &T );
|
||||
return( 0 );
|
||||
}
|
||||
/* END MERGE SLOT 7 */
|
||||
|
||||
/* BEGIN MERGE SLOT 8 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue