Fact-checked by Grok 2 weeks ago

Mbed TLS

Mbed TLS is an open-source, portable library that implements cryptographic primitives, certificate manipulation, and the TLS and DTLS protocols, with a small code footprint making it particularly suitable for resource-constrained embedded systems. Originally developed as PolarSSL by the company Offspark, the library was acquired by in February 2015 to bolster security in its mbed platform, leading to its rebranding as mbed TLS and integration into mbed OS for securing communications from device edge to cloud. Distributed under a dual license of Apache 2.0 or GPL 2.0-or-later, mbed TLS emphasizes ease of understanding, integration, and extension, supporting features like configurable modules via header files and a of the for hardware-accelerated cryptography. Notable for its active maintenance by the Trusted Firmware Project, it receives regular releases—every 3 to 6 months—with the latest stable version 4.0.0 issued in October 2025 introducing major consolidations and vulnerability fixes, while the 3.6 branch provides until at least March 2027. Widely adopted in secure IoT, firmware, and operating system projects such as TF-A, TF-M, and OP-TEE, mbed TLS enables developers to build robust SSL/TLS clients and servers with minimal overhead.

History

Origins and PolarSSL Era

Mbed TLS originated from XySSL, an open-source cryptographic library developed by French security researcher Christophe Devine beginning in 2006. XySSL provided implementations of core cryptographic primitives, including symmetric and asymmetric algorithms, hashing functions, and basic SSL/TLS support, all under the BSD 3-clause license, making it suitable for and resource-limited environments. The library's design emphasized portability across platforms and a minimal code footprint, reflecting Devine's background in wireless security tools like . In January 2009, Paul Bakker launched PolarSSL as the direct successor to XySSL, migrating and refactoring the codebase to enhance modularity and SSL/TLS functionality. PolarSSL adopted a dual-licensing model under the GNU GPL v2 or later and a license, allowing both open-source and commercial use while maintaining a compact structure—comprising just 17 source files and around 100 KB in size. Key additions during this transition included support for ciphers like and , as well as improved certificate handling, positioning it as a lightweight alternative to heavier libraries like for and embedded applications. The PolarSSL era, spanning 2009 to 2015, saw the library's growth under the stewardship of Offspark, a firm specializing in . It became widely adopted for its ease of integration, readability, and focus on without unnecessary features, securing connections in numerous devices and contributing to the early ecosystem. Regular releases addressed evolving standards, such as enhanced DTLS support for UDP-based secure communications, while community contributions helped refine its for developer accessibility. By 2014, PolarSSL had established itself as the most pervasive TLS solution in the industry, underscoring its impact on secure networking in constrained systems.

ARM Acquisition and Renaming

In February 2015, ARM announced the acquisition of Offspark, a Dutch software company specializing in Internet of Things (IoT) security solutions, including the PolarSSL cryptographic library. The deal, which integrated Offspark's technology into ARM's ecosystem, was aimed at strengthening communication security for embedded devices within the mbed platform, particularly for IoT applications such as sensor modules and smartphones. Some reports indicated that ARM had quietly acquired the PolarSSL technology as early as November 2014, with the full company acquisition following shortly thereafter. As part of the acquisition, PolarSSL was rebranded to ARM mbed TLS to align it more closely with ARM's mbed development platform for connected devices. This renaming emphasized its role in providing lightweight, open-source Transport Layer Security (TLS) and Datagram TLS (DTLS) implementations optimized for resource-constrained environments. The library, previously available under the GPL, transitioned to the Apache 2.0 license with the release of version 1.3.10, enabling broader commercial and embedded use while maintaining its open-source status. ARM planned to incorporate mbed TLS into the upcoming mbed OS, scheduled for release later that year, to facilitate secure data transmission in IoT ecosystems. Over time, the branding simplified from "ARM mbed TLS" to simply "mbed TLS," reflecting its evolution as a standalone, portable cryptographic library while retaining its foundational ties to 's mbed initiatives. This shift supported ongoing development focused on enhancing security features for emerging standards like TLS 1.3, without altering the library's core architecture derived from PolarSSL.

Major Releases Post-2015

Following the acquisition in , Mbed TLS continued development under the 2.x series, with several minor versions introducing enhancements and optimizations while maintaining where possible. The 2.16.0 release in December 2018 marked the first (LTS) branch in the series, supported until the end of 2021 with bug fixes and updates but no new features; it added optional validation via the MBEDTLS_CHECK_PARAMS option and extended the ECDH for custom implementations. Subsequent updates in the 2.x line, such as 2.28.0 in December 2021, established another LTS branch (supported until at least March 2025), focusing on stability and addressing vulnerabilities like timing attacks in ECDSA and operations. The transition to the 3.x series began with version 3.0.0, released on July 7, 2021, representing a significant architectural shift as the first major release under the following the project's in 2020. This version made the Cryptography API the default cryptographic backend, introducing API-breaking changes to deprecate legacy modules and improve modularity, while adding support for hybrid key exchanges and enhanced parsing capabilities. Version 3.1.0, released on December 17, 2021, built on this foundation by providing initial experimental support for TLS 1.3, including draft implementations of key derivation and record protection, alongside fixes for multipart AEAD operations in PSA Crypto. Later 3.x releases emphasized and . The 3.6.0 version, released on March 27, 2024, launched the current LTS branch (supported until at least March 2027) and fully stabilized TLS 1.3 support, incorporating RFC 8446-compliant features like improved session ticket handling and post-handshake authentication, while adding PSA static key slots for secure in resource-constrained environments. This branch has seen ongoing patches, such as 3.6.5 in October 2025, addressing timing side-channel vulnerabilities in padding oracles and constant-time operations. In October 2025, Mbed TLS 4.0.0 introduced a major codebase restructuring, splitting the PSA Cryptography implementation into a separate (TF-PSA-Crypto) to allow independent and reduce the core library footprint. This release removed deprecated legacy APIs, aligned with updated PSA specifications for algorithms like AES-GCM-SIV (RFC 8452), and enforced stricter default configurations for TLS clients, such as requiring hostname verification to mitigate man-in-the-middle risks. These changes aim to enhance maintainability and integration with the Platform Security Architecture () ecosystem.

