I am following the example code from the file: K82P121M150SF5RM.pdf for the Freedom K82f board.
In page 174, there is an example on what the keyblob should look like before and after AES-128 encryption.
I do not see however, an explanation on how the CRC32 checksum is calculated. I have tried using the fsl_crc code, but it gives me different checksum values.
Unlikely but possible: The description says the en address is 0x68ffffff, but the memdump says the value is 0x68fffffb. But I am not sure about this, since the lower part of the end address is supposed to correspond to other flags.
- Must the keyblob always be aes-128 encrypted?
- Is it mandatory to use an encrypted keyblob to use the OTFAD?
- Is there already an AES-128 implementation included somewhere on the SDK?
An extract of my code, basically copied from the crc example on the SDK:
static void InitCrc32(CRC_Type *base, uint32_t seed)
config.polynomial = 0x04C11DB7U;
config.seed = seed;
config.reflectIn = true;
config.reflectOut = true;
config.complementChecksum = true;
config.crcBits = kCrcBits32;
config.crcResult = kCrcFinalChecksum;
static uint32_t calc_crc32(uint8_t* data, size_t len)
CRC_Type *base = CRC0;
CRC_WriteData(base, data, len);
checksum32 = CRC_Get32bitResult(base);
crc32 = calc_crc32((uint8_t*)data, 0x20);
Any pointers will be greatly appreciated.