mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-04 22:19:05 +00:00
Merge pull request #7725 from minosgalanakis/ecp/7268_add_optimised_reduction_setup_3
[Bignum] Add optimised reduction setup
This commit is contained in:
commit
3048c8c906
9 changed files with 175 additions and 126 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue