Skip to content

Commit

Permalink
[nrf toup] Implicitly enable PSA crypto driver for given platform
Browse files Browse the repository at this point in the history
This commit makes in clear which crypto driver is enabled by default.
Additionally, stack overflow has been fixed for CC3XX variant, and
mbedTLS Heap is disabled for TF-M variant.

Signed-off-by: Łukasz Duda <[email protected]>
  • Loading branch information
LuDuda committed Oct 3, 2024
1 parent 89eb37b commit a7cb4d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ config CHIP_MALLOC_SYS_HEAP

config CHIP_TASK_STACK_SIZE
int "The CHIP (Matter) thread stack size"
default 10240 if LTO
default 10240 if (LTO || PSA_CRYPTO_DRIVER_CC3XX)
default 6144
help
Configures the stack size available for the CHIP (Matter) thread.
Expand Down
24 changes: 15 additions & 9 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,13 @@ choice RNG_GENERATOR_CHOICE
default XOSHIRO_RANDOM_GENERATOR if SOC_SERIES_NRF53X
endchoice

config OBERON_BACKEND
default y

config MBEDTLS_ENABLE_HEAP
default y
default y if !BUILD_WITH_TFM
default n

config MBEDTLS_HEAP_SIZE
default 8192

# Enable PSA Crypto dependencies for Matter

config CHIP_CRYPTO_PSA
Expand All @@ -317,9 +315,15 @@ config CHIP_CRYPTO_PSA

if CHIP_CRYPTO_PSA

config PSA_CRYPTO_DRIVER_OBERON
default y if (SOC_SERIES_NRF52X || SOC_SERIES_NRF53X)

config PSA_CRYPTO_DRIVER_CC3XX
default n

config PSA_CRYPTO_DRIVER_CRACEN
default y if SOC_SERIES_NRF54LX

config PSA_WANT_ALG_SHA_224
default n

Expand All @@ -335,14 +339,13 @@ config PSA_USE_CC3XX_HASH_DRIVER

endif # PSA_CRYPTO_DRIVER_CC3XX && PSA_CRYPTO_DRIVER_OBERON

# Spake2+ support
config MBEDTLS_MD_C
default y

endif # CHIP_CRYPTO_PSA

if !CHIP_CRYPTO_PSA

config OBERON_BACKEND
default y

config NRF_SECURITY_ADVANCED
default y

Expand All @@ -355,6 +358,9 @@ config MBEDTLS_CTR_DRBG_C
config MBEDTLS_CIPHER_MODE_CTR
default y

config MBEDTLS_MD_C
default y

config MBEDTLS_SHA1_C
default y if CHIP_WIFI

Expand Down

0 comments on commit a7cb4d1

Please sign in to comment.