MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClSession_Types.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2026 NXP */
3/* */
4/* SPDX-License-Identifier: BSD-3-Clause */
5/* */
6/* Redistribution and use in source and binary forms, with or without */
7/* modification, are permitted provided that the following conditions are */
8/* met: */
9/* */
10/* 1. Redistributions of source code must retain the above copyright */
11/* notice, this list of conditions and the following disclaimer. */
12/* */
13/* 2. Redistributions in binary form must reproduce the above copyright */
14/* notice, this list of conditions and the following disclaimer in the */
15/* documentation and/or other materials provided with the distribution. */
16/* */
17/* 3. Neither the name of the copyright holder nor the names of its */
18/* contributors may be used to endorse or promote products derived from */
19/* this software without specific prior written permission. */
20/* */
21/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS */
22/* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED */
23/* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A */
24/* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
25/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
26/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
27/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR */
28/* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
29/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
30/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
31/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
32/*--------------------------------------------------------------------------*/
33
38
39#ifndef MCUXCLSESSION_TYPES_H_
40#define MCUXCLSESSION_TYPES_H_
41
42#include <mcuxClCore_Platform.h>
45
46#include <mcuxClRandom_Types.h>
48
49/**********************************************
50 * CONSTANTS
51 **********************************************/
58
59#define MCUXCLSESSION_STATUS_OK ((mcuxClSession_Status_t) 0x0EEE2E03u)
60#define MCUXCLSESSION_STATUS_ERROR ((mcuxClSession_Status_t) 0x0EEE5330u)
61#define MCUXCLSESSION_STATUS_ERROR_MEMORY_ALLOCATION ((mcuxClSession_Status_t) 0x0EEE534Fu)
62#define MCUXCLSESSION_STATUS_FAULT_ATTACK ((mcuxClSession_Status_t) 0x0EEEF0F0u)
63
64#define MCUXCLSESSION_DMACHANNEL_INVALID ((mcuxClSession_Channel_t) 0xFFFFu)
65
66
67
71/* mcuxClSession_Constants */
72
73/**********************************************
74 * TYPEDEFS
75 **********************************************/
82
86typedef uint32_t mcuxClSession_Status_t;
87
92
97{
98 uint32_t * buffer;
99 uint32_t size;
100 uint32_t used;
101 uint32_t dirty;
103
108
112struct mcuxClSession_Descriptor; /* forward declaration */
113typedef struct mcuxClSession_Descriptor mcuxClSession_Descriptor_t;
114
118typedef mcuxClSession_Descriptor_t * const mcuxClSession_Handle_t;
119
125typedef uint16_t mcuxClSession_Channel_t;
126
132typedef struct
133{
137
143typedef void (*mcuxClSession_Callback_t)(uint32_t status, void * data);
144
150MCUX_CSSL_FP_FUNCTION_POINTER(mcuxClSession_HwInterruptHandler_t,
151 typedef MCUX_CSSL_FP_PROTECTED_TYPE(void) (*mcuxClSession_HwInterruptHandler_t)(mcuxClSession_Handle_t session)
152);
153
157typedef struct mcuxClSession_HwTable mcuxClSession_HwTable_t;
158
162typedef struct
163{
164 mcuxClSession_Channels_t dmaChannels;
165 mcuxClSession_Callback_t pUserCallback;
166 void *pUserData;
167 mcuxClSession_HwInterruptHandler_t pCallBackDMA;
168 uint32_t protectionToken_pCallBackDMA;
169 mcuxClSession_HwInterruptHandler_t pCallBackCopro;
170 uint32_t protectionToken_pCallBackCopro;
171 void *pClWorkarea; /* Used for non blocking flow to handover cl data to the interrupt */
173
177typedef struct mcuxClSession_apiCall mcuxClSession_apiCall_t;
178
192
193 /* mcuxClSession_Types */
197
198#endif /* MCUXCLSESSION_TYPES_H_ */
Definition of function identifiers for the flow protection mechanism.
Type definitions of mcuxClRandom component.
Type definitions for the mcuxClResource component.
Provides the API for the CSSL flow protection mechanism.
struct mcuxClRandom_Config mcuxClRandom_Config_t
Random config type.
Definition mcuxClRandom_Types.h:142
struct mcuxClResource_Context mcuxClResource_Context_t
Resource context type.
Definition mcuxClResource_Types.h:67
mcuxClSession_Status_t mcuxClSession_Status_Protected_t
Deprecated type for mcuxClSession protected status codes.
Definition mcuxClSession_Types.h:91
struct mcuxClSession_HwTable mcuxClSession_HwTable_t
Table recording HW preempted from this session.
Definition mcuxClSession_Types.h:157
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:118
void(* mcuxClSession_Callback_t)(uint32_t status, void *data)
Session callback function pointer type.
Definition mcuxClSession_Types.h:143
struct mcuxClSession_apiCall mcuxClSession_apiCall_t
Type for mcuxClSession API calls.
Definition mcuxClSession_Types.h:177
uint32_t mcuxClSession_Status_t
Type for mcuxClSession status codes.
Definition mcuxClSession_Types.h:86
uint32_t mcuxClSession_SecurityOptions_t
Type for Session security options.
Definition mcuxClSession_Types.h:107
struct mcuxClSession_WorkArea mcuxClSession_WorkArea_t
Type for mcuxClSession workareas flags.
uint16_t mcuxClSession_Channel_t
Session channel type.
Definition mcuxClSession_Types.h:125
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:158
#define MCUX_CSSL_FP_FUNCTION_POINTER(type, definition)
Definition of a flow protected function pointer.
Definition mcuxCsslFlowProtection.h:256
Type for mcuxClSession workareas flags.
Definition mcuxClSession_Types.h:97
uint32_t size
Size of the workarea buffer in words (uint32_t).
Definition mcuxClSession_Types.h:99
uint32_t dirty
Maximum used portion of the workarea buffer in words (uint32_t).
Definition mcuxClSession_Types.h:101
uint32_t used
Used portion of the workarea buffer in words (uint32_t).
Definition mcuxClSession_Types.h:100
uint32_t * buffer
Pointer to the starting address of the workarea buffer.
Definition mcuxClSession_Types.h:98
Session channels type.
Definition mcuxClSession_Types.h:133
Type for mcuxClSession non-blocking job context.
Definition mcuxClSession_Types.h:163
Structure for mcuxClSession Descriptor.
Definition mcuxClSession_Types.h:183
mcuxClSession_JobContext_t jobContext
Context of non-blocking job.
Definition mcuxClSession_Types.h:188
mcuxClRandom_Config_t randomCfg
Configuration of the Rng (contexts and mode).
Definition mcuxClSession_Types.h:186
mcuxClSession_WorkArea_t pkcWa
Workarea for the PKC.
Definition mcuxClSession_Types.h:185
mcuxClSession_WorkArea_t cpuWa
Workarea for the CPU.
Definition mcuxClSession_Types.h:184
mcuxClSession_apiCall_t * apiCall
Context for API calls.
Definition mcuxClSession_Types.h:189
mcuxClResource_Context_t * pResourceCtx
Pointer to global resource context.
Definition mcuxClSession_Types.h:187
uint32_t * pMathUptrt
UPTRT table pointer for math operations.
Definition mcuxClSession_Types.h:190