SLAU846B June 2023 – November 2024 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3106 , MSPM0G3107 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507
The counter mode leverages a nonce (number used once) and a counting integer to generate a keystream by appending the counter to the nonce and encrypting the combined nonce || counter value with the cipher key.
The nonce must only be used once with a given key k. The counter value can start from any value and is incremented for each 128-bit block of data.
The keystream is derived be encrypting the nonce || counter value for each 128-bit data block with the cipher key k. The output ciphertext is then obtained by XORing the plaintext with the encrypted nonce || counter value for each data block. The CTR cipher is shown in Figure 23-9.
The AES accelerator can be used to accelerate CTR ciphers by accelerating the encryption of each nonce || counter value with the cipher key k, and accelerating the XOR operation of the plaintext (in the case of encryption) or ciphertext (in the case of decryption) with the keystream. DMA trigger generation is not supported when implementing a CTR cipher.