STM32 Cryptographic Library: Cryptographic’s examples

 

Copyright 2013 STMicroelectronics

 

STM32 Cryptographic Library provides a rich set of examples covering the main features of each cryptographic algorithm. All the examples are independent from the software toolchain and evaluation board. Examples are available in source file format and user can tailor the provided project template to run the selected example with his preferred toolchain and device.

How to proceed?

  • Copy the files main.c, readme.txt from the specified example to your device tempate folder under:      
    • Project\STM32F0xx_Cryptographic_Templates. This project folder already contains all toolchain files needed for creating projects for STM32F0xx microcontrollers.
    • Project\STM32F37x_Cryptographic_Templates. This project folder contains already all toolchain files needed for creating projects for STM32F37x/38x microcontrollers.
    • Project\STM32F30x_Cryptographic_Templates. This project folder contains already all toolchain files needed for creating projects for STM32F30x/31x microcontrollers.
    • Project\STM32F4xx_Cryptographic_Templates. This project folder contains already all toolchain files needed for creating projects for STM32F40/41x microcontrollers.
    • Project\STM32F2xx_Cryptographic_Templates. This project folder contains already all toolchain files needed for creating projects for STM32F2xx microcontrollers.
    • Project\STM32F10x_Cryptographic_Templates. This project folder contains already all toolchain files needed for creating projects for STM32F10x microcontrollers.
    • Project\STM32L1xx_Cryptographic_Templates. This project folder contains already all toolchain files needed for creating projects for STM32L1xx microcontrollers.
  • Open your preferred toolchain
    • In the workspace toolbar select the project config
  • Rebuild all files and load your image into target memory
  • Run the example

STM32 Cryptographic Library Examples

The package contains the following examples:

 AES - ARC4 - ECC - HASH - RAND - RSA - TDES_DES

Cryptographic

Example

Name

 Brief description

 AES

AES128_CTR

This example describes how to use the STM32 Cryptographic Library AES-128 algorithm to:
    - Encrypt DATA with AES-128 in CTR  mode
    - Decrypt DATA with AES-128 in CTR mode

AES192_CBC

This example describes how to use the STM32 Cryptographic Library AES-192 algorithm to

    - Encrypt DATA with AES-192 in CBC  mode
    - Decrypt DATA with AES-192 in CBC mode

        AES256_ECB
This example describes how to use the STM32  Cryptographic   Library AES-256 algorithm to :
      - Encrypt DATA with AES-256 in ECB mode,
      - Decrypt DATA with AES-256 in ECB mode 

ARC4

Encryption_Decryption

This example describes how to use the STM32 Cryptographic Library ARC4 algorithm to Encrypt and Decrypt DATA using ARC4 algorithm

ECC

ECC_KeyGeneration_SignatureVerification

This example describes how to use the STM32 Cryptographic Library ECC algorithm of an ECC key generation and signature verification with Parameters for Elliptic Curve: P-192, P-256 and P-384.

       ECC_SignatureVerification This example describes how to use the STM32    Cryptographic Library ECC algorithm of an ECC signature  verification with Parameters for Elliptic CurveP-192,        P-256 and P-384.

HASH

HMAC_SHA1

This example describes how to use the STM32 Cryptographic Library SHA1 Hash algorithm of an HMAC-SHA1 calculation.

The SHA1 Hash algorithm is used to generate 20 bytes (CRL_SHA1_SIZE) HMAC digest of input message.

MD5

This example describes how to use the STM32 Cryptographic Library MD5 Hash algorithm to generate message digest.
The MD5 Hash algorithm is configured to generate 16 bytes hash digest (CRL_MD5_SIZE) and in default mode (E_HASH_DEFAULT).

SHA256

This example describes how to use the STM32 Cryptographic Library SHA-256 Hash  algorithm to generate message digest.
The SHA-256 Hash algorithm is configured to generate 32 bytes hash digest (CRL_SHA256_SIZE) and in default mode (E_HASH_DEFAULT).

RAND

Random_NumberGenerator

This example describes how to use the STM32 Cryptographic Library Random number  generator algorithm to generate an array filled with random bytes.

RSA

RSA_Signature

This example describes how to use the STM32 Cryptographic Library RSA algorithm to:
 - Generate RSA signature of a message digest using private key.
 - Verify RSA signature validity of message digest using public key.

TDES_DES

DES_CBC

This example describes how to use the STM32 Cryptographic Library DES algorithm to first encrypt Data in CBC mode, then decrypt Data.

TDES_ECB

This example describes how to use the STM32 Cryptographic Library TDES algorithm to first  encrypt Data in ECB mode, then decrypt Data.

Back to Top

 

 

For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit www.st.com/STM32