mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-28 08:37:25 +00:00
Generalize representation handling in mbedtls_mpi_mod_read
Call mbedtls_mpi_mod_raw_canonical_to_modulus_rep instead of assuming that anything that isn't MBEDTLS_MPI_MOD_REP_MONTGOMERY is canonical. mbedtls_mpi_mod_write should get the same treatment, but I'm holding off until https://github.com/Mbed-TLS/mbedtls/issues/6679 is done. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
eb2e77f617
commit
e655479528
@ -248,8 +248,7 @@ int mbedtls_mpi_mod_read( mbedtls_mpi_mod_residue *r,
|
||||
|
||||
r->limbs = m->limbs;
|
||||
|
||||
if( m->int_rep == MBEDTLS_MPI_MOD_REP_MONTGOMERY )
|
||||
ret = mbedtls_mpi_mod_raw_to_mont_rep( r->p, m );
|
||||
ret = mbedtls_mpi_mod_raw_canonical_to_modulus_rep( r->p, m );
|
||||
|
||||
cleanup:
|
||||
return ( ret );
|
||||
|
Loading…
x
Reference in New Issue
Block a user