Overview

Purpose and Capabilities

Mbed TLS serves as a lightweight, open-source cryptographic library primarily designed to enable secure data transmission in resource-constrained environments, such as systems, (IoT) devices, and mobile applications. By implementing the Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) protocols alongside essential , it allows developers to integrate robust security features without excessive overhead, making it suitable for platforms with limited memory and processing power. The library's emphasis on portability ensures compatibility across various operating systems and hardware architectures, from microcontrollers to desktops. Key capabilities include full support for TLS 1.2 and TLS 1.3 protocols, which provide , , and for reliable network connections, as well as DTLS 1.2 for securing unreliable datagram-based communications like . It handles the complete TLS/DTLS process, including negotiation, key exchange mechanisms (such as ECDHE and DHE), and session resumption to optimize performance. certificate manipulation is a core feature, enabling parsing, validation, and generation of digital certificates to establish trust in connections. The library offers a comprehensive suite of cryptographic algorithms, including symmetric ciphers like (in modes such as GCM and ) and , asymmetric via and elliptic curve methods (e.g., ECDSA and ECDH), and hash functions such as SHA-256, , and . It also serves as a of the Arm Platform Security Architecture () Cryptography API, facilitating secure key storage, , and integration with modules or accelerators. Configuration options allow selective enabling of features to reduce the binary size to as little as 50 KB in minimal setups, balancing security and efficiency.

Key Design Goals

Mbed TLS is engineered with a focus on simplicity and efficiency, prioritizing ease of integration into resource-constrained environments such as embedded systems. Its adopts a "lean-and-mean" approach to , emphasizing readability, documentation, rigorous testing, of components, and broad portability to ensure developers can quickly understand, modify, and deploy the library without unnecessary complexity. A primary goal is portability across diverse platforms, achieved through adherence to the ISO standard, which allows the library to compile and run on most systems with minimal adjustments. This design enables seamless operation in both devices and larger applications, with portability integrated directly into modules rather than as separate layers. Additionally, the library's small footprint—typically under 100 KB for basic TLS configurations—makes it particularly suitable for and microcontroller-based projects where memory and processing resources are limited. Modularity forms another key pillar, with independent modules that permit selective inclusion of features; for instance, developers can implement only encryption by linking solely to aes.c and aes.h, reducing binary size and dependencies. This supports flexible configuration via a single header file (mbedtls_config.h), allowing customization of algorithms, protocols, and optimizations at to balance , , and resource usage. The also serves as a for the , promoting standardized, secure cryptographic interfaces that separate application memory from internal operations for enhanced safety. Security and reliability are embedded in the design through extensive validation mechanisms, including over 6,000 unit tests, 200 functional tests, and 2,000 interoperability tests that cover edge cases and ensure compliance with standards like TLS 1.3 and from NIST and IETF. Comprehensive documentation, including full references and example code, further aids secure usage by clarifying details and best practices. Distributed under a dual license of Apache 2.0 or GPL 2.0-or-later, Mbed TLS encourages community contributions while maintaining a focus on verifiable correctness, as demonstrated in formal verifications of components like HMAC-DRBG.

Architecture and Components

Core Modules

Mbed TLS employs a modular architecture designed for flexibility and minimal resource usage, particularly in environments. The library is structured around three primary components: the cryptography primitives (via the TF-PSA-Crypto library, also known as libmbedcrypto), certificate handling (libmbedx509), and the SSL/TLS protocol implementation (libmbedtls). As of 4.0.0, the PSA Cryptography functionality resides in its own repository, TF-PSA-Crypto, while maintaining integration with the other modules. These modules can be built independently or combined, allowing developers to include only necessary functionality to reduce code footprint and optimize performance. The core module, TF-PSA-Crypto (libtfpsacrypto or libmbedcrypto), provides a of the Platform Security Architecture () API, offering low-level primitives for symmetric and asymmetric , hashing, message authentication, key derivation, and . It supports algorithms such as , , , (including ), and , with hooks for optimized performance on supported platforms. This module ensures compliance with PSA specifications, enabling secure and isolation in trusted execution environments. The module (libmbedx509) handles parsing, validation, and generation, supporting the full v3 standard for (PKI) operations. It includes functions for revocation lists (CRLs), signing requests (CSRs), and private key extraction, integrating seamlessly with the cryptography module for signature verification using algorithms like and ECDSA. This component is essential for in TLS handshakes and is designed to process DER/PEM-encoded certificates efficiently. The SSL/TLS module (libmbedtls) implements the TLS 1.2, TLS 1.3, and DTLS 1.2 protocols, providing a complete stack. It manages connection setup, handshake negotiation, record layer encryption, and session resumption, configurable via ciphersuites like TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384. Built atop the and modules, it supports client and roles, with options for custom I/O layers to abstract transport. The module emphasizes configurability through preprocessor directives in mbedtls_config.h, allowing selective enabling of features to meet compliance or other standards.

Integration with PSA Cryptography

