SLAU846B June 2023 – November 2024 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1519 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3519
When decryption is performed using OPx=0x1, the original cipher key used for encryption is loaded into AESAKEY. Decryption requires execution of the key schedule to obtain the round key used for the last round of encryption. That final encryption round key is then used by the decryption logic as the first round key for decryption. In the case of OPx=0x1, before the decryption begins the key schedule will be executed on the key material loaded into AESAKEY to obtain the last round key. Once the last round key used for encryption is generated, the decryption process begins automatically.
While OPx=0x1 is convenient for single block cases (as the original encryption key can be loaded without special handling), it is not efficient for handling multiple blocks, because the key schedule will be executed for each block to obtain the last round key which is needed to start the decryption process. To reduce the cycle count required for decryption, it is possible to pregenerate the last round encryption key using OPx=0x2. Then that pregenerated round key can be used to immediately start any decryption operations by loading the pregenerated key material and running the OPx=0x3 decryption operation, which assumes that the key material is the round key from the last round of encryption.
To execute the key schedule and obtain the last round key used for encryption (first round key used for decryption) without actually running a decryption operation, follow the steps below:
Once a decryption first round key is generated, it can be loaded into AESAKEY and used for decryption with OPx=3.