-
Notifications
You must be signed in to change notification settings - Fork 8.4k
mbedtls: use static key slot buffers in the PSA Crypto core #80368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -554,9 +554,10 @@ config MBEDTLS_LMS | |
| depends on MBEDTLS_SHA256 | ||
| select PSA_WANT_ALG_SHA_256 | ||
|
|
||
| if MBEDTLS_PSA_CRYPTO_C | ||
|
|
||
| config MBEDTLS_PSA_P256M_DRIVER_ENABLED | ||
| bool "P256-M driver" | ||
| depends on MBEDTLS_PSA_CRYPTO_C | ||
| imply PSA_WANT_ALG_SHA_256 | ||
| help | ||
| Enable support for the optimized sofware implementation of the secp256r1 | ||
|
|
@@ -570,6 +571,35 @@ config MBEDTLS_PSA_P256M_DRIVER_RAW | |
| Warning: Usage of this Kconfig option is prohibited in Zephyr's codebase. | ||
| Users can enable it in case of very memory-constrained devices, but be aware that the p256-m interface is absolutely not guaranted to remain stable over time. | ||
|
|
||
| config MBEDTLS_PSA_STATIC_KEY_SLOTS | ||
| bool "Use statically allocated key buffers to store key material" | ||
| default y if !MBEDTLS_ENABLE_HEAP | ||
| help | ||
| By default Mbed TLS's PSA Crypto core uses heap memory to store the | ||
| key material for each key slot. This might impose an undesired | ||
| requirement to support heap memory and its management code, affecting | ||
| RAM and ROM footprints at the same time. | ||
| Enabling this symbol causes Mbed TLS to pre-allocate all the key slot | ||
| buffers that are used to store the key material at build time, thus | ||
| removing the need for heap memory. Each buffer will be sized to | ||
| contain the largest asymmetric/symmetric key type enabled in the build | ||
| through PSA_WANT symbols. | ||
|
||
|
|
||
| config MBEDTLS_PSA_KEY_SLOT_COUNT | ||
| int "Number of key slots in PSA Crypto core" | ||
| default 16 | ||
tomi-font marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| help | ||
| Set the number of key slots that are available in the PSA Crypto core. | ||
| Be aware that each slot, even if unused, increases RAM consumption | ||
| by ~40 bytes plus: | ||
| * the length of the largest asymmetric/symmetric key type enabled in | ||
| the build through PSA_WANT symbols, if MBEDTLS_PSA_STATIC_KEY_SLOTS | ||
| is set. (This is all defined statically at build time). | ||
| * the heap-allocated memory to store the key material of a given slot, | ||
| if it is used and MBEDTLS_PSA_STATIC_KEY_SLOTS is not set. | ||
|
|
||
| endif # MBEDTLS_PSA_CRYPTO_C | ||
|
|
||
| config MBEDTLS_SSL_DTLS_CONNECTION_ID | ||
| bool "DTLS Connection ID extension" | ||
| depends on MBEDTLS_DTLS | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
Uh oh!
There was an error while loading. Please reload this page.