Skip to content

Commit 0bcbd45

Browse files
AntonZmarlubos
authored andcommitted
nrf_security: CRACEN: Use HAS_HW_NRF_XXX naming convention
The presence of CRACEN HW peripheral now uses the same pattern as others (HAS_HW_NRF_CRACEN). Ref: NCSDK-32006 Signed-off-by: Anton Zyma <[email protected]>
1 parent a694b33 commit 0bcbd45

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

include/hw_unique_key.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" {
3030
#endif
3131
#include <zephyr/devicetree.h>
3232

33-
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_kmu) || defined(CONFIG_CRACEN_HW_PRESENT)
33+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_kmu) || defined(CONFIG_HAS_HW_NRF_CRACEN)
3434
#define HUK_HAS_KMU
3535
#endif
3636
#if defined(CONFIG_HAS_HW_NRF_CC310)
@@ -44,7 +44,7 @@ extern "C" {
4444
#define HUK_SIZE_WORDS 4
4545
#elif defined(HUK_HAS_CC312)
4646
#define HUK_SIZE_WORDS 8
47-
#elif defined(CONFIG_CRACEN_HW_PRESENT)
47+
#elif defined(CONFIG_HAS_HW_NRF_CRACEN)
4848
#define HUK_SIZE_WORDS 12
4949
#else
5050
#error "This library requires CryptoCell or Cracen to be available."

include/tfm/tfm_builtin_key_ids.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <nrf.h>
1111

12-
#if defined(NRF_CRACENCORE) || defined(CONFIG_CRACEN_HW_PRESENT)
12+
#if defined(NRF_CRACENCORE) || defined(CONFIG_HAS_HW_NRF_CRACEN)
1313

1414
#include <cracen_psa_key_ids.h>
1515
#define TFM_BUILTIN_KEY_LOADER_KEY_LOCATION PSA_KEY_LOCATION_CRACEN

modules/trusted-firmware-m/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ config TFM_CRYPTO_BUILTIN_KEYS
6565
prompt "TF-M crypto builtin keys"
6666
default y
6767
depends on !TFM_PROFILE_TYPE_MINIMAL
68-
depends on !CRACEN_HW_PRESENT
68+
depends on !HAS_HW_NRF_CRACEN
6969
select PSA_WANT_ALG_HKDF
7070
select PSA_WANT_ALG_HMAC
7171
select PSA_WANT_ALG_SHA_256

modules/trusted-firmware-m/tfm_boards/common/attest_hal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <nrf_cc3xx_platform.h>
2525
#endif
2626

27-
#if defined(CONFIG_CRACEN_HW_PRESENT)
27+
#if defined(CONFIG_HAS_HW_NRF_CRACEN)
2828
static bool boot_seed_set;
2929
static uint8_t boot_seed[BOOT_SEED_SIZE];
3030
#endif
@@ -126,7 +126,7 @@ enum tfm_plat_err_t tfm_plat_get_boot_seed(uint32_t size, uint8_t *buf)
126126
if (nrf_err != NRF_CC3XX_PLATFORM_SUCCESS) {
127127
return TFM_PLAT_ERR_SYSTEM_ERR;
128128
}
129-
#elif defined(CONFIG_CRACEN_HW_PRESENT)
129+
#elif defined(CONFIG_HAS_HW_NRF_CRACEN)
130130
if (!boot_seed_set) {
131131
psa_status_t psa_err = psa_generate_random(boot_seed, sizeof(boot_seed));
132132

samples/keys/hw_unique_key/src/derive_key_tfm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "derive_key.h"
1717

18-
#if CONFIG_CRACEN_HW_PRESENT
18+
#if CONFIG_HAS_HW_NRF_CRACEN
1919
/* On platforms with Cracen, the HUK is an AES key, suitable for CMAC KDF. */
2020
#define KDF_ALG PSA_ALG_SP800_108_COUNTER_CMAC
2121
#define INPUT_STEP PSA_KEY_DERIVATION_INPUT_LABEL

subsys/nrf_security/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if NRF_SECURITY
5959

6060
config MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
6161
bool
62-
default y if CRACEN_HW_PRESENT && PSA_CRYPTO_DRIVER_CRACEN
62+
default y if HAS_HW_NRF_CRACEN && PSA_CRYPTO_DRIVER_CRACEN
6363
default y if PSA_WANT_PLATFORM_KEYS
6464
help
6565
Promptless option used to control if the PSA Crypto core should have support for builtin keys or not.

subsys/nrf_security/src/drivers/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ config PSA_CRYPTO_DRIVER_OBERON
1010
# The Oberon driver is required to provide HKDF needed for protected storage and bultin keys
1111
prompt "Oberon PSA driver" if !(TFM_PARTITION_PROTECTED_STORAGE || TFM_CRYPTO_BUILTIN_KEYS)
1212
bool
13-
default y if ! CRACEN_HW_PRESENT
13+
default y if !HAS_HW_NRF_CRACEN
1414
help
1515
This configuration enables the usage of the Oberon PSA driver.
1616

@@ -29,7 +29,7 @@ config PSA_CRYPTO_DRIVER_CC3XX
2929
config PSA_CRYPTO_DRIVER_CRACEN
3030
bool "Cracen PSA driver"
3131
depends on MBEDTLS_PSA_CRYPTO_C
32-
depends on CRACEN_HW_PRESENT
32+
depends on HAS_HW_NRF_CRACEN
3333
# CRACEN uses the k_event_ API
3434
select EVENTS if MULTITHREADING
3535
default y

subsys/nrf_security/src/drivers/cracen/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
config CRACEN_HW_PRESENT
7+
config HAS_HW_NRF_CRACEN
88
def_bool (SOC_SERIES_NRF54LX && !SOC_NRF54LS05B) || SOC_SERIES_NRF71X
99

1010
config CRACEN_HW_VERSION_BASE

0 commit comments

Comments
 (0)