mbedtls: add Kconfig to select the number of key slot in PSA Crypto core

Adding new CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT to select the number
of key slots in PSA Crypto core. The default value is 16. Be aware
that key slots consume RAM memory even if unused, so the proper value
should be a compromise between the number of slots required by
the application and the available RAM in the system.

This commit also:
- updates tests/crypto/secp256r1/mbedtls.conf to showcase how to
  use this new symbol to reduce RAM footprint.
- tests/bsim/bluetooth/mesh/overlay_psa.conf to support all the
  keys used in the test.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2024-10-21 12:12:29 +02:00 committed by Benjamin Cabé
commit 95aaa97dc3
6 changed files with 35 additions and 1 deletions

View file

@ -1,5 +1,8 @@
# Enable PSA as a crypto backend in host
CONFIG_BT_USE_PSA_API=y
# Increase the number of key slots in PSA Crypto core
CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=64
# Enable mbedTLS PSA as a crypto backend
CONFIG_BT_MESH_USES_MBEDTLS_PSA=y

View file

@ -2,6 +2,7 @@ CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED=y
CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y
CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=2
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y