MCUX CLNS MCUX Crypto Library Normal Secure |

mcuxClKey_Types.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2020-2021 NXP */
3 /* */
4 /* NXP Confidential. This software is owned or controlled by NXP and may */
5 /* only be used strictly in accordance with the applicable license terms. */
6 /* By expressly accepting such terms or by downloading, installing, */
7 /* activating and/or otherwise using the software, you are agreeing that */
8 /* you have read, and that you agree to comply with and are bound by, such */
9 /* license terms. If you do not agree to be bound by the applicable license */
10 /* terms, then you may not retain, install, activate or otherwise use the */
11 /* software. */
12 /*--------------------------------------------------------------------------*/
13
19 #ifndef MCUXCLKEY_TYPES_H_
20 #define MCUXCLKEY_TYPES_H_
21
22 #include <stdint.h>
23 #include <stdbool.h>
24 #include <mcuxClCss.h>
25 #include <mcuxClKey_KeyTypes.h>
26
27 /**********************************************
28 * CONSTANTS
29 **********************************************/
41 #define MCUXCLKEY_STATUS_OK ((mcuxClKey_Status_t) 0xE2E2E2E2u )
42 #define MCUXCLKEY_STATUS_ERROR ((mcuxClKey_Status_t) 0xE2E22E2Eu )
43 /* mcuxClKey_Macros */
48
49
50 /**********************************************
51 * TYPEDEFS
52 **********************************************/
63 typedef uint32_t mcuxClKey_Status_t;
64
68 typedef uint64_t mcuxClKey_Status_Protected_t;
69
73 typedef struct mcuxClKey_SrcAuxDataProvider {
74 const uint8_t * pData;
75 uint32_t slot;
76 } mcuxClKey_SrcAuxDataProvider_t;
77
81 typedef enum mcuxClKey_LoadLocation {
82 mcuxClKey_LoadLocation_NOTLOADED,
83 mcuxClKey_LoadLocation_MEMORY,
84 mcuxClKey_LoadLocation_COPRO
85 } mcuxClKey_LoadLocation_t;
86
90 typedef struct mcuxClKey_DstDataProvider {
91 uint8_t * pData;
92 uint32_t byteCount;
93 uint32_t slot;
94 mcuxClCss_KeyProp_t key_properties;
95 mcuxClKey_LoadLocation_t loadLocation;
96 } mcuxClKey_DstDataProvider_t;
97
98 /* Forward declaration */
99 struct mcuxClKey_Protection;
100
104 typedef struct mcuxClKey_Descriptor {
105 mcuxClKey_Type_t type;
106 const struct mcuxClKey_Protection * protection;
107 const uint8_t * pSrcKeyData;
108 mcuxClKey_SrcAuxDataProvider_t srcAux;
109 mcuxClKey_DstDataProvider_t dstKey;
110 } mcuxClKey_Descriptor_t;
111
115 typedef mcuxClKey_Descriptor_t * mcuxClKey_Handle_t;
116
124 typedef mcuxClKey_Status_Protected_t (*mcuxClKey_LoadFuncPtr_t)(mcuxClKey_Handle_t key);
125
133 typedef mcuxClKey_Status_Protected_t (*mcuxClKey_FlushFuncPtr_t)(mcuxClKey_Handle_t key);
134
138 typedef struct mcuxClKey_Protection {
139 mcuxClKey_LoadFuncPtr_t loadFunc;
140 mcuxClKey_FlushFuncPtr_t flushFunc;
141 uint32_t protectionTokenLoad;
142 uint32_t protectionTokenFlush;
143 } mcuxClKey_Protection_t;
144 /* mcuxClKey_Types */
148
149
150 /**********************************************
151 * FUNCTIONS
152 **********************************************/
153 /* None */
154
155 #endif /* MCUXCLKEY_TYPES_H_ */
mcuxClKey_DstDataProvider_t
struct mcuxClKey_DstDataProvider mcuxClKey_DstDataProvider_t
Type of destination information structure.
mcuxClKey_FlushFuncPtr_t
mcuxClKey_Status_Protected_t(* mcuxClKey_FlushFuncPtr_t)(mcuxClKey_Handle_t key)
Functions to flush a key from coprocessor or memory buffer.
Definition: mcuxClKey_Types.h:133
mcuxClKey_LoadLocation_MEMORY
Use key from memory.
Definition: mcuxClKey_Types.h:83
mcuxClCss_KeyProp_t
Type for CSS key store key properties.
Definition: mcuxClCss_Types.h:196
mcuxClKey_DstDataProvider::slot
uint32_t slot
Destination key slot.
Definition: mcuxClKey_Types.h:93
mcuxClKey_DstDataProvider
Type of destination information structure.
Definition: mcuxClKey_Types.h:90
mcuxClKey_Protection::flushFunc
mcuxClKey_FlushFuncPtr_t flushFunc
Function pointer to a flush function.
Definition: mcuxClKey_Types.h:140
mcuxClKey_DstDataProvider::key_properties
mcuxClCss_KeyProp_t key_properties
Requested properties of the destination key.
Definition: mcuxClKey_Types.h:94
mcuxClKey_Protection::protectionTokenLoad
uint32_t protectionTokenLoad
Protection token of the load function.
Definition: mcuxClKey_Types.h:141
mcuxClKey_LoadLocation_COPRO
Use key from HW IP.
Definition: mcuxClKey_Types.h:84
mcuxClKey_LoadLocation_t
enum mcuxClKey_LoadLocation mcuxClKey_LoadLocation_t
Type of key location definition.
mcuxClKey_LoadLocation_NOTLOADED
Key not loaded.
Definition: mcuxClKey_Types.h:82
mcuxClKey_Descriptor
Type of the key handle.
Definition: mcuxClKey_Types.h:104
mcuxClKey_DstDataProvider::pData
uint8_t * pData
Pointer to memory buffer for used as key destination.
Definition: mcuxClKey_Types.h:91
mcuxClKey_Status_Protected_t
uint64_t mcuxClKey_Status_Protected_t
Type for Key component error codes, returned by functions with code-flow protection.
Definition: mcuxClKey_Types.h:68
mcuxClKey_Type
Type to map algorithm id and size.
Definition: mcuxClKey_KeyTypes.h:53
mcuxClKey_SrcAuxDataProvider
Type of source information structure.
Definition: mcuxClKey_Types.h:73
mcuxClKey_SrcAuxDataProvider::pData
const uint8_t * pData
Pointer to memory buffer with source information.
Definition: mcuxClKey_Types.h:74
mcuxClKey_Protection::protectionTokenFlush
uint32_t protectionTokenFlush
Protection token of the flush function.
Definition: mcuxClKey_Types.h:142
mcuxClKey_LoadLocation
mcuxClKey_LoadLocation
Type of key location definition.
Definition: mcuxClKey_Types.h:81
mcuxClKey_Descriptor::srcAux
mcuxClKey_SrcAuxDataProvider_t srcAux
Provide aux information for the key.
Definition: mcuxClKey_Types.h:108
mcuxClKey_LoadFuncPtr_t
mcuxClKey_Status_Protected_t(* mcuxClKey_LoadFuncPtr_t)(mcuxClKey_Handle_t key)
Functions to load a key into coprocessor or memory buffer.
Definition: mcuxClKey_Types.h:124
mcuxClKey_SrcAuxDataProvider::slot
uint32_t slot
Source key slot.
Definition: mcuxClKey_Types.h:75
mcuxClKey_Descriptor::type
mcuxClKey_Type_t type
Define which keytype shall be loaded.
Definition: mcuxClKey_Types.h:105
mcuxClKey_Descriptor::pSrcKeyData
const uint8_t * pSrcKeyData
Provide source information for the key.
Definition: mcuxClKey_Types.h:107
mcuxClKey_Descriptor::dstKey
mcuxClKey_DstDataProvider_t dstKey
Provide destination information for the key.
Definition: mcuxClKey_Types.h:109
mcuxClKey_Descriptor_t
struct mcuxClKey_Descriptor mcuxClKey_Descriptor_t
Type of the key handle.
mcuxClKey_Status_t
uint32_t mcuxClKey_Status_t
Type for Key component error codes.
Definition: mcuxClKey_Types.h:63
mcuxClKey_Protection
Type to map load and flush functions.
Definition: mcuxClKey_Types.h:138
mcuxClKey_SrcAuxDataProvider_t
struct mcuxClKey_SrcAuxDataProvider mcuxClKey_SrcAuxDataProvider_t
Type of source information structure.
mcuxClKey_Handle_t
mcuxClKey_Descriptor_t * mcuxClKey_Handle_t
Type of opaque key handle.
Definition: mcuxClKey_Types.h:115
mcuxClKey_DstDataProvider::byteCount
uint32_t byteCount
Length field of the destination memory buffer.
Definition: mcuxClKey_Types.h:92
mcuxClKey_Descriptor::protection
const struct mcuxClKey_Protection * protection
Define which load and flush mechanism shall be used.
Definition: mcuxClKey_Types.h:106
mcuxClCss.h
Top-level include file for the CSSv2 driver.
mcuxClKey_DstDataProvider::loadLocation
mcuxClKey_LoadLocation_t loadLocation
Defines which key is used.
Definition: mcuxClKey_Types.h:95
mcuxClKey_Protection::loadFunc
mcuxClKey_LoadFuncPtr_t loadFunc
Function pointer to a load function.
Definition: mcuxClKey_Types.h:139
mcuxClKey_Protection_t
struct mcuxClKey_Protection mcuxClKey_Protection_t
Type to map load and flush functions.
mcuxClKey_KeyTypes.h
Definition of supported key types in mcuxClKey component.