Skip to content

Code Footprint

aoune-ayoub edited this page May 28, 2024 · 10 revisions

Table of Contents

Setup

Final code footprint depends on many factors, such as target compiler, compilation flags; e.g. with or without code optimization, used applications, third-party crypto library to support the shielded communication, usage of the shielded communication itself, or I2C frame buffer size.

For the table below we used DAVE™ build-in compiler (ARM GCC) for the XMC4800 IoT Connectivity Kit. All numbers are aprox. The setup based on the Get Started Guide (SHA Fingerprint b6ae6d8).

The following generated map files were used for calculations:

The following tool has been used to analyse map files: AMAP For all measurements optimization level "-Os" has been selected. The setup without optimization might take up to 100% of the showed here code footprint

Results



A generic module FLASH/RAM in kB Part of the module FLASH in kB RAM1 in kB
OPTIGA™ Trust M hostcode 25.2 / 11.5 2 Core Functions3 2.7 2.9
ECC; Protected Update; RND; TLS PRF 5.2
RSA 1.4
Infineon I2C protocol3 3.7
Shielded Connection +
3rd party crypto
4 + 8.2 8.6

1 Compile time memory allocation (.bss and .data sections, no heap included if it's used)

2 Values include all features and mbed TLS as the third-party crypto provider

3 Mandatory modules, all others are optional.

How to optimize

The Software Framework offers a way to optimize the final code footprint depending on the use case. Below are the security chip features which you might want to control (the features of the chip itself aren't blocked, instead the code is compiled excluding/including selected options).

Shielded Communication

The OPTIGA_COMMS_SHIELDED_CONNECTION macro enables or disables the shielded communication. Don't forget to excluded the pal_crypt provider; e.g. pal_crypt_mbedtls.c, from your build together with the crypto library; e.g.mbedtls, if it's not used in your project.

RSA Related Functions

Note: some of this functions can be used only in conjunction with shielded connection (RSA encrypt/decrypt)

ECC Related Functions

Other Functions

Additionally

Decrease memory for the maximum context registrations. Find it [here](https://github.com/Infineon/optiga-trust-m/blob/e642d47835861c88463f557ff289ba8ce7e61364/optiga/include/optiga/optiga_lib_config_m_v3.h#L122)

#define OPTIGA_CMD_MAX_REGISTRATIONS                (0x06)

Decrese maxmum communicaiton buffer size. Find it [here](https://github.com/Infineon/optiga-trust-m/blob/e642d47835861c88463f557ff289ba8ce7e61364/optiga/include/optiga/optiga_lib_config_m_v3.h#L124)

#define OPTIGA_MAX_COMMS_BUFFER_SIZE                (0x615) //1557 in decimal