MCUX CLNS MCUX Crypto Library Normal Secure |

mcuxClKey_KeyTypes.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_KEYTYPES_H_
20 #define MCUXCLKEY_KEYTYPES_H_
21
22 #include <stdint.h>
23 #include <stdbool.h>
24
32 /**********************************************
33 * CONSTANTS
34 **********************************************/
35 /* None */
36
37 /**********************************************
38 * TYPEDEFS
39 **********************************************/
43 typedef uint16_t mcuxClKey_AlgorithmId_t;
44
48 typedef uint16_t mcuxClKey_Size_t;
49
53 typedef struct mcuxClKey_Type {
54 mcuxClKey_AlgorithmId_t algoId;
55 mcuxClKey_Size_t size;
56 void * info;
57 } mcuxClKey_Type_t;
58
59
60 /* Define algorithm IDs */
68 #define MCUXCLKEY_ALGO_ID_AES 0x0F01u
69 #define MCUXCLKEY_ALGO_ID_RSA 0x0E02u
70 #define MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP 0x0D03u
71 #define MCUXCLKEY_ALGO_ID_ECC_SHWS_GF2M 0x0C04u
72 #define MCUXCLKEY_ALGO_ID_ECC_MONT_GFP 0x0B05u
73 #define MCUXCLKEY_ALGO_ID_ECC_TWED_GFP 0x0A06u
74 #define MCUXCLKEY_ALGO_ID_ALGO_MASK 0x0FFFu
75
76 #define MCUXCLKEY_ALGO_ID_SYMMETRIC_KEY 0x0000u
77 #define MCUXCLKEY_ALGO_ID_PUBLIC_KEY 0x8000u
78 #define MCUXCLKEY_ALGO_ID_PRIVATE_KEY 0x4000u
79 #define MCUXCLKEY_ALGO_ID_KEY_PAIR 0xC000u
80 #define MCUXCLKEY_ALGO_ID_USAGE_MASK 0xC000u
81
82
86 /* Define key sizes */
94 #define MCUXCLKEY_SIZE_NOTUSED 0u
95 #define MCUXCLKEY_SIZE_128 16u
96 #define MCUXCLKEY_SIZE_192 24u
97 #define MCUXCLKEY_SIZE_256 32u
98 #define MCUXCLKEY_SIZE_512 64u
99 #define MCUXCLKEY_SIZE_2048 2048u
100 #define MCUXCLKEY_SIZE_3072 3072u
101 #define MCUXCLKEY_SIZE_4096 4096u
102
103
110 extern const mcuxClKey_Type_t mcuxKey_keyType_Aes128;
111
115 extern const mcuxClKey_Type_t mcuxKey_keyType_Aes192;
116
120 extern const mcuxClKey_Type_t mcuxKey_keyType_Aes256;
121
126 #define MCUXCLKEY_WA_SIZE_MAX 0U
127
128 /**********************************************
129 * FUNCTIONS
130 **********************************************/
131 /* None */
132 /* mcuxClKey_KeyTypes */
136
137 #endif /* MCUXCLKEY_KEYTYPES_H_ */
mcuxClKey_Type_t
struct mcuxClKey_Type mcuxClKey_Type_t
Type to map algorithm id and size.
mcuxClKey_Size_t
uint16_t mcuxClKey_Size_t
Type for algorithm based key size.
Definition: mcuxClKey_KeyTypes.h:48
mcuxClKey_Type::info
void * info
pointer to additional information for this key type (e.g. curve parameters, public exponent)
Definition: mcuxClKey_KeyTypes.h:56
mcuxKey_keyType_Aes256
const mcuxClKey_Type_t mcuxKey_keyType_Aes256
Key type pointer for AES-256 based keys.
mcuxClKey_Type
Type to map algorithm id and size.
Definition: mcuxClKey_KeyTypes.h:53
mcuxClKey_Type::algoId
mcuxClKey_AlgorithmId_t algoId
the identifier of the algorithm, refer to #mcuxClKey_KeyTypes
Definition: mcuxClKey_KeyTypes.h:54
mcuxKey_keyType_Aes128
const mcuxClKey_Type_t mcuxKey_keyType_Aes128
Key type pointer for AES-128 based keys.
mcuxClKey_Type::size
mcuxClKey_Size_t size
the key size for the key type, refer to #mcuxClKey_KeySize
Definition: mcuxClKey_KeyTypes.h:55
mcuxKey_keyType_Aes192
const mcuxClKey_Type_t mcuxKey_keyType_Aes192
Key type pointer for AES-192 based keys.
mcuxClKey_AlgorithmId_t
uint16_t mcuxClKey_AlgorithmId_t
Type for algorithm based key id.
Definition: mcuxClKey_KeyTypes.h:43