MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClRsa_KeyTypes.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2024 NXP */
3/* */
4/* NXP Confidential and Proprietary. This software is owned or controlled */
5/* by NXP and may only be used strictly in accordance with the applicable */
6/* license terms. By expressly accepting such terms or by downloading, */
7/* installing, activating and/or otherwise using the software, you are */
8/* agreeing that you have read, and that you agree to comply with and are */
9/* bound by, such license terms. If you do not agree to be bound by the */
10/* applicable license terms, then you may not retain, install, activate or */
11/* otherwise use the software. */
12/*--------------------------------------------------------------------------*/
13
18
19#ifndef MCUXCLRSA_KEYTYPES_H_
20#define MCUXCLRSA_KEYTYPES_H_
21
22#include <mcuxClConfig.h> // Exported features flags header
23#include <stdint.h>
24#include <stdbool.h>
25
26#include <mcuxClKey_Types.h>
27#include <mcuxClRsa_Types.h>
28
29#include <mcuxCsslAnalysis.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/**********************************************
37 * KEY TYPE DEFS
38 **********************************************/
39
46
47MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced. ")
48
49
58extern const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_Public_4096; /* mcuxClRsa_KeyTypes_Public_Structures */
62
75static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_Public_4096 = &mcuxClKey_TypeDescriptor_Rsa_Public_4096; /* mcuxClRsa_KeyTypes_Public_Pointers */
79
80/* TODO CLNS-15273: the condition of defined(MCUXCL_FEATURE_RSA_SWONLY) shall be removed after SIGNATURE_RSA_SIGN or CIPHER_RSA_DECRYPT is enabled for NCCL */
81
91extern const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivatePlain_4096; /* mcuxClRsa_KeyTypes_PrivatePlain_Structures */
95
112
122extern const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_4096; /* mcuxClRsa_KeyTypes_PrivateCrt_Structures */
126
143
153extern const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_DFA_4096; /* mcuxClRsa_KeyTypes_PrivateCrt_DFA_Structures */
157
174
175
176MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED() /* mcuxClRsa_KeyTypes */
180
181
182/**********************************************
183 * KEY ENCODING DEFS
184 **********************************************/
185
186MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced. ")
187
192static const mcuxClKey_Encoding_t mcuxClRsa_Encoding_PrivPlainKey_Plain = &mcuxClRsa_EncodingDescriptor_PrivPlainKey_Plain;
193
198static const mcuxClKey_Encoding_t mcuxClRsa_Encoding_PublicKey_Plain = &mcuxClRsa_EncodingDescriptor_PublicKey_Plain;
199
204static const mcuxClKey_Encoding_t mcuxClRsa_Encoding_PrivCrtKey_Plain = &mcuxClRsa_EncodingDescriptor_PrivCrtKey_Plain;
205
206MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
207
208/**********************************************
209 * MACROS AND DEFINITIONS TO SETUP RSA KEY
210 **********************************************/
211
218
222typedef struct
223{
224 mcuxClRsa_KeyEntry_t modulus;
225 mcuxClRsa_KeyEntry_t exponent;
227
231typedef struct
232{
233 mcuxClRsa_KeyEntry_t p;
234 mcuxClRsa_KeyEntry_t q;
235 mcuxClRsa_KeyEntry_t qInv;
236 mcuxClRsa_KeyEntry_t dp;
237 mcuxClRsa_KeyEntry_t dq;
238 mcuxClRsa_KeyEntry_t e;
240
241// TODO CLNS-9057: remove those definitions
242#define MCUXCLRSA_KEYSTRUCT_PLAIN_SIZE (sizeof(mcuxClRsa_KeyData_Plain_t))
243#define MCUXCLRSA_KEYSTRUCT_CRT_SIZE (sizeof(mcuxClRsa_KeyData_Crt_t))
244 /* mcuxClRsa_KeyData */
248
249
250
251#ifdef __cplusplus
252} /* extern "C" */
253#endif
254
255#endif /* MCUXCLRSA_KEYTYPES_H_ */
Type definitions for the mcuxClKey component.
const mcuxClKey_EncodingDescriptor_t mcuxClRsa_EncodingDescriptor_PrivPlainKey_Plain
Plain encoding descriptor for RSA private plain keys.
const mcuxClKey_EncodingDescriptor_t mcuxClRsa_EncodingDescriptor_PrivCrtKey_Plain
Plain encoding descriptor for RSA private CRT keys.
const mcuxClKey_EncodingDescriptor_t mcuxClRsa_EncodingDescriptor_PublicKey_Plain
Plain encoding descriptor for RSA public keys.
Type definitions for the mcuxClRsa component.
const mcuxClKey_EncodingDescriptor_t * mcuxClKey_Encoding_t
Key encoding mechanism type.
Definition mcuxClKey_Types.h:144
struct mcuxClKey_EncodingDescriptor mcuxClKey_EncodingDescriptor_t
Key encoding mechanism descriptor type.
Definition mcuxClKey_Types.h:137
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition mcuxClKey_Types.h:114
struct mcuxClKey_TypeDescriptor mcuxClKey_TypeDescriptor_t
Key type descriptor type.
Definition mcuxClKey_Types.h:107
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_Public_3072
Key type structure for RSA public key and key size 3072 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_Public_1024
Key type structure for RSA public key and key size 1024 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_Public_4096
Key type structure for RSA public key and key size 4096 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_Public_2048
Key type structure for RSA public key and key size 2048 bits.
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_Public_2048
Key type pointer for RSA public key and key size 2048 bits.
Definition mcuxClRsa_KeyTypes.h:73
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_Public_3072
Key type pointer for RSA public key and key size 3072 bits.
Definition mcuxClRsa_KeyTypes.h:74
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_Public_4096
Key type pointer for RSA public key and key size 4096 bits.
Definition mcuxClRsa_KeyTypes.h:75
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_Public_1024
Key type pointer for RSA public key and key size 1024 bits.
Definition mcuxClRsa_KeyTypes.h:72
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivatePlain_1024
Key type structure for RSA private plain key and key size 1024 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivatePlain_2048
Key type structure for RSA private plain key and key size 2048 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivatePlain_3072
Key type structure for RSA private plain key and key size 3072 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivatePlain_4096
Key type structure for RSA private plain key and key size 4096 bits.
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivatePlain_4096
Key type pointer for RSA private plain key and key size 4096 bits.
Definition mcuxClRsa_KeyTypes.h:108
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivatePlain_3072
Key type pointer for RSA private plain key and key size 3072 bits.
Definition mcuxClRsa_KeyTypes.h:107
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivatePlain_2048
Key type pointer for RSA private plain key and key size 2048 bits.
Definition mcuxClRsa_KeyTypes.h:106
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivatePlain_1024
Key type pointer for RSA private plain key and key size 1024 bits.
Definition mcuxClRsa_KeyTypes.h:105
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_4096
Key type structure for RSA private CRT key and key size 4096 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_2048
Key type structure for RSA private CRT key and key size 2048 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_3072
Key type structure for RSA private CRT key and key size 3072 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_1024
Key type structure for RSA private CRT key and key size 1024 bits.
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_1024
Key type pointer for RSA private CRT key and key size 1024 bits.
Definition mcuxClRsa_KeyTypes.h:136
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_2048
Key type pointer for RSA private CRT key and key size 2048 bits.
Definition mcuxClRsa_KeyTypes.h:137
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_4096
Key type pointer for RSA private CRT key and key size 4096 bits.
Definition mcuxClRsa_KeyTypes.h:139
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_3072
Key type pointer for RSA private CRT key and key size 3072 bits.
Definition mcuxClRsa_KeyTypes.h:138
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_DFA_1024
Key type structure for RSA private CRT_DFA key and key size 1024 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_DFA_4096
Key type structure for RSA private CRT_DFA key and key size 4096 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_DFA_2048
Key type structure for RSA private CRT_DFA key and key size 2048 bits.
const mcuxClKey_TypeDescriptor_t mcuxClKey_TypeDescriptor_Rsa_PrivateCRT_DFA_3072
Key type structure for RSA private CRT_DFA key and key size 3072 bits.
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_DFA_1024
Key type pointer for RSA private CRT_DFA key and key size 1024 bits.
Definition mcuxClRsa_KeyTypes.h:167
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_DFA_3072
Key type pointer for RSA private CRT_DFA key and key size 3072 bits.
Definition mcuxClRsa_KeyTypes.h:169
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_DFA_4096
Key type pointer for RSA private CRT_DFA key and key size 4096 bits.
Definition mcuxClRsa_KeyTypes.h:170
static const mcuxClKey_Type_t mcuxClKey_Type_Rsa_PrivateCRT_DFA_2048
Key type pointer for RSA private CRT_DFA key and key size 2048 bits.
Definition mcuxClRsa_KeyTypes.h:168
Structure type for Rsa plain key data.
Definition mcuxClRsa_KeyTypes.h:223
mcuxClRsa_KeyEntry_t modulus
Key entry for the modulus.
Definition mcuxClRsa_KeyTypes.h:224
mcuxClRsa_KeyEntry_t exponent
Key entry for the exponent - it can be the public or the private exponent, depending on the key type.
Definition mcuxClRsa_KeyTypes.h:225
Structure type for Rsa CRT key data.
Definition mcuxClRsa_KeyTypes.h:232
mcuxClRsa_KeyEntry_t e
Key entry for the public exponent E - it should be specified for a key type Rsa_PrivateCRT_DFA,...
Definition mcuxClRsa_KeyTypes.h:238
mcuxClRsa_KeyEntry_t dq
Key entry for the exponent DQ = D % (Q-1).
Definition mcuxClRsa_KeyTypes.h:237
mcuxClRsa_KeyEntry_t p
Key entry for the prime factor P.
Definition mcuxClRsa_KeyTypes.h:233
mcuxClRsa_KeyEntry_t dp
Key entry for the exponent DP = D % (P-1).
Definition mcuxClRsa_KeyTypes.h:236
mcuxClRsa_KeyEntry_t q
Key entry for the prime factor Q.
Definition mcuxClRsa_KeyTypes.h:234
mcuxClRsa_KeyEntry_t qInv
Key entry for the QInv = (1 / (Q % P)).
Definition mcuxClRsa_KeyTypes.h:235