libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
CRYPTO Defines

Defined constants and Types for the STM32F4xx Crypto Coprocessor More...

Collaboration diagram for CRYPTO Defines:

Modules

 Registers (for F42xx or F43xx only)
 Register access to the CRYP controller.
 
 API (for F42xx or F43xx only)
 API for the CRYP controller.
 
 Registers (Generic)
 Register access to the CRYP controller.
 
 API (Generic)
 API for the CRYP controller.
 

Detailed Description

Defined constants and Types for the STM32F4xx Crypto Coprocessor

Version
1.0.0
Date
22 Jun 2013

LGPL License Terms libopencm3 License

Warning
The CRYP subsystem is present only in a limited set of devices, see next section for list of supported devices.

Supported devices

Theory of operation

Basic handling API

Example 1: Blocking mode

//[enable-clocks]
crypto_set_iv(iv); // only in CBC or CTR mode
foreach(block in blocks)
crypto_process_block(plaintext,ciphertext,blocksize);
void crypto_set_algorithm(enum crypto_mode mode)
Set the algorithm for Encryption/decryption.
void crypto_set_iv(uint64_t iv[])
Set Initialization Vector.
void crypto_start(void)
Enable the cryptographic controller and start processing.
uint32_t crypto_process_block(uint32_t *inp, uint32_t *outp, uint32_t length)
Start of encryption or decryption on data buffers.
void crypto_set_key(enum crypto_keysize keysize, uint64_t key[])
Set key value to the controller.
void crypto_stop(void)
Disable the cryptographic controller and stop processing.
void crypto_set_datatype(enum crypto_datatype datatype)
Set the order of the data to be crypted.
@ CRYPTO_DATA_16BIT
@ CRYPTO_KEY_128BIT
@ ENCRYPT_AES_ECB

Interrupt supported handling API

Warning
This operation mode is currently not supported.

Example 2: Interrupt mode

//[enable-clocks]
crypto_set_iv(iv); // only in CBC or CTR mode
[... API to be described later ...]

DMA handling API

Warning
This operation mode is currently not supported.

Example 3: DMA mode

//[enable-clocks]
crypto_set_iv(iv); // only in CBC or CTR mode
[... API to be described later ...]