diff options
author | Breno Lima <breno.lima@nxp.com> | 2021-03-25 17:30:02 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2021-04-08 09:18:29 +0200 |
commit | 30e39ac7c937e07002e2868b23b679e6bb0f2a58 (patch) | |
tree | b26b290b9a81b45159b548de500d901c73a8d301 /include/fsl_sec.h | |
parent | ac3a16f8501e93efb8554df2dc79a96b00b6eea8 (diff) | |
download | u-boot-30e39ac7c937e07002e2868b23b679e6bb0f2a58.tar.gz |
imx: imx7 Support for Manufacturing Protection
This code was originally developed by Raul Cardenas <raul.casas@nxp.com>
and modified to be applied in U-Boot imx_v2017.03.
More information about the initial submission can be seen
in the link below:
https://lists.denx.de/pipermail/u-boot/2016-February/245273.html
i.MX7D has an a protection feature for Manufacturing process.
This feature uses asymmetric encryption to sign and verify
authenticated software handled between parties. This command
enables the use of such feature.
The private key is unique and generated once per device.
And it is stored in secure memory and only accessible by CAAM.
Therefore, the public key generation and signature functions
are the only functions available for the user.
The manufacturing-protection authentication process can be used to
authenticate the chip to the OEM's server.
Command usage:
Print the public key for the device.
- mfgprot pubk
Generates Signature over given data.
- mfgprot sign <data_address> <data_size>
Signed-off-by: Raul Ulises Cardenas <raul.casas@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'include/fsl_sec.h')
-rw-r--r-- | include/fsl_sec.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/fsl_sec.h b/include/fsl_sec.h index 1c6f1eb23e..40f1c5b10d 100644 --- a/include/fsl_sec.h +++ b/include/fsl_sec.h @@ -340,6 +340,10 @@ struct sg_entry { #endif +#define FSL_CAAM_MP_PUBK_BYTES 64 +#define FSL_CAAM_MP_PRVK_BYTES 32 +#define FSL_CAAM_MP_MES_DGST_BYTES 32 + /* blob_dek: * Encapsulates the src in a secure blob and stores it dst * @src: reference to the plaintext @@ -349,6 +353,10 @@ struct sg_entry { */ int blob_dek(const u8 *src, u8 *dst, u8 len); +int gen_mppubk(u8 *dst); + +int sign_mppubk(const u8 *m, int data_size, u8 *dgst, u8 *c, u8 *d); + #if defined(CONFIG_ARCH_C29X) int sec_init_idx(uint8_t); #endif |