From d8c003f6cc04b2ef6913635f6b3e2da2abab6c64 Mon Sep 17 00:00:00 2001 From: Lena Boeckmann Date: Tue, 12 Mar 2024 14:43:56 +0100 Subject: [PATCH] examples/psa_crypto: Fix modules to run ECDSA on SEs --- examples/psa_crypto/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/psa_crypto/main.c b/examples/psa_crypto/main.c index b7f48b76a102..db592e1c0b61 100644 --- a/examples/psa_crypto/main.c +++ b/examples/psa_crypto/main.c @@ -27,7 +27,8 @@ extern psa_status_t example_cipher_aes_128(void); #if IS_USED(MODULE_PSA_MAC) extern psa_status_t example_hmac_sha256(void); #endif -#if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_P256R1) +#if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_P256R1) || \ + IS_USED(MODULE_PSA_SECURE_ELEMENT_ATECCX08A_ECC_P256) extern psa_status_t example_ecdsa_p256(void); #endif #if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_ED25519) @@ -43,7 +44,7 @@ extern psa_status_t example_cipher_aes_128_sec_se(void); #if IS_USED(MODULE_PSA_MAC) extern psa_status_t example_hmac_sha256_sec_se(void); #endif /* MODULE_PSA_MAC */ -#if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_P256R1) +#if IS_USED(MODULE_PSA_SECURE_ELEMENT_ATECCX08A_ECC_P256) extern psa_status_t example_ecdsa_p256_sec_se(void); #endif /* MODULE_PSA_ASYMMETRIC_ECC_P256R1 */ #endif /* MULTIPLE_SE */ @@ -81,7 +82,8 @@ int main(void) } #endif -#if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_P256R1) +#if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_P256R1) || \ + IS_USED(MODULE_PSA_SECURE_ELEMENT_ATECCX08A_ECC_P256) start = ztimer_now(ZTIMER_USEC); status = example_ecdsa_p256(); printf("ECDSA took %d us\n", (int)(ztimer_now(ZTIMER_USEC) - start)); @@ -122,7 +124,7 @@ int main(void) } #endif /* MODULE_PSA_CIPHER */ -#if IS_USED(MODULE_PSA_ASYMMETRIC_ECC_P256R1) +#if IS_USED(MODULE_PSA_SECURE_ELEMENT_ATECCX08A_ECC_P256) start = ztimer_now(ZTIMER_USEC); status = example_ecdsa_p256_sec_se(); printf("ECDSA took %d us\n", (int)(ztimer_now(ZTIMER_USEC) - start)); @@ -130,7 +132,7 @@ int main(void) failed = true; printf("ECDSA failed: %s\n", psa_status_to_humanly_readable(status)); } -#endif /* MODULE_PSA_ASYMMETRIC_ECC_P256R1 */ +#endif /* MODULE_PSA_SECURE_ELEMENT_ATECCX08A_ECC_P256 */ #endif /* MULTIPLE_SE */ ztimer_release(ZTIMER_USEC);