Mbed TLS integrates the Cryptography API as a core component, providing a standardized, portable for that enhances security in embedded and applications. This integration allows developers to leverage PSA-managed keys and operations directly within Mbed TLS's TLS/DTLS protocols and certificate handling, promoting hardware-accelerated cryptography where available and ensuring compliance with Arm's PSA specifications. The PSA Crypto API in Mbed TLS serves as a , supporting key lifecycle management (generation, import, export, and destruction), symmetric and asymmetric encryption/decryption, signing/verification, hashing, key derivation, and with associated data (AEAD). For instance, it handles algorithms such as AES-128 in mode without padding, RSA-1024 for signing, ECDSA on secp256r1 curves, SHA-256 hashing, for key derivation, and AES-128-GCM for AEAD operations. Operations typically begin with psa_crypto_init() to initialize the library, followed by key setup using attributes like psa_key_attributes_t to specify type, size, usage flags, and algorithms, and proceed through multi-part contexts (e.g., psa_cipher_operation_t) for setup, update, and finish phases. Cleanup is managed via psa_*_abort() for operations and psa_destroy_key() for keys, with mbedtls_psa_crypto_free() to release the library. Since Mbed TLS version 3.1, Crypto support is mandatory when building with TLS, , or public- (PK) modules, eliminating the option to disable it and ensuring all cryptographic operations route through the for improved isolation and security. This shift aligns Mbed TLS with 's design goals of opaque handling and driver extensibility, where the implementation includes a wrapper layer for compatibility and a driver layer to interface with hardware accelerators via the Driver . In Mbed OS environments, -enabled Mbed TLS is the default, allowing seamless use of platform-specific secure elements. For TLS-specific integration, Mbed TLS exposes APIs to incorporate PSA keys as opaque handles, enhancing protection against key extraction. Examples include mbedtls_pk_setup_opaque() for ECDSA private keys in TLS client authentication or (CSR) generation, and mbedtls_ssl_conf_psk_opaque() for (PSK) ciphersuites in TLS sessions. Configuration requires enabling MBEDTLS_USE_PSA_CRYPTO in the library's config.h file during build, with PSA and non-PSA variants maintaining API compatibility but requiring recompilation for ABI changes. This setup supports partial hardware offloading, such as key pair generation and signature operations on secure elements, while fallback to software implementations ensures portability.

Development and Maintenance

Documentation and APIs

Mbed TLS provides comprehensive documentation hosted primarily on Read the Docs, including user guides, articles, and an reference generated from the source code. The main documentation portal at mbed-tls.readthedocs.io offers sections on getting started, configuration options, and best practices for integration, emphasizing the library's portability and modularity for embedded and general-purpose applications. Developers are encouraged to generate customized local documentation using from the source repository, producing HTML outputs that detail the full tailored to specific builds. The API reference, automatically derived from specially formatted comments in the C source code, organizes functionality into distinct modules for ease of use and selective inclusion. Key modules include those for SSL/TLS communication, which provide functions such as mbedtls_ssl_init(), mbedtls_ssl_handshake(), and mbedtls_ssl_read()/write() to manage secure sessions over TCP/IP transports like mbedtls_net_connect() and mbedtls_net_accept(). The module handles certificate parsing, validation, and generation with APIs like mbedtls_x509_crt_parse() for loading certificates and mbedtls_x509_crt_verify() for chain validation against trusted roots. are exposed through dedicated modules, such as AES ciphers via mbedtls_aes_init() and SHA hashes with mbedtls_sha256(), enabling developers to build custom security layers without full TLS overhead. Additionally, Mbed TLS serves as a of the Platform Security Architecture () Cryptography , offering a standardized interface like psa_crypto_init() for and psa_cipher_encrypt() for operations, which abstracts underlying accelerators where available. This PSA layer promotes interoperability and simplifies migration across platforms. Documentation includes practical examples, such as the for implementing a basic TLS client and server using mbedtls_ssl_config_defaults() to set up contexts with default secure parameters. Configuration is managed via the mbedtls_config.h header, allowing compile-time documented in the build guides to optimize footprint and performance.

Testing and Security Audits

Mbed TLS employs a comprehensive automated testing framework to ensure reliability and correctness across its codebase. The library's , located in the tests/ directory, covers , corner cases, and with other implementations such as and . These tests are executed via make check and support various build configurations, including specific TLS versions and cipher suites, to verify functionality under diverse conditions. Additionally, memory-related checks using tools like , AddressSanitizer (), MemorySanitizer (MSan), and UndefinedBehaviorSanitizer (UBSan) detect leaks, overflows, and integrity issues. Compilation testing occurs on multiple platforms, including various systems (such as distributions and ), Windows (via and Visual Studio), and embedded targets, using compilers such as , , Arm Compiler 6, and Microsoft Visual Studio. Code coverage analysis ensures thorough testing of and protocols. is performed using professional fuzzing tools, targeting (D)TLS handshakes and parsing to identify edge-case vulnerabilities. Static analysis is conducted using tools such as to scan the codebase for potential defects. Security audits of Mbed TLS have been conducted periodically to identify proactively. In 2025, a collaborative audit by Calif and the Security Team examined version 3.6.2, uncovering five issues: one high-severity and four medium-severity ones, all related to potential disclosure or denial-of-service in cryptographic operations. These findings were disclosed to the Mbed TLS maintainers in April 2025 and addressed in subsequent releases, with users recommended to upgrade to version 3.6.4 or later. Formal verification efforts complement empirical testing. A 2017 study formally verified the HMAC-DRBG component in Mbed TLS against NIST SP 800-90A specifications using the Coq proof assistant, proving both the functional correctness of the C implementation and its cryptographic security via game-based proofs. This end-to-end verification, including composition with C compiler correctness, confirms the generator produces pseudorandom outputs resistant to attacker predictions. Such modular proofs provide high-assurance guarantees for critical components, enhancing overall library security.

Usage

Configuration and Build Options

