Hi Jing,
When MMCAU_AES_SetKey() is called it just perform the key expansion and stores the key schedule in the variable "keySch".
Does this method also setup anything in hardware registers which need to keep there state for an encryption/decryption to be successful?
The reason I am asking this is because MMCAU_AES_EncryptEcb() takes the "keySch" as an input. The "keySch" is generated by MMCAU_AES_SetKey(), therefore there nothing in the hardware register that should matter for the encryption/decryption to be successful.
If the CAU does not store anything in the hardware registers that are required to successfully encrypt/decrypt then the answer you proposed is not correct.
For Example
- MMCAU_AES_SetKey()
- This returns the key schedule. Lets call the variable "keySch"
- Do something else with the CAU for example MMCAU_SHA256_HashN()
- Call MMCAU_AES_EncryptEcb() with the input variable "keySch"
After the 3rd calls shouldn't encryption be successful?