test: disable BIGNUM support on the test ecc_no_bignum component
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
06aebe4995
commit
660bbf2470
3 changed files with 15 additions and 2 deletions
|
@ -180,7 +180,9 @@ int main(int argc, char *argv[])
|
|||
char buf[1024];
|
||||
int i;
|
||||
char *p, *q;
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
mbedtls_mpi N, P, Q, D, E, DP, DQ, QP;
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
mbedtls_entropy_context entropy;
|
||||
mbedtls_ctr_drbg_context ctr_drbg;
|
||||
const char *pers = "gen_key";
|
||||
|
@ -191,10 +193,11 @@ int main(int argc, char *argv[])
|
|||
/*
|
||||
* Set to sane values
|
||||
*/
|
||||
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
mbedtls_mpi_init(&N); mbedtls_mpi_init(&P); mbedtls_mpi_init(&Q);
|
||||
mbedtls_mpi_init(&D); mbedtls_mpi_init(&E); mbedtls_mpi_init(&DP);
|
||||
mbedtls_mpi_init(&DQ); mbedtls_mpi_init(&QP);
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
|
||||
mbedtls_pk_init(&key);
|
||||
mbedtls_ctr_drbg_init(&ctr_drbg);
|
||||
|
@ -409,9 +412,11 @@ exit:
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
mbedtls_mpi_free(&N); mbedtls_mpi_free(&P); mbedtls_mpi_free(&Q);
|
||||
mbedtls_mpi_free(&D); mbedtls_mpi_free(&E); mbedtls_mpi_free(&DP);
|
||||
mbedtls_mpi_free(&DQ); mbedtls_mpi_free(&QP);
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
|
||||
mbedtls_pk_free(&key);
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
|
|
|
@ -203,7 +203,9 @@ int main(int argc, char *argv[])
|
|||
mbedtls_ctr_drbg_context ctr_drbg;
|
||||
|
||||
mbedtls_pk_context key;
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
mbedtls_mpi N, P, Q, D, E, DP, DQ, QP;
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
|
||||
/*
|
||||
* Set to sane values
|
||||
|
@ -225,9 +227,11 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
mbedtls_mpi_init(&N); mbedtls_mpi_init(&P); mbedtls_mpi_init(&Q);
|
||||
mbedtls_mpi_init(&D); mbedtls_mpi_init(&E); mbedtls_mpi_init(&DP);
|
||||
mbedtls_mpi_init(&DQ); mbedtls_mpi_init(&QP);
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
|
||||
if (argc < 2) {
|
||||
usage:
|
||||
|
@ -423,9 +427,11 @@ exit:
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
mbedtls_mpi_free(&N); mbedtls_mpi_free(&P); mbedtls_mpi_free(&Q);
|
||||
mbedtls_mpi_free(&D); mbedtls_mpi_free(&E); mbedtls_mpi_free(&DP);
|
||||
mbedtls_mpi_free(&DQ); mbedtls_mpi_free(&QP);
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
|
||||
mbedtls_pk_free(&key);
|
||||
|
||||
|
|
|
@ -2673,7 +2673,8 @@ config_psa_crypto_config_accel_ecc_no_bignum() {
|
|||
scripts/config.py unset MBEDTLS_ECJPAKE_C
|
||||
# Disable ECP module (entirely)
|
||||
scripts/config.py unset MBEDTLS_ECP_C
|
||||
# TODO: bignum
|
||||
# Also disable bignum
|
||||
scripts/config.py unset MBEDTLS_BIGNUM_C
|
||||
fi
|
||||
|
||||
# Disable all the features that auto-enable ECP_LIGHT (see build_info.h)
|
||||
|
@ -2763,6 +2764,7 @@ component_test_psa_crypto_config_accel_ecc_no_bignum () {
|
|||
not grep mbedtls_ecp_ library/ecp.o
|
||||
not grep mbedtls_rsa_ library/rsa.o
|
||||
not grep mbedtls_dhm_ library/dhm.o
|
||||
not grep mbedtls_mpi_ library/bignum.o
|
||||
|
||||
# Run the tests
|
||||
# -------------
|
||||
|
|
Loading…
Reference in a new issue