MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClRsa_Types.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2024 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 <mcuxClConfig.h> // Exported features flags header
26#include <mcuxClSession.h>
29
30/***********************************************************
31 * MACROS
32 **********************************************************/
33
41/***********************************************************
42 * MACROS RELATED TO FUNCTION STATUS
43 **********************************************************/
44
51#define MCUXCLRSA_STATUS_SIGN_OK ((mcuxClRsa_Status_t) 0x0FF62E03u )
52#define MCUXCLRSA_STATUS_VERIFY_OK ((mcuxClRsa_Status_t) 0x0FF62E07u )
53#define MCUXCLRSA_STATUS_VERIFYPRIMITIVE_OK ((mcuxClRsa_Status_t) 0x0FF62E0Bu )
54#define MCUXCLRSA_STATUS_OK ((mcuxClRsa_Status_t) 0x0FF62E17u )
55#define MCUXCLRSA_STATUS_ERROR ((mcuxClRsa_Status_t) 0x0FF65330u )
56#define MCUXCLRSA_STATUS_INVALID_INPUT ((mcuxClRsa_Status_t) 0x0FF653F8u )
57#define MCUXCLRSA_STATUS_VERIFY_FAILED ((mcuxClRsa_Status_t) 0x0FF68930u )
58#define MCUXCLRSA_STATUS_FAULT_ATTACK ((mcuxClRsa_Status_t) 0x0FF6F0F0u )
59#define MCUXCLRSA_STATUS_KEYGENERATION_OK ((mcuxClRsa_Status_t) 0x0FF62E0Fu )
60#define MCUXCLRSA_STATUS_KEYGENERATION_ITERATIONSEXCEEDED ((mcuxClRsa_Status_t) 0x0FF68934u )
61#define MCUXCLRSA_STATUS_RNG_ERROR ((mcuxClRsa_Status_t) 0x0FF65338u )
62
66/***********************************************************
67 * MACROS RELATED TO RSA KEY
68 **********************************************************/
75#define MCUXCLRSA_KEY_PUBLIC (0xA5A5A5A5U)
76#define MCUXCLRSA_KEY_PRIVATEPLAIN (0x5A5A5A5AU)
77#define MCUXCLRSA_KEY_PRIVATECRT (0xB4B4B4B4U)
78#define MCUXCLRSA_KEY_PRIVATECRT_DFA (0x4B4B4B4BU)
82/***********************************************************
83 * MACROS RELATED TO PUBLIC FUNCTIONS' OPTIONS
84 **********************************************************/
91#define MCUXCLRSA_OPTION_MESSAGE_PLAIN (0XA5U)
92#define MCUXCLRSA_OPTION_MESSAGE_DIGEST (0X5AU)
93#define MCUXCLRSA_OPTION_MESSAGE_MASK (MCUXCLRSA_OPTION_MESSAGE_PLAIN | MCUXCLRSA_OPTION_MESSAGE_DIGEST)
99/**********************************************
100 * TYPEDEFS
101 **********************************************/
109/***********************************************************
110 * TYPES RELATED TO FUNCTION STATUS
111 **********************************************************/
112
116typedef uint32_t mcuxClRsa_Status_t;
117
122
123/***********************************************************
124 * TYPES RELATED TO RSA KEY
125 **********************************************************/
129typedef struct
130{
131 uint8_t* pKeyEntryData;
132 uint32_t keyEntryLength;
134
138// TODO CLNS-6135: replace all occurrences of "mcuxClRsa_KeyEntry" by "mcuxClRsa_KeyEntry_t *", which is more explicit for a type
140
144typedef struct mcuxClRsa_Key
145{
146 uint32_t keytype;
171
172
173/***********************************************************
174 * TYPES RELATED TO SIGN / VERIFY FUNCTIONALITY
175 **********************************************************/
176
181
186
192#endif /* MCUXCLRSA_TYPES_H_ */
193
Definition of function identifiers for the flow protection mechanism.
Top-level include file for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
mcuxClRsa_KeyEntry_t * mcuxClRsa_KeyEntry
Pointer type to Rsa key entries.
Definition mcuxClRsa_Types.h:139
mcuxClRsa_Status_t mcuxClRsa_Status_Protected_t
Deprecated type for RSA protected status codes.
Definition mcuxClRsa_Types.h:121
mcuxClRsa_SignVerifyMode_t * mcuxClRsa_SignVerifyMode
Pointer type to Sign/Verify mode.
Definition mcuxClRsa_Types.h:185
uint32_t mcuxClRsa_Status_t
Type for RSA status codes.
Definition mcuxClRsa_Types.h:116
struct mcuxClRsa_SignVerifyMode_t mcuxClRsa_SignVerifyMode_t
Forward declaration of Sign/Verify mode struct.
Definition mcuxClRsa_Types.h:180
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:81
Structure type for Rsa key entries, specifying key entry length and data.
Definition mcuxClRsa_Types.h:130
uint8_t * pKeyEntryData
Pointer to buffer containing the key entry data in big-endian byte order.
Definition mcuxClRsa_Types.h:131
uint32_t keyEntryLength
Byte-length of the buffer pointed to by pKeyEntryData.
Definition mcuxClRsa_Types.h:132
Structure type for Rsa key, specifying key type and key entries.
Definition mcuxClRsa_Types.h:145
mcuxClRsa_KeyEntry_t * pExp3
Pointer to sixth key entry:
Definition mcuxClRsa_Types.h:167
mcuxClRsa_KeyEntry_t * pExp1
Pointer to fourth key entry:
Definition mcuxClRsa_Types.h:160
uint32_t keytype
Key type specifier:
Definition mcuxClRsa_Types.h:146
mcuxClRsa_KeyEntry_t * pQInv
Pointer to third key entry:
Definition mcuxClRsa_Types.h:157
mcuxClRsa_KeyEntry_t * pMod2
Pointer to second key entry:
Definition mcuxClRsa_Types.h:154
mcuxClRsa_KeyEntry_t * pMod1
Pointer to first key entry:
Definition mcuxClRsa_Types.h:151
mcuxClRsa_KeyEntry_t * pExp2
Pointer to fifth key entry:
Definition mcuxClRsa_Types.h:164