mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-02 16:21:20 +00:00
bignum_mod: Updated optred_modulus_setup
to use function input.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
c6e68ed85d
commit
be1bf15f76
library
@ -88,7 +88,7 @@ void mbedtls_mpi_mod_modulus_free(mbedtls_mpi_mod_modulus *N)
|
||||
N->rep.mont.mm = 0;
|
||||
break;
|
||||
case MBEDTLS_MPI_MOD_REP_OPT_RED:
|
||||
mbedtls_free(N->rep.ored);
|
||||
N->rep.ored.modp = NULL;
|
||||
break;
|
||||
case MBEDTLS_MPI_MOD_REP_INVALID:
|
||||
break;
|
||||
@ -166,10 +166,10 @@ int mbedtls_mpi_mod_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
||||
int mbedtls_mpi_mod_optred_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
||||
const mbedtls_mpi_uint *p,
|
||||
size_t p_limbs,
|
||||
mbedtls_mpi_opt_red_struct *ored)
|
||||
int (*modp)(mbedtls_mpi *))
|
||||
{
|
||||
standard_modulus_setup(N, p, p_limbs, MBEDTLS_MPI_MOD_REP_OPT_RED);
|
||||
N->rep.ored = ored;
|
||||
N->rep.ored.modp = modp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -214,14 +214,14 @@ int mbedtls_mpi_mod_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
||||
* not be modified in any way until after
|
||||
* mbedtls_mpi_mod_modulus_free() is called.
|
||||
* \param p_limbs The number of limbs of \p p.
|
||||
* \param ored The optimized reduction structure to use. \p p.
|
||||
* \param modp A pointer to the optimised reduction function to use. \p p.
|
||||
*
|
||||
* \return \c 0 if successful.
|
||||
*/
|
||||
int mbedtls_mpi_mod_optred_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
||||
const mbedtls_mpi_uint *p,
|
||||
size_t p_limbs,
|
||||
mbedtls_mpi_opt_red_struct *ored);
|
||||
int (*modp)(mbedtls_mpi *));
|
||||
|
||||
/** Free elements of a modulus structure.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user