Cryptographic processor (CRYP)
19.3.3
Data type
Data enter the CRYP processor 32 bits (word) at a time as they are written into the
CRYP_DIN register. The principle of the DES is that streams of data are processed 64 bits
by 64 bits and, for each 64-bit block, the bits are numbered from M1 to M64, with M1 the left-
most bit and M64 the right-most bit of the block. The same principle is used for the AES, but
with a 128-bit block size.
The system memory organization is little-endian: whatever the data type (bit, byte, 16-bit
half-word, 32-bit word) used, the least-significant data occupy the lowest address locations.
A bit, byte, or half-word swapping operation (depending on the kind of data to be encrypted)
therefore has to be performed on the data read from the IN FIFO before they enter the
CRYP processor. The same swapping operation should be performed on the CRYP data
before they are written into the OUT FIFO. For example, the operation would be byte
swapping for an ASCII text stream.
The kind of data to be processed is configured with the DATATYPE bitfield in the CRYP
control register (CRYP_CR).
DATATYPE in
Swapping performed
CRYP_CR
00b
01b
522/1378
Table 74. Data types
Example: TDES block value
represented in system memory as:
No swapping
Example: TDES block value 0xABCD77206973FE01 is
represented in system memory as:
Half-word (16-bit)
swapping
System memory data
(plaintext or cypher)
TDES block size = 64bit = 2x 32 bit
0xABCD7720
6973FE01
TDES block size = 64bit = 2x 32 bit
0xABCD
7720
6973
FE01
RM0033 Rev 8
0xABCD77206973FE01
system memory
0xABCD7720
0x6973FE01
system memory
0x7720
ABCD
0xFE01
RM0033
is
@
@+4
@
6973
@+4
Need help?
Do you have a question about the STM32F205 series and is the answer not in the manual?
Questions and answers