
NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 943 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
CBC Ciphertext-Stealing 3 Mode (CBC-CS3):
C
n-1
*
and
C
n
are unconditionally swapped, i.e., even when
C
n-1
*
is a complete block; therefore, CBC-
CS3 is not strictly an extension of CBC mode. In the other case, i.e., when
C
n-1
*
is a nonempty partial
block, CBC-CS3-Encrypt is equivalent to CBC-CS2-Encrypt.
Refer to the following programming steps for how to program the AES related registers.
AES DMA mode programming flow:
1.
Write 1 to
AESIEN
(CRPT_INTEN[0]) to enable AES interrupt.
2.
Select one from four DMA channels.
3.
Program AES key to registers
CRPT_AESn_KEY0 ~ CRPT_AESn_KEY7. (where n is the
selected channel number)
4.
Program initial vectors to registers
CRPT_AESn_IV0 ~ CRPT_AESn_IV3.
5.
Program DMA source address to register
CRPT_AESn_SADDR.
6.
Program DMA destination address to register
CRPT_AESn_DADDR.
7.
Program DMA byte count to register CRPT_
AESn_CNT.
8.
Configure AES control register
CRPT_AES_CTL for channel selection, encryption/decryption,
operational mode, DMA mode, key size, and DMA input/output swap.
9.
Write input data to DMA source address with selected DMA byte count.
10.
Write 1 to START(CRPT_AES_CTL[0]) to
start AES encryption/decryption.
11.
Waits for the AES interrupt flag AESIF
(
CRPT_INTSTS[0]) be set
.
12.
Read output data from DMA destination address with selected DMA byte count.
13.
Repeat step 9 to step 12 until all data processed.
AES Non-DMA mode programming flow:
1.
Write 1 to
AESIEN
(
CRPT_INTEN[0]) to
enable AES interrupt.
2.
Program AES key to register
CRPT_AESn_KEY0 ~ CRPT_AESn_KEY7. (where n is the
selected channel number)
3.
Program initial vectors to register
CRPT_AESn_IV0 ~ CRPT_AESn_IV3.
4.
Configure AES control register (CRPT_AES_CTL) for channel select, encryption/decryption,
operational mode, and key size.
5.
Write 1 to START(CRPT_AES_CTL[0]) to
start AES encryption/decryption.
6.
Polling INBUFFULL(CRPT_AES_STS[9]) and OUTBUFEMPTY(CRPT_AES_STS[16]). If
INBUFFULL(CRPT_AES_STS[9]) is 0, write 32 bits input data to CRPT_AES_DATIN. If
OUTBUFEMPTY(CRPT_AES_STS[16]) is 0, read 32 bits data from CRPT_AES_DATOUT.
7.
Repeat step 6 until 128 bits data (16 bytes) are written to and read from AES engine.
8.
Write 1 to DMALAST(CRPT_AES_CTL[5]).
9.
Repeat steps 6 to step 8 until all data processed.
DES/TDES (Data Encryption Standard / Triple DES)
5.27.5.3
FIPS 46-3 specifies two cryptographic algorithms, the Data Encryption Standard(DES) and the
Triple Data Encryption Algorithm (TDEA). The cryptographic accelerator supports FIPS 46-3, both
encryption and decryption, and ECB, CBC, CFB, OFB and CTR modes.
TDES DMA mode programming flow:
1.
Write 1 to
TDESIEN
(
CRPT_INTEN[8]) to
enable TDES interrupt.