Mbed TLS configuration is managed through a dedicated header file, mbedtls_config.h, which allows users to enable or disable features at to optimize for specific platforms, security requirements, or resource constraints. The default configuration file, located in the include/mbedtls/ directory, is fully documented and serves as a starting point for customization. This file organizes options into categories such as system support (e.g., enabling inline assembly or ), feature support (e.g., TLS protocol versions and mechanisms), module selection (e.g., disabling or to reduce footprint), and module-specific settings (e.g., adjusting multi-precision integer size or I/O buffer sizes). To customize the configuration, users can edit mbedtls_config.h directly or use the provided script scripts/config.py, which supports commands like set to enable an option or unset to disable it, with the -f flag for specifying a custom file path. Alternatively, the MBEDTLS_CONFIG_FILE can be defined at to point to a user-provided header, allowing seamless without modifying the source. Pre-configured examples in the configs/ directory, such as those for NSA B TLS , demonstrate tailored setups for particular use cases like high-security environments. Building Mbed TLS incorporates these configurations via standard tools like GNU Make or CMake, requiring a C99-compliant toolchain, Python 3.6 or later, and optionally Perl for testing. With Make, the process is initiated by running make in the library root, with options to specify the compiler (e.g., make CC=arm-linux-gnueabi-gcc) or adjust flags via environment variables like CFLAGS and LDFLAGS for non-GCC environments. Testing can follow with make check. For CMake, users run cmake . followed by make, with key options including -DUSE_SHARED_MBEDTLS_LIBRARY=On for shared libraries, -DCMAKE_BUILD_TYPE=Debug for debugging builds, and -DENABLE_TESTING=Off to skip tests. Additional modes like Coverage, AddressSanitizer (ASan), or MemorySanitizer (MemSan) are available via specific CMake presets, and the full list of options can be viewed with cmake -LH. On Windows, Visual Studio projects are provided for versions 2013 and later, enabling configuration through the IDE.

Example Integrations

Mbed TLS is integrated into Mbed OS, Arm's open-source platform for devices, where it serves as the primary library for implementing SSL/TLS and DTLS protocols, enabling over networks with minimal resource overhead. In Mbed OS, developers configure Mbed TLS through TLSSocket APIs, which abstract the underlying cryptographic operations, allowing seamless handling of certificate validation and key exchanges in resource-constrained environments. This integration supports features like and readiness, making it suitable for connected devices in industrial and consumer applications. Zephyr RTOS, a scalable for embedded systems, incorporates Mbed TLS as the backend for its Crypto implementation, providing a standardized for and secure transport layers. The integration allows Zephyr applications to leverage Mbed TLS for TLS/DTLS handshakes in protocols like CoAP and , with configuration options to optimize for hardware accelerators or software-only execution on microcontrollers such as those from . This setup ensures interoperability with the Platform Security Architecture, facilitating secure boot and updates in ecosystems. Contiki-NG, an open-source operating system targeting low-power devices, uses Mbed TLS to enable DTLS in its CoAP and LwM2M stacks, supporting certificate-based authentication and for constrained networks. The library is configured via custom platform headers to align with Contiki-NG's , allowing integration into 6LoWPAN-based deployments where it handles session resumption and replay protection without exceeding kilobyte-scale footprints. Recent releases have enhanced this integration for broader in smart metering and sensor networks. RIOT OS, designed for applications, includes Mbed TLS as a configurable package that extends its networking capabilities with flexible TLS support, permitting developers to select modules for specific use cases like symmetric ciphers or parsing. Through RIOT's build system, Mbed TLS can be ported to various platforms, integrating with the OS's event-driven to support secure over-the-air updates and protocol wrappers for UDP-based transports. This modular approach aids in deploying secure mesh networks on devices with limited and . Linphone, an open-source VoIP and video , employs Mbed TLS for handling secure signaling and media transport encryption, replacing earlier dependencies like PolarSSL to support modern TLS versions and . The integration occurs via the linphone-sdk build system, where Mbed TLS provides the cryptographic backend for SRTP and protocols, ensuring end-to-end security in communications over public networks. This has enabled Linphone to maintain compatibility with enterprise-grade security requirements while keeping the library footprint lightweight for desktop and mobile builds.

Platform Support

Operating Systems

Mbed TLS exhibits high portability across operating systems due to its implementation in standard C, which minimizes reliance on platform-specific code and enables execution on diverse environments ranging from desktops to embedded devices. The library provides abstraction layers for key functions such as networking, timing, and entropy gathering, allowing adaptation to different OS APIs without extensive modifications. On desktop and server platforms, Mbed TLS natively supports Windows, as well as systems including distributions, BSD variants, and macOS (previously OS X). These systems leverage standard features like the BSD sockets API for network I/O and /dev/urandom or equivalent for sources, enabling seamless integration for applications requiring TLS/DTLS protocols. For instance, the timing module is optimized for Windows via its high-resolution performance counters and for Unix platforms using gettimeofday() or similar calls. In embedded contexts, Mbed TLS is deeply integrated with real-time operating systems (RTOS) tailored for resource-constrained devices. It serves as the primary cryptographic and TLS stack in Mbed OS, Arm's open-source RTOS for (end-of-life scheduled for July 2026), where it handles alongside the OS's CMSIS-RTOS for multithreaded execution. Compatibility extends to other RTOS environments, such as , through standardized interfaces like CMSIS-RTOS adaptations provided in development kits, facilitating secure networking in microcontroller-based systems. For bare-metal deployments without an underlying OS, Mbed TLS supports customization by disabling dependent modules—such as networking—and implementing platform-specific callbacks for , threading, and entropy sources. This approach is common in ultralow-power microcontrollers, where the library's allows footprint reduction to under 100 KB while maintaining full cryptographic capabilities.

Hardware and Embedded Systems

