Skip to content

Commit

Permalink
test: drivers: rand32: add overlay for PSA Crypto Random entropy
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Valerio Setti <[email protected]>
  • Loading branch information
superna9999 authored and carlescufi committed Oct 27, 2022
1 parent 7266f82 commit 62dc712
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/crypto/rand32/entropy_psa_crypto.overlay
Original file line number Diff line number Diff line change
@@ -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";
};
};
8 changes: 8 additions & 0 deletions tests/crypto/rand32/prj_hw_random_psa_crypto.conf
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests/crypto/rand32/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 62dc712

Please sign in to comment.