mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Fix representation of mod-random output
mbedtls_mpi_mod_raw_random() and mbedtls_mpi_mod_random() were producing output in the Montgomery representation, instead of obeying the representation chosen in the modulus structure. Fix this. Duplicate the test cases for mod-random output to have separate test cases for each representation. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -215,7 +215,7 @@ int mbedtls_mpi_mod_raw_random( mbedtls_mpi_uint *X,
|
||||
int ret = mbedtls_mpi_core_random( X, min, N->p, N->limbs, f_rng, p_rng );
|
||||
if( ret != 0 )
|
||||
return( ret );
|
||||
return( mbedtls_mpi_mod_raw_to_mont_rep( X, N ) );
|
||||
return( mbedtls_mpi_mod_raw_canonical_to_modulus_rep( X, N ) );
|
||||
}
|
||||
|
||||
/* END MERGE SLOT 6 */
|
||||
|
Reference in New Issue
Block a user