Below are the steps for CFB
decryption with 16-byte block size.
Assuming initialization from reset state and
denoting plaintext as an array, m[1:x]:
Initialization:
- Write KEY0-KEY3
- SW initializes TXT
- AUTOCFG
- AESSRC = BUF
(automatically triggered AES operations use the BUF content as
plaintext)
- TRGAES = RDTXT3 (reading
TXTXBUF3 also causes trigger, see register information)
Cipher mode with
µDMA:
Assumes CHA has
written new plaintext to BUF before reading ciphertext:
- µDMA channel A moves m[1:x] into
BUF when AES starts
- ADRCHA = BUF0
- TRGCHA = AESSTART
- DONEACT =
GATE_TRGAES_ON_CHA (to avoid spurious last AES using µDMA)
- µDMA channel B gets
ciphertext[1:x] by reading TXTXBUF when AES completes
- ADRCHB = TXTXBUF0
- TRGCHB = AESDONE
- START: CPU write 'TXT' to
TRG.AESOP to trigger first AES(K,TXT)
- END:
- CPU waits for µDMA to
signal 'done'
- CPU optionally aborts
the spurious AES by writing 0x1 to ABORT.AES
Cipher mode with
CPU:
CPU implements the µDMA
behavior. CPU needs to wait for STA.STATE = BUSY before CPU can update BUF with
ciphertext[i].