I am working with Mbed TLS (release 3.6.5) on an embedded target and I want to disable all PSA Crypto / PSA driver layers completely and instead build the classic pre-PSA Mbed TLS stack (i.e., using the legacy mbedtls_xxx APIs, not PSA).
So far, whenever I try to disable PSA, I run into errors such as missing prerequisites for TLS 1.3 or unresolved crypto symbols during linking. Most configuration docs assume PSA will stay enabled.
My goals:
1. Disable PSA Crypto entirely
No MBEDTLS_USE_PSA_CRYPTO
No MBEDTLS_PSA_CRYPTO_C
No PSA key slots, no drivers, no psa_crypto_init()
Only classic mbedtls_* crypto and TLS APIs.
2. Enable minimal TLS + X.509 (TLS 1.3)
3. Achieve the smallest possible library footprint, including:
AES / SHA only
ECDHE + ECDSA
X.509 verification
TLS handshake + record layer
Questions:
1. What is the correct set of config options to fully disable PSA Crypto?
Specifically: Which macros must be undefined (or disabled) so that the library no longer expects PSA, but still allows TLS + X.509 to build correctly?
Is there an official minimal non-PSA configuration template?
2. What is the smallest achievable code size for classic Mbed TLS with TLS + X.509?
I want to know the expected lower bound (ROM/Flash size) when PSA is disabled.
For example:
TLS 1.2 + TLS 1.3
Only one curve (e.g., secp256r1)
Only SHA-256
Only AES-128-GCM
X.509 verification only
No debug, no self-tests
If someone has measured sizes (Arm GCC, O0/O2) or an official reference for minimal builds, please share.
Environment:
Mbed TLS version: 3.6.5 LTS
Toolchain: ARM GCC
Platform: Embedded microcontroller (Cortex-M4)
What I’ve already checked:
The config reference notes for disabling PSA
mbedtls_config.h, config_psa.h, check_config.h error conditions
Discussions on GitHub Issues (still unclear which combination is officially supported)
What I’m looking for:
A working minimal config snippet for non-PSA TLS + X.509
A list of PSA-related macros that must be disabled
Any measured size footprint of a minimal non-PSA TLS build
Whether TLS 1.3 is still possible without PSA (or strictly requires PSA)
Note: By disabling the unused cipher suits, I have reduced the library size from 299KB to ~150KB. My goal is to reduce further around 50KB, if realistically possible.
I have a dedicated hardware accelerator on my chip which does both symmetric & asymmetric encryption/decryption.
Thank you in advance for any guidance or sample configurations.