Assuming initialization from reset
state and denoting plaintext as an array, m[1:x]:
Initialization:
- Write KEY0-KEY3
- Write BUF with data
corresponding to nonce, flags, and counter.
Cipher mode with µDMA:
The following can be useful if many random numbers need to be generated and
stored:
- AUTOCFG
- CTRSIZE =
CTR8/CTR16/CTR32/CTR64/CTR128
- µDMA channel A triggers
blockcipher.
- µDMA configuration: µDMA
CH A shall write TRG.AESOP = BUF all the times, single transfer per
arbitration cycle, R=0.
- TRGCHA = RDTXT3
- µDMA channel B moves
ciphertext[1:x]/random numbers to memory after channel A has triggered AES.
- ADRCHB = TXT0
- TRGCHB = AESDONE
- START: CPU writes 1 to
TRG.DMACHA
- END: CPU waits for RIS.CHBDONE
Cipher mode with CPU:
The following is useful if a single or
few random numbers are needed:
Initialization:
AUTOCFG
- CTRSIZE =
CTR8/CTR16/CTR32/CTR64/CTR128
Operation:
- CPU writes 1 to TRG.AESOP = BUF
- CPU waits for AES to complete.
- CPU reads the result