I'm new to the EdgeLock Secure Enclave ("ELE" in the KW45 reference manual) and I have several questions I couldn't find answers in various NXP resources online:
1) Where can I find more detailed documentation for the KW45Z41083 CPU's implementation of ELE and the specific commands/responses that can be sent via the MU interface to the ELE from the Cortex-M33?
I found a "RM00284 EdgeLock Enclave Hardware Security Module API Rev. 3.2 — 16 December 2024" PDF somewhere but it seems pretty specific to the i.MX family. I'm looking for something specific to the Kinetis KW family.
2) What is the firmware in nxp\secure-subsystem\firmware\ele_200_fw.h? I'm not currently using it or doing any sort of firmware downloading to the ELE. I need TRNG and crypto (AES CBC and GCM) in my app and all of that seems to work out of the box, so the ELE already seems to be flashed with some sort of NXP default firmware.
I see there are a few examples in the SDK that download the ele_200_fw.h firmware. Why do they need to do that? Is that download just overriding the built-in ELE ROM firmware with a newer version that runs out of RAM and overrides the ROM code?
3) Is there a github where you release new KW45 ELE firmware updates along with release notes for each release? Or are they only available in SDK updates?
4) For crypto functions, my app runs MU commands that allocate and deallocate various key and context structures in the ELE. Some of the deallocate functions mention "defragmentation" of the ELE memory on freeing the resources. If the Cortex-M33 reboots through a watchdog or software reset, is the ELE also guaranteed to reboot and free up any resources I previously allocated? If not, is there a way to command the ELE to reboot? I'm concerned that if the ELE CPU doesn't reboot, it's memory could fill up over time or become too fragmented to allocate new resources.
5) In some of the crypto examples in the SDK, various data structures are purposely aligned on 8-byte boundaries with the SDK_ALIGN() macro:
SDK_ALIGN(static const uint8_t s_GcmKey[16], 8u) =
{ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08};
Other examples don't do this. I have a test app that does thousands of CBC and GCM encrypt/decrypt sequences and all of the tests pass without using the SDK_ALIGN() macro. Is it really needed? If not, I think it should be deleted from the SDK examples because it adds complexity and confusion.
6) There exists a set of test vectors for AES GCM at https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/mac/g.... I created a test app for the gcmEncryptExtIV128.rsp in that zip. My test runs each encryption, verifies the ciphertext and tag, then decrypts and verifies the original plaintext is recovered.
All of the thousands of GCM test vectors work using the KW45 ELE except test vectors with a Tag less than 12 bytes. Is this restriction documented somewhere? One thing that is concerning is that if you try to encrypt and request an 8-byte tag, 16 bytes of tag data are returned in the tag buffer provided to the encryption function. This is a buffer overrun error and could easily crash an application.