Change the ecp_mod_p521_raw to be testable

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2023-02-01 14:02:16 +01:00
parent 8450ab9c60
commit 2cb630edee
No known key found for this signature in database
GPG Key ID: FEE76C0CF8C6267D
2 changed files with 12 additions and 1 deletions

View File

@ -4584,6 +4584,8 @@ static int ecp_mod_p384(mbedtls_mpi *);
#endif
#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
static int ecp_mod_p521(mbedtls_mpi *);
MBEDTLS_STATIC_TESTABLE
int ecp_mod_p521_raw(mbedtls_mpi_uint *N_p, size_t N_n);
#endif
#define NIST_MODP(P) grp->modp = ecp_mod_ ## P;
@ -5207,7 +5209,9 @@ static int ecp_mod_p521(mbedtls_mpi *N)
cleanup:
return ret;
}
static int ecp_mod_p521_raw(mbedtls_mpi_uint *N_p, size_t N_n)
MBEDTLS_STATIC_TESTABLE
int ecp_mod_p521_raw(mbedtls_mpi_uint *N_p, size_t N_n)
{
mbedtls_mpi_uint carry = 0;

View File

@ -95,6 +95,13 @@ int mbedtls_ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn);
#endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */
#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
MBEDTLS_STATIC_TESTABLE
int ecp_mod_p521_raw(mbedtls_mpi_uint *N_p, size_t N_n);
#endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_ECP_C */
#endif /* MBEDTLS_ECP_INVASIVE_H */