ST STM32F405 Reference Manual page 738

Hide thumbs Also See for STM32F405:
Table of Contents

Advertisement

Cryptographic processor (CRYP)
Note:
The header part must precede the payload and the two parts cannot be mixed together.
In CCM mode, 4 steps are required to perform and encryption or decryption:
1.
CCM init phase
In this first step, the B0 packet of the CCM message (1st packet) is programmed into
the CRYP_DIN register. During this phase, the CRYP_DOUT register does not contain
any output data.
The following sequence must be followed:
a)
b)
c)
d)
e)
f)
g)
h)
2.
CCM header phase
This step must be performed after the CCM Init phase. The sequence is identical for
encryption and decryption.
During this phase, the CRYP_DOUT register does not contain any output data.
This phase can be skipped if there is no additional authenticated data.
The following sequence must be followed:
i)
j)
738/1749
Make sure that the cryptographic processor is disabled by clearing the CRYPEN
bit in the CRYP_CR register.
Select the CCM chaining mode by programming the ALGOMODE bits to '01001'
in the CRYP_CR register.
Configure the GCM_CCMPH bits to '00' in CRYP_CR to start the CCM Init phase.
Initialize the key registers (128,192 and 256 bits) in CRYP_KEYRx as well as the
initialization vector (IV).
Set the CRYPEN bit to '1' in CRYP_CR.
Program the B0 packet into the input data register.
Wait for the CRYPEN bit to be cleared before moving on to the next phase.
Set CRYPEN to '1'.
Set the GCM_CCMPH bit to '01' in CRYP_CR to indicate that the header phase
has started.
Three methods can be used:
Program the header data by blocks of 32 bits into the CRYP_DIN register, and use
the IFNF flag to determine if the input FIFO can receive data. The size of the
header must be a multiple of 128 bits (4 words).
Program the header data into the CRYP_DIN register by blocks of 8 words, and
use the IFEM flag to determine if the input FIFO can receive data (IFEM='1'). The
size of the header must be a multiple of 128 bits (4 words).
Use the DMA.
RM0090 Rev 18
RM0090

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F405 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF