Skip to content

Commit

Permalink
mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA
Browse files Browse the repository at this point in the history
Auto-select MBEDTLS_CIPHER_AES_ENABLED when AES support is requested
through PSA (i.e. CONFIG_PSA_WANT_KEY_TYPE_AES) and the PSA support is
provided through Mbed TLS itself (i.e. CONFIG_MBEDTLS_PSA_CRYPTO_C).

This mimic what happens in Mbed TLS at build time: if AES support
is required through PSA, but there's no one else providing it
(i.e. no TF-M in Zephyr) then provide this support through legacy
AES module.

This is useful in samples/tests so that the user can simply use the
PSA_WANT symbol to ask for AES support in PSA crypto and then tune
the AES features (ex: CONFIG_MBEDTLS_AES_ROM_TABLES) without the need
to also define CONFIG_MBEDTLS_CIPHER_AES_ENABLED.

Signed-off-by: Valerio Setti <[email protected]>
  • Loading branch information
valeriosetti committed Oct 31, 2024
1 parent 124aae3 commit 4ed76be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/mbedtls/Kconfig.tls-generic
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ config MBEDTLS_SOME_CIPHER_ENABLED

config MBEDTLS_CIPHER_AES_ENABLED
bool "AES block cipher"
default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C

if MBEDTLS_CIPHER_AES_ENABLED

Expand Down

0 comments on commit 4ed76be

Please sign in to comment.