AES hardware accelerator (AES)
Figure 98. 128-bit block construction with respect to data swap
DATATYPE[1:0] = 00: no swapping
MSB
Word 3
D127
1
D127
MSB
DATATYPE[1:0] = 01: 16-bit (half-word) swapping
MSB
Word 3
D127
D112 D111
1
D111
D96
D127
MSB
DATATYPE[1:0] = 10: 8-bit (byte) swapping
MSB
Word 3
D127..120
D119..112
D111.104
1
D103..96
D111.104
D119..112 D127..120
MSB
DATATYPE[1:0] = 11: bit swapping
MSB
Word 3
D127 D126 D125
D98 D97 D96 D95 D94 D93
1
D125
D126
D96
D97
D98
MSB
Legend:
AES input/output data block in memory
AES core input/output buffer data
Zero padding (example)
Data swap
Note:
The data in AES key registers (AES_KEYRx) and initialization registers (AES_IVRx) are not
sensitive to the swap mode selection.
Data padding
Figure 98
zeroed bits after the data swap form a contiguous zone at the MSB end of the AES core
input buffer. The example shows the padding of an input data block containing:
•
48 message bits, with DATATYPE[1:0] = 01
•
56 message bits, with DATATYPE[1:0] = 10
•
34 message bits, with DATATYPE[1:0] = 11
506/1390
Word 2
D96
D95
2
D96
D95
P95
Word 2
D96
D95
D80
D79
2
D112
D79
D64
D95
Word 2
D103..96
D95..88
D87..80
D79..72
2
D71...64
D79..72
D87..80
Word 2
D66 D65 D64 D63 D62 D61
2
D127
D64
D65
D66
D93
also gives an example of memory data block padding with zeros such that the
increasing memory address
byte 3
byte 2
byte 1
D63
D56
D55
D48
D47
Word 1
D64
D63
3
D64
D63
Word 1
D64
D63
D48 D47
3
D80
D47
D32
D63
Word 1
D71...64
D63...56
D55...48
D47...40
3
D95..88
D39...32
D47...40
D55...48
Word 1
3
D94
D95
D32
D33
D34
MSB
most significant bit (127) of memory data block / AEC core buffer
LSB
least significant bit (0) of memory data block / AEC core buffer
1
4
Order of write to AES_DINR / read from AES_DOUTR
Dx
input/output data bit 'x'
RM0444 Rev 5
byte 0
D40
D39
D32
Word 0
D32
D31
4
D32
D31
Word 0
D32
D31
D16
4
D48
D15
D0
Word 0
D39...32
D31...24
D23...16
4
D63...56
D7...0
D15...8
Word 0
D34 D33 D32
D31 D30 D29
4
D61
D62
D63
D0
D1
D2
RM0444
LSB
D0
D0
LSB
LSB
D15
D0
D31
D16
LSB
LSB
D15...8
D7...0
D23...16
D31...24
LSB
LSB
D2
D1
D0
D29
D30
D31
LSB
MSv42153V2
Need help?
Do you have a question about the STM32G0 1 Series and is the answer not in the manual?
Questions and answers