Overview ¶
This package is the STM32 Flexible Crypto Framework (STFCF) middleware provided by STMicroelectronics.
Description ¶
The STM32 Flexible Crypto Framework (STFCF) provides easy access to the cryptographic capabilities offered by STMicroelectronics. It enables experimentation with multiple cryptographic engines and exposes services through the Platform Security Architecture (PSA) Application Programming Interface (API).
The framework supports several cryptographic engines, selectable by configuration:
Hardware acceleration with HAL API (“Mbed TLS Alt HAL”): Using hardware accelerators for cryptographic operations.
STCryptoLib (“Mbed TLS Alt STCryptoLib”): Using software-based cryptographic solutions.
Mbed TLS: Direct implementation of Mbed TLS.
PSA driver Key Wrap Engine (“KWE”): Wrapping, Unwraping, Sharing, or Generating keys.
Third-party alternatives (“Mbed TLS custom alternative”): Custom configurations combining different cryptographic solutions.
STFCF overall architecture ¶
Below is the STM32 Flexible Crypto Framework architecture:
STFCF architecture ¶
Folder Structure ¶
The following tree describes a simplified view of the main folders and files in the STFCF middleware:
STFCF Folder Structure ¶
The KWE directory contains the Key Wrap Engine (KWE) implementation. It is divided into core/ for core KWE functionality and interface/ for interface definitions related to KWE.
The STFCF middleware folder structure enables modular and flexible integration of multiple cryptographic implementations by providing a common switching interface. This interface separates the hardware abstraction layer (HAL) implementations from the software-optimized STCryptoLib implementations into dedicated header and source files. This separation allows seamless selection and mixing of alternatives per algorithm. Configuration templates and KWE-specific modules support easy customization and extension.
In HAL implementation, for certain algorithms, there are two types of implementation files, for example aes_aes_hal.c and cryp_aes_hal.c (similarly for CCM and GCM). The choice between CRYP and AES depends on the STM32 MCU used on the board. being used.
The templates folder contains various configuration template files used to customize and generate the middleware configuration.
Main Features ¶
The STFCF middleware integrates multiple cryptographic solutions into a single, cohesive framework. It supports a wide range of STM32 cores and offers extensive configurability to adapt to different use cases.
User Guidance: The framework serves as a helper to guide users in their cryptographic choices, offering a unified interface for various cryptographic implementations.
Promotion of Hardware Alternatives: By leveraging the PSA API, the framework promotes the use of STMicroelectronics’ hardware alternatives, ensuring consistent and optimized performance across different implementations.
The main backbone of the STFCF middleware is the Mbed TLS middleware. The STFCF relies on several external dependencies to provide comprehensive cryptographic services. These dependencies include third-party cryptographic libraries like STCryptoLib or HAL.
Mbed TLS Alt HAL Capabilities: The framework supports Mbed TLS with alternative implementations using HAL (Hardware Abstraction Layer). This enables the use of hardware accelerators for cryptographic operations, enhancing performance and security.
Mbed TLS Alt STCryptoLib Capabilities: The framework also supports Mbed TLS with alternative implementations using STCryptoLib. This provides software-based cryptographic solutions optimized for STM32 microcontrollers.
Key Wrap Engine: The Key Wrap Engine (KWE) is a PSA alternative, implemented as a PSA driver based on the CCB peripheral, to wrap, unwrap, share, and generate keys. Application code should never handle the keys directly.
Note
The PSA Cryptography API is a standard by ARM. See the Platform Security Architecture.
See Also ¶
More information about the STM32 ecosystem can be found in the STM32 MCU Developer Zone.