MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClRsa_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 MCUXCLRSA_TYPES_H_
20 #define MCUXCLRSA_TYPES_H_
21 
22 #include <stdint.h>
23 #include <stddef.h>
24 #include <stdbool.h>
25 #include <mcuxClSession.h>
26 #include <mcuxClHash.h>
27 
28 /***********************************************************
29  * MACROS
30  **********************************************************/
31 
39 /***********************************************************
40  * MACROS RELATED TO FUNCTION STATUS
41  **********************************************************/
42 
49 #define MCUXCLRSA_STATUS_SIGN_OK ((mcuxClRsa_Status_t) 0xB2B26A6Au )
50 #define MCUXCLRSA_STATUS_VERIFY_OK ((mcuxClRsa_Status_t) 0xB2B23A3Au )
51 #define MCUXCLRSA_STATUS_VERIFYPRIMITIVE_OK ((mcuxClRsa_Status_t) 0xB2B2CACAu )
52 #define MCUXCLRSA_STATUS_ERROR ((mcuxClRsa_Status_t) 0xB2B2A3A3u )
53 #define MCUXCLRSA_STATUS_INVALID_INPUT ((mcuxClRsa_Status_t) 0xB2B2A5A5u )
54 #define MCUXCLRSA_STATUS_VERIFY_FAILED ((mcuxClRsa_Status_t) 0xB2B2ACACu )
55 
56 
59 /***********************************************************
60  * MACROS RELATED TO RSA KEY
61  **********************************************************/
68 #define MCUXCLRSA_KEY_PUBLIC (0xA5A5A5A5U)
69 #define MCUXCLRSA_KEY_PRIVATEPLAIN (0x5A5A5A5AU)
70 #define MCUXCLRSA_KEY_PRIVATECRT (0xB4B4B4B4U)
71 #define MCUXCLRSA_KEY_PRIVATECRT_DFA (0x4B4B4B4BU)
72 
75 /***********************************************************
76  * MACROS RELATED TO PUBLIC FUNCTIONS' OPTIONS
77  **********************************************************/
78 
84 #define MCUXCLRSA_OPTION_MESSAGE_PLAIN (0XA5U)
85 #define MCUXCLRSA_OPTION_MESSAGE_DIGEST (0X5AU)
86 #define MCUXCLRSA_OPTION_MESSAGE_MASK (MCUXCLRSA_OPTION_MESSAGE_PLAIN | MCUXCLRSA_OPTION_MESSAGE_DIGEST)
87 
92 /**********************************************
93  * TYPEDEFS
94  **********************************************/
95 
102 /***********************************************************
103  * TYPES RELATED TO FUNCTION STATUS
104  **********************************************************/
105 
110 
114 typedef uint32_t mcuxClRsa_Status_t;
115 
116 
117 /***********************************************************
118  * TYPES RELATED TO RSA KEY
119  **********************************************************/
123 typedef struct mcuxClRsa_KeyEntry_t
124 {
125  uint8_t* pKeyEntryData;
126  uint32_t keyEntryLength;
128 
133 
137 typedef struct mcuxClRsa_Key
138 {
139  uint32_t keytype;
161 } mcuxClRsa_Key;
164 
165 
166 /***********************************************************
167  * TYPES RELATED TO SIGN / VERIFY FUNCTIONALITY
168  **********************************************************/
169 
174 
179 
185 #endif /* MCUXCLRSA_TYPES_H_ */
186 
mcuxClRsa_KeyEntry pExp3
Pointer to sixth key entry:
Definition: mcuxClRsa_Types.h:160
Structure type for Rsa key entries, specifying key entry length and data.
Definition: mcuxClRsa_Types.h:123
Structure type for Rsa key, specifying key type and key entries.
Definition: mcuxClRsa_Types.h:137
mcuxClRsa_KeyEntry pExp2
Pointer to fifth key entry:
Definition: mcuxClRsa_Types.h:157
Top-level include file for the mcuxClHash component.
struct mcuxClRsa_Key mcuxClRsa_Key
Structure type for Rsa key, specifying key type and key entries.
uint8_t * pKeyEntryData
Pointer to buffer containing the key entry data in big-endian byte order.
Definition: mcuxClRsa_Types.h:125
mcuxClRsa_KeyEntry pMod2
Pointer to second key entry:
Definition: mcuxClRsa_Types.h:147
mcuxClRsa_KeyEntry_t * mcuxClRsa_KeyEntry
Pointer type to Rsa key entries.
Definition: mcuxClRsa_Types.h:132
mcuxClRsa_KeyEntry pMod1
Pointer to first key entry:
Definition: mcuxClRsa_Types.h:144
uint32_t keytype
Key type specifier:
Definition: mcuxClRsa_Types.h:139
uint32_t keyEntryLength
Byte-length of the buffer pointed to by pKeyEntryData.
Definition: mcuxClRsa_Types.h:126
struct mcuxClRsa_SignVerifyMode_t mcuxClRsa_SignVerifyMode_t
Forward declaration of Sign/Verify mode struct.
Definition: mcuxClRsa_Types.h:173
uint32_t mcuxClRsa_Status_t
Type for RSA status codes.
Definition: mcuxClRsa_Types.h:114
uint64_t mcuxClRsa_Status_Protected_t
Type for RSA protected status codes.
Definition: mcuxClRsa_Types.h:109
mcuxClRsa_SignVerifyMode_t * mcuxClRsa_SignVerifyMode
Pointer type to Sign/Verify mode.
Definition: mcuxClRsa_Types.h:178
mcuxClRsa_KeyEntry pExp1
Pointer to fourth key entry:
Definition: mcuxClRsa_Types.h:153
Top-level include file for the mcuxClSession component.
mcuxClRsa_KeyEntry pQInv
Pointer to third key entry:
Definition: mcuxClRsa_Types.h:150
struct mcuxClRsa_KeyEntry_t mcuxClRsa_KeyEntry_t
Structure type for Rsa key entries, specifying key entry length and data.