How infineon/optiga-trust-m works
The OPTIGA Trust M Host Library is a C API for using the Trust M security chip from host applications. Its main workflow is an application calling the cryptography or utility API, which submits commands through communications and the IFX I2C stack to the device; asynchronous completion is reported through callbacks. Utility operations cover application/session management and object access, while cryptography exposes operations such as hashing, signing, verification, encryption, and key derivation. The tree also shows platform-specific PAL implementations and optional host-side cryptographic backends. Layer links reflect documented interfaces and sampled excerpts; platform variants are alternatives.
Main entry points: optiga_cmd.c OPTIGA commands · optiga_crypt.c Cryptography API · optiga_util.c Utility API · optiga_comms_ifx_i2c.c Communications
Components 16
Host APIs
- Cryptography API
src/crypt/optiga_crypt.c - Utility API
src/util/optiga_util.c
Command layer
- OPTIGA commands
src/cmd/optiga_cmd.c
I2C transport
- Communications
src/comms/optiga_comms_ifx_i2c.c - IFX I2C wrapper
src/comms/ifx_i2c/ifx_i2c.c - Presentation layer
src/comms/ifx_i2c/ifx_i2c_presentation_layer.c - Transport layer
src/comms/ifx_i2c/ifx_i2c_transport_layer.c - Data-link layer
src/comms/ifx_i2c/ifx_i2c_data_link_layer.c - Physical layer
src/comms/ifx_i2c/ifx_i2c_physical_layer.c
Platform services
- I2C platform adapter
extras/pal/linux/pal_i2c.c - OS platform services
extras/pal/linux/pal_os_event.c - Platform datastore
extras/pal/linux/pal_os_datastore.c
Crypto support
- PSA crypto adapter
extras/pal/pal_crypt_psa.c
Other components
- Host application
- OPTIGA Trust M
- Mbed TLS / PSA
Connections 16
- Host application → Cryptography API: calls crypto API
- Host application → Utility API: calls utility API
- Cryptography API → OPTIGA commands: issues commands
- Utility API → OPTIGA commands: issues commands
- OPTIGA commands → Communications: transmits APDUs
- Communications → IFX I2C wrapper: dispatches I2C
- IFX I2C wrapper → Presentation layer: uses protocol
- Presentation layer → Transport layer: transceives frames
- Transport layer → Data-link layer: uses link layer
- Data-link layer → Physical layer: uses physical layer
- Physical layer → I2C platform adapter: reads and writes
- I2C platform adapter → OPTIGA Trust M: I2C exchange
- OPTIGA commands → Platform datastore: persists context
- Cryptography API → PSA crypto adapter: uses host crypto
- PSA crypto adapter → Mbed TLS / PSA: calls PSA
- OPTIGA commands → OS platform services: uses OS services