In that case, you can refer to a set of standard APIs offered by GlobalPlatform (GP). This is supported on HiKey via OP-TEE, Linaro’s Trusted OS running on ‘top’ of ARM Trusted Firmware (Trustzone Framework) and included by default in the HiKey releases.
- You’ll want to look at TEE Client API Specification and TEE Internal Core API Specification
ARM Trusted Firmware
Please note that there are currently some caveats with using secure storage on HiKey OP-TEE due to hardware limitations. If you will eventually port your work to your own platform, you have to do a bit of extra work to allow it to operate fully securely. See here for details.