test: driver-only: fix disparities in ECP

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2023-01-18 13:59:30 +01:00
parent 00d3e96042
commit 4682948c1e
2 changed files with 5 additions and 2 deletions

View file

@ -166,7 +166,6 @@ TASKS = {
# they will be removed by upcoming work # they will be removed by upcoming work
'psa_crypto_se_driver_hal', # #6856 'psa_crypto_se_driver_hal', # #6856
'random', # #6856 'random', # #6856
'ecp', # #6856
'pk', # #6857 'pk', # #6857
'x509parse', # #6858 'x509parse', # #6858
'x509write', # #6858 'x509write', # #6858

View file

@ -811,7 +811,7 @@ exit:
} }
/* END_CASE */ /* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ECDH_C:MBEDTLS_ECDSA_C */ /* BEGIN_CASE */
void mbedtls_ecp_group_metadata(int id, int bit_size, int crv_type, void mbedtls_ecp_group_metadata(int id, int bit_size, int crv_type,
char *P, char *A, char *B, char *P, char *A, char *B,
char *G_x, char *G_y, char *N, char *G_x, char *G_y, char *N,
@ -903,9 +903,13 @@ void mbedtls_ecp_group_metadata(int id, int bit_size, int crv_type,
// Check curve type, and if it can be used for ECDH/ECDSA // Check curve type, and if it can be used for ECDH/ECDSA
TEST_EQUAL(mbedtls_ecp_get_type(&grp), crv_type); TEST_EQUAL(mbedtls_ecp_get_type(&grp), crv_type);
#if defined(MBEDTLS_ECDH_C)
TEST_EQUAL(mbedtls_ecdh_can_do(id), 1); TEST_EQUAL(mbedtls_ecdh_can_do(id), 1);
#endif
#if defined(MBEDTLS_ECDSA_C)
TEST_EQUAL(mbedtls_ecdsa_can_do(id), TEST_EQUAL(mbedtls_ecdsa_can_do(id),
crv_type == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS); crv_type == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS);
#endif
// Copy group and compare with original // Copy group and compare with original
TEST_EQUAL(mbedtls_ecp_group_copy(&grp_cpy, &grp), 0); TEST_EQUAL(mbedtls_ecp_group_copy(&grp_cpy, &grp), 0);