Getting started with the Cryptographic Library

Revision as of 16:35, 29 April 2021 by Registered User (Created page with "This page explains how to use the [https://www.st.com/en/embedded-software/x-cube-cryptolib.html STM32 cryptographic firmware library software expansion for STM32Cube] package...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page explains how to use the STM32 cryptographic firmware library software expansion for STM32Cube package once you've downloaded it.

1. Package Structure & Contents

After uncompressing the package, you'll have this usual folder structure: Folder.png

As described in Getting started#STM32Cube MCU Package(software_package)


The Cryptographic Library middleware folder in details:

  • ...\Middlewares\ST\STM32_Cryptographic\include
    • Cryptographic library header files
  • ...\Middlewares\ST\STM32_Cryptographic\interface
    • Low layer template files to implement in your project to use the Cryptographic Library
  • ...\Middlewares\ST\STM32_Cryptographic\lib
    • Cryptographic libraries to link into your project
  • ...\Middlewares\ST\STM32_Cryptographic\legacy_v3
  • ...\Middlewares\ST\STM32_Cryptographic\CMOX.chm
    • The complete Cryptographic Library API documentation

2. Creating a project that embeds the Cryptographic Library

2.1. Select a library

Add the library corresponding to your needs to your project.

Example: choose libSTM32Cryptographic_CM33.a to build a project for a Arm® Cortex®-M33 based STM32 SoC.

Info white.png Information
NOTE: Arm® is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.

2.2. Include path

Add the path to the include folder to your project settings.

2.3. Interface files

  • Copy the cmox_low_level_template.c file from the interface folder to your project specific source folder, renaming it into “cmox_low_level.c”.
  • Add this copied file to your project.
  • Tune this file by including the right STM32 HAL driver header instead of the comment:
    • /* #include "stm32<series>xx_hal.h" */

2.4. Implement your application

Everything is ready, you can now write your own application calling the cryptographic library services.

Warning white.png Warning
Do not forget to include the header file cmox_crypto.h to your c files that will call the Cryptographic Library services.


Info white.png Information
NOTE: To help you in this process, you can refer to the application examples provided or looking at the CMOX.chm file for a detailed description of the different APIs.