i.MX95 Bare Metal NVM Service for EdgeLock Secure Enclave RM00284 (HSM API documentation) mentions a Linux filesystem managed by the ELE. I'm assuming this is implemented in the imx drivers available on Linux. We are running bare metal applications on the A55 cores and I'm wondering whether we need to provide an NVM service. Assumptions: 1. You may store up to 2 key groups with volatile (non-persistent) keys without any NVM service. 2. If you want any key to be persistent, or if you want to have >=3 key groups, an NVM service is required. 3. There is no way to generate opaque keys to be used across power cycles without an NVM service. Questions: 1. Is it appropriate to use the imx-secure-enclave repository, along with our own implementations of functions like plat_os_abs_set_mu_chnl_as_nvm(), plat_os_abs_storage_write(), plat_os_abs_storage_read(), plat_os_abs_storage_write_chunk(), etc.? 2. Does this NVM service need to be running before using any persistent opaque keys? 3. If we want to use a persistent opaque key to verify a signature on an image before running it, but the image itself contains the NVM service, what alternatives can we pursue? 4. What's a good approach to sharing a secret (e.g., AES key) across a fleet of boards? Can this be done at the fab upon request for i.MX95, or do we need to import keys after we receive the boards? If we need to import them, can we use the SPSDK (or something similar) to import the secret as ciphertext where only that specific board can see the actual secret? Re: i.MX95 Bare Metal NVM Service for EdgeLock Secure Enclave Hello,
First I would like to clarify that the ELE itself has no direct access to non-volatile memory. It instead relies on an external NVM manager/daemon to read and write encrypted blobs to storage. In our Linux BSP, this is implemented as nvm_daemon, a systemd service from the imx-secure-enclave package.
With the above in consideration let me go through your assumptions and your questions below: All three assumptions are correct: Assumption 1 Up to 2 key groups can be held in the HSM's local secure RAM at any time without needing to interact with the NVM. A swap mechanism is managed by the ELE firmware when more than 2 key groups are needed.
Assumption 2 The STRICT OPERATION (SYNC) flag triggers the write to NVM. Any operations without this flag affect local memory only and are lost on power cycle. Also, the Storage open (0xE0) service must be opened prior to any NVM-backed key operations.
Assumption 3 A persistent key attribute alone is not enough, the SYNC operation must be executed, and the NVM service must be present. Without executing this operation, even if the key attribute is set as persistent at key creation, the key will not be stored in the NVM.
Question 1 Yes, this is the correct approach the NVM service in https://github.com/nxp-imx/imx-secure-enclave is an OS abstraction layer, functions like plat_os_abs_storage_write(), plat_os_abs_storage_read(), plat_os_abs_storage_write_chunk() are exactly the platform portability hooks meant to be replaced for non-Linux environments.
Question 2 Yes, ELE User Guide defines the required flow: > Session open (0x10) > Storage open (0xE0) ##To be able to retrieve persistent key from NVM, storage service must be opened using Storage open (0xE0) API.## > Key store load (open with LOAD flag, same ID/Nonce used at creation) > Cryptographic operation
If the NVM daemon is not running when the ELE tries to perform an NVM operation, the operation will fail
Question 3 For this you may use AHAB, as this is used as a pre-OS verification, authentication is performed using keys stored in OTP (SRKH fuses) and you may use SPSDK for building and signing AHAB images for i.MX95.
Question 4 You may do either of the two, for provisioning at the fab using ELE2GO is an option, unfortunately support on the i.MX95 is still in development.
You may also do this securely post-delivery using the Key Exchange + Key Import flow. The mechanism works as follows:
> The ELE holds a built-in key called "NXP PROD MANUFACT KEY AGREEMENT" (key ID 0x70000000). Its public key is exportable. This key is the same across all devices with the same SRKH fused.
> You perform a Key Exchange (0x47) using ECDH-HKDF to derive OEM_IMPORT_MK_SK on the device. From this, two sub-keys are derived: OEM_IMPORT_WRAP_SK (for AES encryption of the payload) and OEM_IMPORT_CMAC_SK (for CMAC authentication of the TLV blob).
> On your provisioning server, you wrap your AES secret with OEM_IMPORT_WRAP_SK and sign the TLV blob with OEM_IMPORT_CMAC_SK, constructing a Key Import (0x4F) TLV payload. You import the blob into that specific device. Because wrapping keys are derived from per-device material (SRKH), only that specific board can decrypt the actual secret.
And the SPSDK is the correct tool for this. It includes nxpimage (for generating signed content for Key Exchange and building the Key Import TLV blob) and nxpcrypto. The full flow is documented in the following app note https://docs.nxp.com/bundle/AN14898/page/topics/workflow.html
Hope this helps, Best regards/Saludos, Aldo.
記事全体を表示