mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-18 17:14:12 +03:00
Merge pull request #7725 from minosgalanakis/ecp/7268_add_optimised_reduction_setup_3
[Bignum] Add optimised reduction setup
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