AnsweredAssumed Answered

Kinetis KW2X AES128 CBC and CTR (CCM)

Question asked by David Guinn on Oct 16, 2015
Latest reply on Oct 30, 2015 by George-lucian Capraru

I'm using a Kinetis KW21D512 MCU and am porting / implementing our original code from the MC1322X (MC13224).  In the original code, we are using AES 128 CCM to encrypt our data with both a key and a CTR Key.


For the MC1322X code, we use the original Freescale Security Management, which has 2 functions we use:


FuncReturn_t CipherConfigure(cipher_mode_t CipherMode, cipher_key_t *pCipherKey, ctr_value_t *pCtrValue)

FuncReturn_t CipherMsgU8(uint8_t *pu8CipherBuffer, uint8_t u8BufferLength)


But Freescale's Cau API only has a few functions for encrypting data:




So that didn't seem like it had the support we needed.  Looking at the KW2xD_SMAC example, the SecLib.h appears to have more AES128 support(which uses the 2 functions above):




Using these two function, I was able to match the same encryption as the MC1322X code.


So is there a way to tell if it is using the MCU hardware to do the encryption or if it is doing it all in software?

I set the FSL_FEATURE_SOC_CAU_COUNT macro, is that enough to set it up to use the hardware?


Thank you.