4 security operation modes, 1 electronic code book (ecb), Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual
Page 94

94
8266A-MCU Wireless-12/09
ATmega128RFA1
A 16-folded read access to registers AES_KEY returns the last round key of the
preceding security operation. This is the key required for the corresponding ECB
decryption operation after an ECB encryption operation. However the initial AES key
written to the security module in advance of an AES run (see step 1 in
) is not modified during an AES operation. This initial key is used for the next
AES run although it cannot be read from AES_KEY.
Before accessing the Key Buffer it must be ensured, that the internal address counter is
initialized correctly. This is the cases after Radio Transceiver Reset (see
Transceiver Pin Register on page 169
) or a completed AES Encryption/ Decryption
operation. After an interrupted buffer read or write access, Address pointer
reinitialization is recommended by a simple read access to the AES_CTRL register.
Note:
1. ECB decryption is not required for IEEE 802.15.4 or ZigBee security processing.
The radio transceiver provides this functionality as an additional feature.
9.8.8.4 Security Operation Modes
9.8.8.4.1 Electronic Code Book (ECB)
ECB is the basic operating mode of the security module and is configured by the
AES_CTRL register. The bit AES_MODE = 0 defines the ECB mode and bit AES_DIR
selects the direction to either encryption or decryption. The data to be processed has to
be written to registers AES_STATE.
A security operation can be started by writing the start command AES_REQUEST = 1
(AES_CTRL register).
The ECB encryption operation is illustrated in
shows the ECB decryption mode which is supported in a similar way.
Figure 9-35. ECB Mode - Encryption
Block Cipher
Encryption
Encryption
Key
Plaintext
Ciphertext
Block Cipher
Encryption
Plaintext
Ciphertext
Encryption
Key
Figure 9-36. ECB Mode - Decryption
Block Cipher
Decryption
Decryption
Key
Plaintext
Ciphertext
Block Cipher
Decryption
Decryption
Key
Plaintext
Ciphertext
Due to the nature of AES algorithm the initial key to be used when decrypting is not the
same as the one used for encryption. Instead it is the last round key. This last round