Change the ecp_mod_p192_raw to be testable

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2023-01-25 17:57:36 +01:00
parent b5bba497fe
commit deece2bb65
No known key found for this signature in database
GPG key ID: F072ACA227ACD71D
2 changed files with 11 additions and 2 deletions

View file

@ -4570,7 +4570,8 @@ static int ecp_group_load(mbedtls_ecp_group *grp,
/* Forward declarations */
#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
static int ecp_mod_p192(mbedtls_mpi *);
static int ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn);
MBEDTLS_STATIC_TESTABLE
int ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn);
#endif
#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
static int ecp_mod_p224(mbedtls_mpi *);
@ -4906,7 +4907,8 @@ cleanup:
return ret;
}
static int ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn)
MBEDTLS_STATIC_TESTABLE
int ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn)
{
mbedtls_mpi_uint c = 0, last_carry[WIDTH] = { 0 };
mbedtls_mpi_uint *p, *end;

View file

@ -76,6 +76,13 @@ int mbedtls_ecp_gen_privkey_mx(size_t n_bits,
#endif /* MBEDTLS_ECP_MONTGOMERY_ENABLED */
#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
MBEDTLS_STATIC_TESTABLE
int ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn);
#endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_ECP_C */
#endif /* MBEDTLS_ECP_INVASIVE_H */