From 62dc712a500173cdb95b198b722b8392f20dc160 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Tue, 5 Jul 2022 11:15:27 +0200 Subject: [PATCH] test: drivers: rand32: add overlay for PSA Crypto Random entropy This adds an overlay DT & config to enable the PSA Crypto Random entropy driver to get random bytes from TFM. Signed-off-by: Neil Armstrong Signed-off-by: Valerio Setti --- tests/crypto/rand32/entropy_psa_crypto.overlay | 16 ++++++++++++++++ .../crypto/rand32/prj_hw_random_psa_crypto.conf | 8 ++++++++ tests/crypto/rand32/testcase.yaml | 4 ++++ 3 files changed, 28 insertions(+) create mode 100644 tests/crypto/rand32/entropy_psa_crypto.overlay create mode 100644 tests/crypto/rand32/prj_hw_random_psa_crypto.conf diff --git a/tests/crypto/rand32/entropy_psa_crypto.overlay b/tests/crypto/rand32/entropy_psa_crypto.overlay new file mode 100644 index 00000000000..bc4a4afc116 --- /dev/null +++ b/tests/crypto/rand32/entropy_psa_crypto.overlay @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,entropy = &rng_psa; + }; + + rng_psa: entropy_psa_crypto { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; diff --git a/tests/crypto/rand32/prj_hw_random_psa_crypto.conf b/tests/crypto/rand32/prj_hw_random_psa_crypto.conf new file mode 100644 index 00000000000..91638df0cf3 --- /dev/null +++ b/tests/crypto/rand32/prj_hw_random_psa_crypto.conf @@ -0,0 +1,8 @@ +CONFIG_ZTEST=y +CONFIG_ZTEST_NEW_API=y +CONFIG_LOG=y +CONFIG_ENTROPY_GENERATOR=y +CONFIG_HARDWARE_DEVICE_CS_GENERATOR=y +CONFIG_TFM_PARTITION_CRYPTO=y +CONFIG_TFM_CRYPTO_RNG_MODULE_ENABLED=y +CONFIG_ENTROPY_PSA_CRYPTO_RNG=y diff --git a/tests/crypto/rand32/testcase.yaml b/tests/crypto/rand32/testcase.yaml index 12bd7937321..b4e42931d7c 100644 --- a/tests/crypto/rand32/testcase.yaml +++ b/tests/crypto/rand32/testcase.yaml @@ -16,3 +16,7 @@ tests: filter: CONFIG_ENTROPY_HAS_DRIVER tags: crypto entropy random security min_ram: 16 + drivers.rand32.random_psa_crypto: + filter: CONFIG_BUILD_WITH_TFM + extra_args: DTC_OVERLAY_FILE=./entropy_psa_crypto.overlay CONF_FILE=prj_hw_random_psa_crypto.conf + tags: crypto entropy random security psa-crypto