Mbed TLS is designed as a lightweight, portable library that implements and TLS/DTLS protocols, making it particularly suitable for resource-constrained embedded systems with limited memory and processing power. Its modular architecture allows developers to enable only necessary features, resulting in a minimal footprint—typically around 50-100 KB for a TLS —ideal for microcontrollers like those in the series used in devices. This portability enables deployment on bare-metal environments or real-time operating systems such as without requiring an underlying OS kernel. The library supports through platform-specific "alternative engines" that offload cryptographic operations to dedicated hardware peripherals, improving performance and on hardware. For instance, developers can replace software implementations of algorithms like or with hardware-accelerated versions by defining custom functions in the mbedtls_config.h, which integrates seamlessly with the library's . This approach is outlined in the Mbed TLS guidelines for hardware acceleration, emphasizing initial platform setup such as enabling caches or clocks before utilization. Integration with the Platform Security Architecture () Cryptography API further enhances hardware support, allowing Mbed TLS to interface with secure elements or hardware accelerators via driver plugins. The in Mbed TLS enables abstraction of hardware crypto providers, such as trusted execution environments in TrustZone-M, facilitating secure key storage and operations on devices like microcontrollers. Representative examples include acceleration of encryption on STM32F7's CRYP peripherals and elliptic curve cryptography on ESP32's hardware engine, which can significantly reduce computation time compared to software-only execution in embedded benchmarks. Mbed TLS is widely adopted in embedded security frameworks, including Trusted Firmware-M (TF-M) for Armv8-M processors, where it provides TLS connectivity in secure partitions for and industrial applications. This support extends to hardware like ' EFR32 series, where plugins accelerate and operations using on-chip CRYPTO modules, and Infineon's PSoC 6, demonstrating up to 4x faster boot times with hardware-accelerated cryptography in secure boot scenarios. Overall, these capabilities position Mbed TLS as a key enabler for efficient, in power-sensitive embedded ecosystems.

Cryptographic Algorithms

Symmetric and AEAD Ciphers

Mbed TLS offers a flexible symmetric cryptography module that implements a variety of block and stream ciphers, along with multiple operating modes, to support secure data encryption and decryption in resource-constrained environments. The library's generic cipher interface, defined in cipher.h, allows developers to abstract operations across different algorithms while providing low-level control over keys, initialization vectors, and padding. This module is integral to higher-level protocols like TLS/DTLS, but can also be used standalone for custom applications. Support for these primitives is configurable at build time to balance security, performance, and footprint. The primary block ciphers include (with 128-, 192-, and 256-bit keys), (128-, 192-, and 256-bit), and (128-, 192-, and 256-bit). AES serves as the cornerstone, offering high security and hardware acceleration on many platforms, while Camellia and ARIA provide alternatives approved in various international standards. As of Mbed TLS 4.0.0 (released October 2025), support for legacy DES and Triple-DES (3DES) has been removed due to vulnerabilities like Sweet32. Block cipher modes of operation in Mbed TLS encompass , (with padding by default), CFB128, OFB, , (for scenarios), KW (key wrapping per NIST SP 800-38F), and KWP (key wrapping with padding). mode, for instance, enables efficient stream-like encryption without padding, making it suitable for real-time data streams, while provides tweakable encryption for sector-based storage. These modes are implemented to ensure constant-time operations where possible, reducing side-channel risks. Stream ciphers are represented by ChaCha20, a high-speed, secure primitive resistant to timing attacks. AEAD ciphers in Mbed TLS combine and in a single primitive, essential for protocols like TLS 1.3. Supported AEAD algorithms include AES-GCM, AES-CCM, AES-CCM* (CCM without authentication for specific use cases), Camellia-GCM, Camellia-CCM, Camellia-CCM*, ARIA-GCM, ARIA-CCM, ARIA-CCM*, and . GCM, defined in NIST SP 800-38D, uses GHASH for authentication and is widely adopted for its efficiency and parallelizability. CCM, per NIST SP 800-38C, offers with a built-in MAC, while (RFC 7539) pairs the stream cipher with Poly1305 for a lightweight, nonce-misuse-resistant option ideal for mobile and devices. All AEAD modes support associated data for header protection without encryption.
CipherKey Sizes (bits)Supported ModesAEAD Variants
128, 192, 256ECB, CBC, CFB128, CTR, OFB, XTS, KW, KWP, GCM, CCM, CCM*AES-GCM, AES-CCM, AES-CCM*
128, 192, 256ECB, CBC, CFB128, CTR, GCM, CCM, CCM*Camellia-GCM, Camellia-CCM, Camellia-CCM*
128, 192, 256ECB, CBC, CFB128, CTR, GCM, CCM, CCM*ARIA-GCM, ARIA-CCM, ARIA-CCM*
ChaCha20256Stream
Configuration is managed via mbedtls_config.h, where macros like MBEDTLS_AES_C (enabled by default), MBEDTLS_CAMELLIA_C, MBEDTLS_ARIA_C, MBEDTLS_CHACHA20_C, MBEDTLS_CIPHER_MODE_CBC, MBEDTLS_GCM_C, and MBEDTLS_CCM_C inclusion. Disabling unused ciphers reduces code size significantly—for example, excluding legacy options saves space in embedded builds—while ensuring compliance with standards like requires specific subsets. The PSA Crypto API wrapper provides an alternative, vendor-agnostic interface for these operations in Mbed TLS 3.x and later.

Hash and MAC Functions

