# Low-Cost Full Correlated-Power-Noise Generator to Counteract Side-Channel Attacks
## 3 AES: Structure, Implementation, and Vulnerabilities  
In this section, the AES architecture is introduced and the differences between its versions with 128- and 256-bit key lengths, their characteristics, and vulnerabilities are discussed.  
AES operates as a Symmetric Key Cryptographic (SKC) algorithm, where a single key serves for both encryption and decryption, and both the sender and receiver know its value [2]. The standard AES cipher operates with a 128-bit data block during each round until the entire input data are fully encrypted. So a given input data or plaintext will always result in the same output data or ciphertext and the same length as the input, using the same key. The AES key size may assume values of 128, 192, or 256 bits, and the number of rounds required to finalize the encryption process depends on this key length. In particular, the number of rounds, \(n_{r}\), is 10, 12, or 14 rounds for 128-bit, 192-bit, and 256-bit key sizes, respectively. In this paper, the particular implementation of the AES cipher includes both 128 and 256 key length implementation in the same cryptocircuit. The AES algorithm diagram of encryption is shown in Figure 2. Each round has four layers that handle 128-bit data blocks as was mentioned. Those layers are the _SubByte, Shiftrow, MixColumn_, and _AddRoundKey_ layers. The _SubByte_ layer employs the widely recognized Sbox matrix transformation. In simpler terms, each input state element corresponds uniquely to a specific output value. The _Shifrow_ operation entails the leftward rotation of each row within the state matrix: the first row of the AES state remains unaltered, the second row shifts one position to the left, the third row shifts two positions, and the final row shifts three positions to the left. Subsequently, the _MixColumn_ layer multiplies the state by a fixed data matrix with known values. Finally, the _AddRoundKey_ layer performs an XOR operation to incorporate the Key\({}_{i}\) obtained from the key schedule process [12]. Note that before the first round (\(n_{r}=1\)) an _AddRoundKey_ is carried out and the last round does not make use of the _MixColumn_ transformation.  
When the encryption starts, 128 bits of _plaintext_ are combined with the initial 128 bits of the original key, Key\({}_{0}\), using the Key-Addition layer through an XOR operation. After that, the Key Addition carries on being responsible for mixing the current 16-byte state matrix with a subkey that has been obtained from the original key in the Key Schedule process. The Key Schedule algorithm takes the original key (in 128-bit blocks) and generates what is known as the expanded key matrix. This algorithm is different for every key size [13]. The key expanded matrix consists of a specific number of 16-byte subkey matrix. The number of subkeys depends on the key size chosen and is equal to the number of rounds plus one. Thus, the number of rounds for AES-128 is \(n_{r}=10\), and there are 11 subkeys. In contrast, AES-256 utilizes 15 subkeys. Each of these subkeys comprises four words, which means that the expanded keys consist of 44 words for AES-128 and 60 words for AES-256.  
The implementation of the AES cipher under study in this work presents the option to choose between 128- and 256-bit key lengths, as well as to encrypt or decrypt the input message. Regarding the comparison with the state of the art, it should be noted that AES implementations can be divided into two groups, the first group focuses on low resource and power consumption [14; 15] through serialization, the reduction of the AES datapath width, etc., and the second aimed at maximizing the performance of the cipher implementation in terms of operating frequency and throughput at the expense of high resource consumption [16; 17]. Compared to the other implementations [16; 17], the selected AES implementation exhibits reduced throughput while maintaining a moderate level of resource consumption.