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

Defined Constants and Types for the STM32F2xx CRYP Controller More...

Collaboration diagram for CRYPTO Defines:

Modules

 Registers (Generic)
 Register access to the CRYP controller.
 
 API (Generic)
 API for the CRYP controller.
 

Detailed Description

Defined Constants and Types for the STM32F2xx CRYP Controller

Version
1.0.0
Date
17 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 ...]