Mbed TLS implements a range of standard cryptographic functions via its dedicated hashing module, enabling applications to compute message digests for integrity verification, digital signatures, and key derivation. The core supported algorithms include , a 128-bit one-way designed by for efficient computation on limited resources; , a 160-bit developed by NIST and NSA, though now considered deprecated for new security applications due to collision vulnerabilities; and the SHA-2 family, comprising (256-bit output), SHA-384 (384-bit), and SHA-512 (512-bit), which provide stronger security margins against collision attacks. Additionally, , standardized in FIPS 202, offers sponge-based hashing with variable output lengths and resistance to length-extension attacks inherent in Merkle-Damgård constructions like SHA-2. These implementations are accessible through a generic message digest (MD) interface, allowing seamless switching between algorithms at runtime, and are configurable via the library's build options in mbedtls_config.h to enable or disable specific hashes for footprint optimization in environments. For message authentication, Mbed TLS provides HMAC (Hash-based Message Authentication Code) as a keyed hash construction, applicable to any supported hash function to ensure both data integrity and authenticity against an adversary without the secret key. Defined in RFC 2104 and updated in RFC 6234, HMAC operates by applying the hash function twice—first on the key padded with the message and then on the result with an inner hash—yielding outputs matching the underlying hash size, such as 256 bits for HMAC-SHA-256. This makes it suitable for protocols like TLS handshake integrity and secure channel establishment. The library's MD module handles HMAC computations generically, supporting multipart operations for streaming data and integration with PSA Cryptography API for modern applications. Complementing HMAC, Mbed TLS includes CMAC (Cipher-based Message Authentication Code), a mode for block ciphers that generates fixed-length tags using a symmetric key, primarily for AES as specified in RFC 4493 and SP 800-38B. CMAC processes input in block-sized chunks with CBC-like chaining and a final subkey-derived authentication, producing tags up to the block size (e.g., 128 bits for AES). It is preferred over older CBC-MAC for variable-length messages due to its security against length-extension exploits and is used in scenarios requiring lightweight authentication without public-key overhead, such as IoT device communications. The implementation supports single-part and multi-part operations, with hardware acceleration possible on supported platforms. Both hash and MAC functions in Mbed TLS emphasize portability and security, with constant-time implementations to mitigate timing attacks where feasible, and extensive testing against NIST vectors. While legacy algorithms like and remain for compatibility, the library encourages migration to or for new deployments to align with current standards like FIPS 140-3.

Public-Key and Key Exchange Algorithms

Mbed TLS provides robust support for and key exchange mechanisms through its modular design, enabling secure key establishment in protocols like TLS/DTLS. The library's public-key (PK) module serves as an for common operations such as encryption, decryption, signing, and verification, primarily focusing on and (ECC) to balance security and performance on systems. These algorithms are integral to certificate-based and session key derivation in secure communications. RSA support in Mbed TLS encompasses both encryption and digital signatures, adhering to standards. For encryption, the library implements (OAEP) with hash functions to ensure IND-CCA2 security, supporting key lengths from 1024 to 4096 bits, with 2048 bits or larger recommended for current threat models. Signature generation and verification support both v1.5 padding for and the more secure Probabilistic Signature Scheme (PSS), which resists existential forgery attacks when paired with strong hashes like SHA-256. These features allow to be used for server authentication in TLS via certificate signatures or direct key transport in legacy ciphersuites. Elliptic curve algorithms are implemented for efficient public-key operations, particularly suited for resource-limited devices. The ECDSA module enables digital signatures over , following ANSI X9.62 and NIST FIPS 186-4 standards, with support for deterministic variants to avoid randomness issues. For key agreement, the ECDH module facilitates ephemeral key exchanges, deriving shared secrets via scalar multiplication on the curve. Supported curves include the NIST prime-field curves secp192r1, secp224r1, secp256r1, secp384r1, and secp521r1, which provide security levels equivalent to 96 to 256 bits of symmetric encryption. Brainpool curves (bp256r1, bp384r1, bp512r1) are also available for enhanced resistance to certain implementation attacks. and are supported for high-speed Diffie-Hellman-like exchanges in specific modes. These primitives underpin ECDHE key exchanges in modern TLS ciphersuites, offering strong with smaller key sizes than . The Diffie-Hellman Modular (DHM) module implements the classic Diffie-Hellman key agreement protocol over finite fields, enabling ephemeral (DHE) exchanges for in TLS. It supports customizable prime moduli and generators, with built-in handling for safe primes to prevent small-subgroup confinement attacks, and group sizes up to 8192 bits for high-security applications. Standard groups from RFC 3526 and RFC 7919 are configurable, allowing integration with ciphersuites like TLS_DHE_RSA_WITH_AES_256_GCM_SHA384. In the context of TLS key exchanges, Mbed TLS integrates these primitives into a flexible framework supporting multiple methods across TLS 1.2 and TLS 1.3. Static key exchange encrypts the premaster secret with the server's public key, though it lacks and is discouraged in favor of ephemeral methods. DHE and ECDHE provide perfect by generating temporary parameters per session, with ECDHE preferred for its computational efficiency—offering up to 10x faster handshakes than DHE on typical hardware. (PSK) modes support symmetric authentication without public-key infrastructure, ideal for , with optional ECDHE for added secrecy. ECJPAKE enables password-based authenticated key exchange resistant to offline dictionary attacks, compliant with 8236. For TLS 1.3, only (EC)DHE and PSK-based exchanges are permitted, ensuring mandatory as per 8446, with the library providing hybrid PSK-(EC)DHE for enhanced security. Ciphersuite selection is configurable via the SSL module, allowing prioritization of algorithms based on policy.
Key Exchange MethodPublic-Key AlgorithmForward SecrecyTypical Use CaseExample Ciphersuite (TLS 1.2)
Static RSANoLegacy systemsTLS_RSA_WITH_AES_128_GCM_SHA256
DHEDHM (Diffie-Hellman)High-security serversTLS_DHE_RSA_WITH_AES_256_GCM_SHA384
ECDHE (ECDH)Embedded/mobileTLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
PSKNone (symmetric)No (configurable with ECDHE)IoT networksTLS_PSK_WITH_AES_128_CCM_8
ECJPAKE (ECDH variant)Password authTLS_ECJPAKE_WITH_AES_128_CCM_8
This table illustrates representative methods; full support depends on build-time configuration options like or .

