User's Manual

RYZ012 Multi-Standard Wireless Communication Module for Bluetooth 5 Low Energy and 802.15.4
R15UH0002EU0103 Rev.1.03 Page 183 of 206
Apr.21.21
18. AES
The RYZ012 embeds an AES module with encryption and decryption function. The 128-bit plaintext input in combination with the AES key is
converted into the output ciphertext through encryption; otherwise, the 128-bit ciphertext in combination of key can also be converted into 128-
bit plaintext through decryption.
The AES hardware accelerator provides automatic encryption and decryption. It only takes 1000 system clock cycles to encrypt/decrypt an 128-
bit block. Supposed the system clock is 20MHz, the time needed for AES encryption/decryption is 50µs.
18.1 RISC Mode
For RISC mode, configuration of related registers is as follows:
1. Set the value of key through writing
AES:KEY.
2. Select AES encryption or decryption by setting
AES:CTRL:SEL as 1b'0 or 1b'1, respectively.
3. For encryption method, write registers
AES:DAT for four times to set the 128-bit plaintext. After encryption, the 128-bit ciphertext can be
obtained by reading AES:DAT for four times.
4. For decryption method, write registers
AES:DAT for four times to set the 128-bit ciphertext. After decryption, the 128-bit plaintext can be
obtained by reading AES:DAT for four times.
5.
AES:CTRL:IDRDY will be cleared automatically after quartic writing of AES:DAT.
6. AES:CTRL:ODRDY will be set as 1b'1 automatically after encryption/decryption, and then cleared automatically after quartic reading of
AES:DAT.
18.2 DMA Mode
As for DMA mode, it is only needed to configure the value of key and encryption/decryption method for AES module. See item number 1 and 2
in section
RISC Mode .
18.3 AES-CCM
The AES-CCM (Counter with the CBC-MAC) mode is disabled by default. The AES output is directly determined by current encryption and
decryption, irrespective of previous encryption and decryption result.
If
AES:CTRL:CCMEN is set as 1b'1 to enable AES-CCM mode, the AES output takes the previous encryption and decryption result into
consideration.