xref: /optee_os/core/include/drivers/caam_extension.h (revision fdc4a8bef4978835f05b1687c99e090c85b84b7c)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2023 NXP
4  */
5 #ifndef __DRIVERS_CAAM_EXTENSION_H__
6 #define __DRIVERS_CAAM_EXTENSION_H__
7 
8 #include <tee_api_defines.h>
9 #include <tee_api_types.h>
10 #include <types_ext.h>
11 
12 #ifdef CFG_NXP_CAAM_MP_DRV
13 /*
14  * Export the MPMR content.
15  * We assume that it is filled with message given in parameter.
16  * It contains 32 registers of 8 bits (32 bytes).
17  *
18  * @mpmr  [out] MPMR buffer read
19  * @size  [in/out] MPMR buffer size exported
20  */
21 TEE_Result caam_mp_export_mpmr(uint8_t *mpmr, size_t *size);
22 
23 /*
24  * Export the Manufacturing Protection Public Key.
25  *
26  * @pubkey [out] Public key read
27  * @size   [in/out] Public key size exported
28  */
29 TEE_Result caam_mp_export_publickey(uint8_t *pubkey, size_t *size);
30 
31 /*
32  * MPSign function.
33  * This function takes the value in the MPMR if it exists
34  * and concatenates any additional data (certificate).
35  * The signature over the message is done with the private key.
36  *
37  * @data	[in] Data to sign
38  * @data_size	[in] Data size to sign
39  * @sig		[out] Signature
40  * @sig_size	[in/out] Signature size
41  */
42 TEE_Result caam_mp_sign(uint8_t *data, size_t *data_size, uint8_t *sig,
43 			size_t *sig_size);
44 #endif /* CFG_NXP_CAAM_MP_DRV */
45 #endif /* __CAAM_EXTENSION_H__ */
46