5.2 AES Encryption
Before discussing the steps of the encryption process, the concept ‘encryption round’ needs to be introduced. Most block ciphers consist of a few operations that are executed in a loop a number of times. Each loop iteration uses a different encryption key. At least one of the operations in each iteration depends on the key. The loop iterations are referred to as encryption rounds, and the series of keys used for the rounds is called the key schedule. The number of rounds depends on the key size.
The flowchart for the encryption process is shown in the following figure. The following subsections explain the different steps in the process. Each step is implemented as a subroutine for convenience. Using an optimizing compiler removes unnecessary function calls to save code memory.