References

  1. [1]
    GitHub - Mbed-TLS/mbedtls: An open source, portable, easy to use ...
    Mbed TLS is a C library that implements X.509 certificate manipulation and the TLS and DTLS protocols. Its small code footprint makes it suitable for embedded ...Releases 72 · Pull requests 291 · Issues 1.3k · SecurityMissing: overview | Show results with:overview
  2. [2]
    ARM buys Leading IoT Security Company Offspark as it Expands its ...
    Feb 9, 2015 · The release of mbed TLS 1.3.10, is now available under GPL and to existing PolarSSL customers on polarssl.org. Contacts. Andy Winstanley +44 ...Missing: transition | Show results with:transition
  3. [3]
  4. [4]
    Releases · Mbed-TLS/mbedtls - GitHub
    Mbed TLS 3.6 is a long-term support (LTS) branch. It will be supported with bug-fixes and security fixes until at least March 2027.
  5. [5]
    Mbed TLS releases: 2.16.12, 2.28.0, 3.1.0
    Jan 18, 2022 · These releases of Mbed TLS address several security issues, provide bug fixes, and new features, including initial support for TLS 1.3 in Mbed TLS 3.1.0.Re: [mbed-tls] Some thoughts towards mbed TLS 3.0September 2020 - mbed-tls - lists.trustedfirmware.orgMore results from lists.trustedfirmware.org
  6. [6]
    Mbed TLS - Trusted Firmware
    Mbed TLS Project implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols.
  7. [7]
    Insecure Diffie Hellman key exchange parameters validation in ...
    Mbed TLS (then PolarSSL) is a widely used cryptographic library originally written by Christopher Devine (as XySSL, released under the BSD 3-clause license) ...
  8. [8]
    Christophe Devine (Security Researcher, Sogeti/ESEC) & Damien ...
    Previously, he worked on wireless security; he developed aircrack (now aircrack-ng) and xyssl (now polarssl). In 2009, he ported the FireWire attack using ...
  9. [9]
    [PDF] PolarSSL - Brainspark
    Started on 01-01-2009 as successor to XySSL. GPL / Dual Licensed. Small: 17 ... Paul Bakker. Email: p.j.bakker@polarssl.org. Twitter: PaulBakkerNL. PolarSSL.Missing: founded | Show results with:founded<|control11|><|separator|>
  10. [10]
    WikiLeaks - /server/polarssl-1.3.4/ChangeLog
    Source code published in this series contains software designed to run on servers controlled by the CIA. Like WikiLeaks' earlier Vault7 series, the material ...
  11. [11]
    PolarSSL Rebranded as "ARM mbed TLS" After Acquisition
    Feb 9, 2015 · The news comes after ARM quietly acquired Offspark, the company behind PolarSSL, back in November 2014.Missing: history | Show results with:history
  12. [12]
    ARM Acquires IoT Security Firm Offspark - PCMag
    Feb 9, 2015 · PolarSSL will be rebranded as mbed TLS. Mbed is ARM's software tools ... ARM is making its mbed TLS free to developers as a standalone ...Missing: renaming | Show results with:renaming
  13. [13]
    Release Mbed TLS 2.16.0 · Mbed-TLS/mbedtls
    **Release Date and Key Features/Changes for Mbed TLS 2.16.0**
  14. [14]
    Mbed TLS 3.0 Release - Trusted Firmware
    Jul 7, 2021 · Mbed TLS 3.0 has been released on 2021-07-07. It is the first major release from the project since it migrated to Trustedfirmware.org community project in 2020.Missing: notes | Show results with:notes
  15. [15]
  16. [16]
  17. [17]
    Mbed TLS - ESP32 - — ESP-IDF Programming Guide v5.5.1 ...
    Mbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols.Missing: overview | Show results with:overview
  18. [18]
    Using DTLS - Mbed TLS documentation - Read the Docs
    This tutorial introduces the specifics of using DTLS (as opposed to TLS) with Mbed TLS. It assumes you're familiar with using TLS connections with Mbed TLS.
  19. [19]
    How to configure Mbed TLS
    The default configuration file is located in include/mbedtls/mbedtls_config.h ( include/mbedtls/config.h up to Mbed TLS 2.28). It is fully documented.
  20. [20]
    Mbed TLS design
    Mbed TLS takes a lean-and-mean approach to software development. We have designed it to be easy to use by being readable, documented, tested, loosely coupled ...Missing: key goals<|control11|><|separator|>
  21. [21]
    Mbed-TLS/TF-PSA-Crypto - GitHub
    The design goals of the PSA Cryptography API include: The API distinguishes caller memory from internal memory, which allows the library to be implemented ...
  22. [22]
    [PDF] Verified Correctness and Security of mbedTLS HMAC-DRBG
    Oct 30, 2017 · ABSTRACT. We have formalized the functional specification of HMAC-DRBG. (NIST 800-90A), and we have proved its cryptographic security—.
  23. [23]
    Mbed TLS - PSA Certified Products
    Mbed TLS provides a portable, highly modular, easy-to-use Crypto, TLS and X.509 libraries. It is extensively used in various market segments and distributed ...
  24. [24]
    Using PSA - Mbed TLS documentation - Read the Docs
    The PSA Crypto API supports encrypting, decrypting, signing and verifying messages using public key signature algorithms, such as RSA or ECDSA.
  25. [25]
  26. [26]
    PSA Crypto non-optional in Mbed TLS 3.1 - mbed-tls - lists.trustedfirmware.org
    ### Summary of PSA Crypto Becoming Non-Optional in Mbed TLS 3.1
  27. [27]
    Using PSA-enabled Mbed TLS - Porting | Mbed OS 6 Documentation
    The new APIs allow using PSA-managed keys for a few purposes, such as TLS client authentication, CSR generation and TLS PSK connections.
  28. [28]
    PSA secure element driver interface - Mbed
    Mbed TLS support status: Partial. Only a few operations are supported: key pair generation, import, export and destruction; signature and verification. Example: ...<|control11|><|separator|>
  29. [29]
  30. [30]
    Mbed TLS API documentation
    mbed TLS supports TLSv1.0 up to TLSv1.2 communication by providing the following: TCP/IP communication functions: listen, connect, accept, read/write ...
  31. [31]
    Mbed TLS tutorial
    Mbed TLS can be used to create an SSL/TLS server and client by providing a framework to set up and communicate through an SSL/TLS communication channel. The SSL ...
  32. [32]
    Mbed TLS automated testing and quality assurance
    We are devoted to keeping the Mbed TLS code-base secure. We, therefore, put a lot of effort into our quality assurance and testing the code.Test Details · Test Framework · Interoperability Testing
  33. [33]
    An Mbed TLS Security Audit - Calif
    Jul 4, 2025 · We're excited to share the results of a deep-dive security audit into Mbed TLS version 3.6.2, conducted in close collaboration with Google.
  34. [34]
    Verified Correctness and Security of mbedTLS HMAC-DRBG
    We have also proved that the mbedTLS implementation (C program) correctly implements this functional specification. That proof composes with an existing C ...
  35. [35]
    Building - Mbed TLS documentation - Read the Docs
    Mbed TLS supports a number of different build environments out-of-the-box. However, the code and dependencies let you build with any environment.
  36. [36]
    TLS - API references and tutorials | Mbed OS 6 Documentation
    Arm Mbed TLS is a comprehensive SSL/TLS solution, making it easy for developers to include cryptographic and SSL/TLS capabilities in their software.
  37. [37]
    PSA Crypto - Zephyr Project Documentation
    In Zephyr, the PSA Crypto API is implemented using Mbed TLS, an open-source cryptographic library that provides the underlying cryptographic functions.
  38. [38]
    mbedtls-support.h File Reference - Contiki-NG Documentation
    Check in what DTLS state the peer is in. Detailed Description. DTLS (Mbed TLS implementation) support for CoAP. Author: Jayendra Ellamathy ejaye ...
  39. [39]
    ARM Mbed TLS - RIOT Documentation
    Mbed TLS is highly configurable and it allows inclusion of alternative hardware or OS specific implementations to be used by the library. A porting guide ...
  40. [40]
    Porting Mbed TLS to a new environment or OS
    Overview. Mbed TLS has a modular design. Many of the modules are completely independent of any runtime, environment, or other module dependencies, with the ...
  41. [41]
    MDK-Middleware - Arm Keil
    ... FreeRTOS. The Network component uses the Arm Mbed TLS stack to secure the TCP/IP communication. CMSIS-Drivers are a required for the components to work ...
  42. [42]
    Alternative cryptography engines implementation — Mbed TLS ...
    As mentioned in the Mbed TLS Abstraction layers article, Mbed TLS supports alternative implementation for most of its cryptography modules. A common use ...
  43. [43]
    Hardware Accelerated Crypto - Porting | Mbed OS 6 Documentation
    This document explains how to add hardware acceleration support for a development board in Arm Mbed OS and integrate it with Arm Mbed TLS.
  44. [44]
  45. [45]
    Silicon Labs CRYPTO Hardware Acceleration Plugins
    The plugins use the AES and CRYPTO hardware modules to accelerate the standard mbed TLS library functions that are implemented in C.
  46. [46]
    mbedTLS Crypto acceleration for CAT1A, CAT1B & CAT1C MCUs
    This repository contains mbedTLS hardware accelerated basic cryptography implemented for CAT1A, CAT1B and CAT1C MCUs. It provides an easy to use mbedTLS ...
  47. [47]
    File cipher.h — Mbed TLS Versioned documentation
    ### Supported Symmetric Ciphers Summary
  48. [48]
    Hashing module - mbed TLS v3.1.0 - GitHub Pages
    MD5 128-bit one-way hash function by Ron Rivest. · SHA-1, SHA-256, SHA-384/512 160-bit or more one-way hash functions by NIST and NSA.
  49. [49]
    File sha3.h - Mbed TLS documentation - Read the Docs
    This file contains SHA-3 definitions and functions. The Secure Hash Algorithms cryptographic hash functions are defined in FIPS 202: SHA-3 Standard: Permutation ...
  50. [50]
    File md.h - Mbed TLS documentation - Read the Docs
    This file contains the generic functions for message-digest (hashing) and HMAC. ... This function returns the list of digests supported by the generic digest ...
  51. [51]
    mbed TLS v3.1.0: cmac.h File Reference - GitHub Pages
    This file contains CMAC definitions and functions. The Cipher-based Message Authentication Code (CMAC) Mode for Authentication is defined in RFC-4493: The AES- ...
  52. [52]
    File pk.h — Mbed TLS Versioned documentation
    Key algorithm is unsupported (only RSA and EC are supported). ... If the PK context contains a public key, the key type is a public key type. The key's ...
  53. [53]
    How to encrypt and decrypt with RSA - Mbed TLS documentation
    To perform RSA encryption or decryption, you will need an RSA key. In the case of an RSA-2048 decryption, you will need a 2048-bit RSA key.
  54. [54]
    RSASSA-PSS - Mbed TLS documentation
    Mbed TLS fully supports RSASSA-PSS directly in its RSA module. To use RSA as specified in PKCS#1 v2.1, with SHA1 as the hash method, for example, you should ...<|control11|><|separator|>
  55. [55]
    Elliptic curve performance: NIST vs. Brainpool
    Unfortunately, they use slightly different data structures and representations than the other curves, so they haven't been ported yet to TLS and PKIX in Mbed ...
  56. [56]
    mbedtls/library at development · Mbed-TLS/mbedtls
    Insufficient relevant content. The provided text is a GitHub navigation page snippet and does not contain the file list or details from the `https://github.com/Mbed-TLS/mbedtls/tree/development/library` directory. No files related to public key or key exchange (e.g., rsa.c, ecdsa.c, dhm.c, ecdh.c, pk.c) or supported algorithms can be extracted.
  57. [57]
    File ssl_ciphersuites.h - Mbed TLS documentation - Read the Docs
    SSL Ciphersuites for Mbed TLS. ... Values: ... This structure is used for storing ciphersuite information. ... Built with Sphinx using a theme provided by Read the ...