31.4.11.1 CBC Encryption
In CBC encryption, the cipher input is the PlainText XOR'ed with the previous cipher output (an initialization vector IV is used during the
first block). This mode is easily implemented using the CRYPTO instruction sequence BUFTODATA0XOR, AESENC then DATA0TO-
BUF. The BUFTODATA0XOR reads data from the buffer set by READBUFSEL and XOR's it with the content in DATA0. Then the cipher
operation is performed and subsequently the DATA0TOBUF writes the content of DATA0 to the buffer set by WRITEBUFSEL (normally
the same as READBUFSEL).
Prior to the operation, the initialization vector IV and key must be loaded to DATA0 and KEYBUF, respectively. Additionally, the total
number of bytes to be included in the repeated sequence must be set in LENGTHA in CRYPTO_SEQCTRL. Finally, the buffers selec-
ted by READBUFSEL and WRITEBUFSEL must be configured correctly in the BUFC. The sequence is started by issuing the SEQ-
START command in CRYPTO_CMD.
In
Figure 31.7 CBC Encryption Operation on page 1042
the CBC encryption is illustrated and in
Table 31.9 CBC Encryption Steps on
each step in the loop is explained.
Loop 0
DATA0
DATA1
BUF
a
8
a
12
a
13
a
10
a
14
S
0,1
P
0
S
0,2
S
0,3
S
1,3
S
2,3
a
24
a
28
a
25
a
29
a
26
a
30
CBC Encryption
P
0
XOR
IV
C
0
C
0
a
0
a
4
a
1
a
5
a
2
a
6
X
P
1
C
1
C
1
P
1
XOR
C
0
Loop 1
IV
Init
1
2
3
1
2
3
Steps
Steps
Figure 31.7. CBC Encryption Operation
Table 31.9. CBC Encryption Steps
STEP
ACTION
Description
STEP0
BUFTODATA0XOR
Move data (PlainText, P
i
) from buffer to DATA0 using XOR write.
STEP1
CIPHER
The AES Cipher Core operates on DATA0
STEP2
DATA0TOBUF
The cipher output C
i
is written to the buffer.
Reference Manual
CRYPTO - Crypto Accelerator
silabs.com
| Building a more connected world.
Rev. 1.1 | 1042