mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-11-27 11:41:17 +03:00
bignum_mod: Refactored mbedtls_mpi_mod_modulus_setup()
This patch removes the `int_rep` input parameter for modular setup, aiming to align it with the optred variant. Test and test-suite helper functions have been updated accordingly. Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
@@ -99,7 +99,18 @@ int mbedtls_test_read_mpi_modulus(mbedtls_mpi_mod_modulus *N,
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
ret = mbedtls_mpi_mod_modulus_setup(N, p, limbs, int_rep);
|
||||
|
||||
switch (int_rep) {
|
||||
case MBEDTLS_MPI_MOD_REP_MONTGOMERY:
|
||||
ret = mbedtls_mpi_mod_modulus_setup(N, p, limbs);
|
||||
break;
|
||||
case MBEDTLS_MPI_MOD_REP_OPT_RED:
|
||||
ret = mbedtls_mpi_mod_optred_modulus_setup(N, p, limbs, NULL);
|
||||
break;
|
||||
default:
|
||||
ret = MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
|
||||
break;
|
||||
}
|
||||
if (ret != 0) {
|
||||
mbedtls_free(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user