Repository navigation
crypto/mbedtls: Allow a minimal crypto-only configuration. - #3848
Merged
Merged
Conversation
cederom
previously approved these changes
Oct 14, 2026
cederom
left a comment
Contributor
There was a problem hiding this comment.
THank you @raiden00pl :-)
raiden00pl
force-pushed
the
mbedtls-minimal
branch
from
October 14, 2026 13:30
9439814 to
ab14b2b
Compare
xiaoxiang781216
previously approved these changes
Oct 14, 2026
Mbed TLS defaults suit full TLS stacks. Libraries that only need a few primitives, such as NimBLE, still build every cipher and curve, and the generic cipher layer links them all. Add MBEDTLS_MINIMAL, which turns all optional module defaults off so only selected or explicitly enabled options are built. Make the modules that were always defined in mbedtls_config.h configurable, defaulting to enabled unless MBEDTLS_MINIMAL is set. Add options for MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH, MBEDTLS_AES_FEWER_TABLES and MBEDTLS_BLOCK_CIPHER_NO_DECRYPT. Without MBEDTLS_MINIMAL the configuration is unchanged. Tested: nrf54l15-tag NimBLE mesh build; the linked Mbed TLS for NimBLE shrinks from 57 KB flash and 9 KB RAM to about 21 KB flash and no RAM. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: raiden00pl <[email protected]>
fix codespell issue Signed-off-by: raiden00pl <[email protected]>
raiden00pl
force-pushed
the
mbedtls-minimal
branch
from
October 15, 2026 19:07
ec5c8d5 to
07665dd
Compare
jerpelea
approved these changes
Oct 16, 2026
Contributor
|
Thanks for this addition |
acassis
approved these changes
Oct 16, 2026
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mbed TLS defaults suit full TLS stacks. Libraries that only need a few primitives, such as NimBLE, still build every cipher and curve, and the generic cipher layer links them all.
Add MBEDTLS_MINIMAL, which turns all optional module defaults off so only selected or explicitly enabled options are built. Make the modules that were always defined in mbedtls_config.h configurable, defaulting to enabled unless MBEDTLS_MINIMAL is set. Add options for MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH, MBEDTLS_AES_FEWER_TABLES and MBEDTLS_BLOCK_CIPHER_NO_DECRYPT.
Without MBEDTLS_MINIMAL the configuration is unchanged.
Impact
mbedtls is required for new nimble, but without size optimization it takes huge amount of memory
Testing
Tested: nrf54l15-tag NimBLE mesh build; the linked Mbed TLS for NimBLE shrinks from 57 KB flash and 9 KB RAM to about 21 KB flash and no RAM.