![Freescale Semiconductor i.MX 6DualLite Reference Manual Download Page 321](http://html1.mh-extra.com/html/freescale-semiconductor/i-mx-6duallite/i-mx-6duallite_reference-manual_2330523321.webp)
45.14 Load Data into a Keystore Slot
Load data into an allocated keystore slot so that other operations (such as encapsulation)
can be carried out upon it.
int sm_keystore_slot_load(struct device *dev, u32 unit, u32 slot, constu8 *key_data, u32
key_length);
Arguments:
dev
Points to a struct device established to manage resources for the secure memory
subsystem.
unit
One of the units detected with a call to sm_detect_keystore_units().
key_length
Length (in bytes) of information to write to the slot.
key_data
Pointer to buffer with the data to be loaded. Must be a contiguous buffer.
Returns:
• Zero for successful completion.
• -EFBIG if the requested size exceeds that which the slot can hold.
45.15 Demo Image Update
Encapsulate data written into a keystore slot as a Secure Memory Blob.
int sm_keystore_slot_encapsulate(struct device *dev, u32 unit, u32
inslot, u32 outslot, u16 secretlen, u8 *keymod, u16 keymodlen);
Arguments:
dev
Points to a struct device established to manage resources for the secure memory
subsystem.
unit
One of the units detected with a call to sm_detect_keystore_units().
inslot
Slot holding the input secret, loaded into that slot by sm_keystore_slot_load().
Note that the slot containing this secret should be overwritten or deallocated as soon as
practical, since it contains cleartext at this point.
outslot
Allocated slot to hold the encapsulated output as a Secure Memory Blob.
secretlen
Length of the secret to be encapsulated, not including any blob storage overhead
(blob key, MAC, etc.).
Chapter 45 CAAM (Cryptographic Acceleration and Assurance Module)
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Freescale Semiconductor, Inc.
321