Infineon OPTIGA™ Trust M Host Library for C
July 17, 2026 · View on GitHub
This is the OPTIGA™ Trust M Host Library for C. It is a reference implementation that allows the use of the OPTIGA™ Trust M via a high-level API and serves as a basis of our example host applications.
Quick navigation
Getting started
Information on the Product including Documentation, GetStarted Guides or Application Notes can be found in OPTIGA™ Trust M Overview Repository here
Getting the Host Library
Below are the instructions to get the OPTIGA™ Trust M Host Library for C.
The OPTIGA™ Trust M Host Library for C can be cloned using git command :
git clone --recurse-submodules https://github.com/Infineon/optiga-trust-m.git
Building and testing the Host Library
Instructions on how to build and test the host library can be found here
Porting the Host library
Instructions on how to port the host library to a specific platform can be found here
Examples using Host Library
Examples to demonstrate basic functionality of the security chip can be found here
Configuring Mbed TLS library
The OPTIGA™ Trust M Host Library for C relies on Mbed TLS.
The OPTIGA™ Trust M Host Library for C supports Mbed TLS 4.x (with TF-PSA-Crypto).
Note: For support for Mbed TLS 2.x/3.x, please check out the feature/mbedtls-3.x branch.
This library is cloned from a submodule under external/mbedtls-4.x. It comes with a default configuration that needs to be modified to the application purpose.
Two configuration files are provided and should be adjusted to fit your application:
- config/mbedtls_4.x_default_config.h — default configuration for the Mbed TLS 4.x TLS/X.509 layer. Passed to the compiler via
MBEDTLS_USER_CONFIG_FILE. - config/tf_psa_default_config.h — default PSA-crypto configuration for OPTIGA™ Trust M. Passed to the compiler via
TF_PSA_CRYPTO_USER_CONFIG_FILE.
In Mbed TLS 4.x, selection of cryptographic algorithms has moved from the TLS/X.509 config to the PSA crypto config, so both defines are typically required.
Note: Mbed TLS 4.x carries tf-psa-crypto as its own submodule. After cloning, initialize it recursively with git submodule update --init --recursive external/mbedtls-4.x.
During compilation, the following defines need to be added:
MBEDTLS_USER_CONFIG_FILE="config/mbedtls_4.x_default_config.h"
TF_PSA_CRYPTO_USER_CONFIG_FILE="config/tf_psa_default_config.h"
for gcc / CFLAGS (e.g. inside a Makefile via CFLAGS += ...) :
-DMBEDTLS_USER_CONFIG_FILE="config/mbedtls_4.x_default_config.h" \
-DTF_PSA_CRYPTO_USER_CONFIG_FILE="config/tf_psa_default_config.h"
for CMake :
target_compile_definitions(app PRIVATE
MBEDTLS_USER_CONFIG_FILE="${CMAKE_CURRENT_SOURCE_DIR}/config/mbedtls_4.x_default_config.h"
TF_PSA_CRYPTO_USER_CONFIG_FILE="${CMAKE_CURRENT_SOURCE_DIR}/config/tf_psa_default_config.h")
Host library overview

The following documentation is available for the host library.
| Topic | Link to documentation |
|---|---|
| API Documentation (High Level) | OPTIGA™ Trust M API - High Level |
| API Documentation (Code) | OPTIGA™ Trust M API - Code |
| I2C Interface Documenation | I2C Interface Documenation |
For more information please refer to the Wiki page of this project
Host Applications
| Host application | Operating System | Status |
|---|---|---|
| OPTIGA™ Trust M Cryptography | Native | Active |
| OPTIGA™ Trust M MQTT Client | FreeRTOS | Active |
| OPTIGA™ Trust M Power management | Native | Active |
| OPTIGA™ Trust M Data management | Native | Active |
| OPTIGA™ Trust M TLS with mbedTLS | Native | Active |
| OPTIGA™ Trust M AWS FreeRTOS | FreeRTOS | Active |
| OPTIGA™ Trust M Microsoft Azure IoT | FreeRTOS | Active |
| OPTIGA™ Trust M PKCS#11 interface | Linux | Active |
| OPTIGA™ Trust M Matter integration | Linux | Active |
| OPTIGA™ Trust M Zephyr PAL & Application | Zephyr | Active |
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Licensing
Please see our LICENSE for copyright and license information.
This project follows the REUSE approach, so copyright and licensing information is available for every file (including third party components) either in the file header, an individual *.license file or the .reuse/dep5 file. All licenses can be found in the LICENSES folder.