The fastest way to accelerate CBC-MAC
is to upload the next plaintext during the current encryption.
Assuming initialization from reset state and denoting plaintext as an array,
m[1:x]:
Initialization:
- Write KEY0-KEY3
- AUTOCFG:
- AESSRC = TXTXBUF
- TRGAES = WRBUF3 (Write
to BUF3 triggers AES)
- BUSHALT = EN
- Write 0 to TXT0-TXT3
Cipher mode with µDMA:
- µDMA channel A moves m[1:x] into
BUF when a new AES operation starts:
- ADRCHA = BUF0
- TRGCHA = AESSTART
- START: CPU writes 0x1 to
TRG.DMACHA to start CBC-MAC
- END : CPU waits for µDMA done
and STA.STATE = IDLE, then reads result/TAG/MIC from TXT0-TXT3
Cipher mode with CPU:
- for i = 1; i<=x, increment i:
- Wait until STA.STATE = IDLE
- Read result/TAG/MIC from
TXT0-TXT3