AnsweredAssumed Answered

How to use Crypto Acceleration Unit (CAU) on K64 for AES and SHA

Question asked by unknowncoder on Jun 27, 2018
Latest reply on Jul 9, 2018 by unknowncoder

Hello, 

 

I am using the CAU on the K64 in the multi-threaded environment. I am using these function through the MCUXpresso SDK 2.4.0. 

If I am using the CAU for AES encrypt/decrypt can I concurrently use CAU to do SHA256. Before the AES encrypt/decrypt has finished.

 

For example consider the following call order from a single thread for simplicity.

(The function names are provided by the SDK driver)

  1. MMCAU_AES_SetKey()
    • Sets the AES encryption key in the CAU 
  2. MMCAU_SHA256_HashN()
    • User the CAU unit for SHA256, before I encrypted the data
  3. MMCAU_AES_EncryptEcb()
    • I now encrypt the data, with what I assume to be the correct key even though I called SHA256 method above.

Will the AES encryption still work correctly though I called the API to do a SHA256 hash before I called the encrypt.

Outcomes