MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClOsccaSm2_Types.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2024 NXP */
3/* */
4/* NXP Proprietary. 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 */
10/* license terms, then you may not retain, install, activate or otherwise */
11/* use the software. */
12/*--------------------------------------------------------------------------*/
13
20#ifndef MCUXCLOSCCASM2_TYPES_H_
21#define MCUXCLOSCCASM2_TYPES_H_
22
23
24#include <stdint.h>
25#include <mcuxClConfig.h> // Exported features flags header
26#include <mcuxClOscca_Types.h>
27#include <mcuxClCore_Macros.h>
30#include <mcuxCsslAnalysis.h>
31
32/**********************************************
33 * TYPEDEFS
34 **********************************************/
42/***********************************************************
43 * TYPES RELATED TO FUNCTION STATUS
44 **********************************************************/
45
49typedef uint32_t mcuxClOsccaSm2_Status_t;
50
51
52/***********************************************************
53 * MACROS
54 **********************************************************/
55
62#define MCUXCLOSCCASM2_CEILING(x,y) (((x) + (y) - 1u) / (y))
63#define MCUXCLOSCCASM2_BYTELEN(bitLen) (((bitLen) + 7u) / 8u)
64
69#define MCUXCLOSCCASM2_ENCDEC_FORMAT_INDICATOR_SIZE (1u)
70#define MCUXCLOSCCASM2_SM2P256_SIZE_PRIVATEKEY (32u)
71#define MCUXCLOSCCASM2_SM2P256_SIZE_PUBLICKEY (2u * MCUXCLOSCCASM2_SM2P256_SIZE_PRIVATEKEY)
72#define MCUXCLOSCCASM2_SM2P256_SIZE_SHAREDSECRET (32u)
73#define MCUXCLOSCCASM2_SM2P256_SIZE_PRIMEP (32u)
74#define MCUXCLOSCCASM2_SM2P256_SIZE_BASEPOINTORDER (32u)
75#define MCUXCLOSCCASM2_SM2P256_SIZE_MAX (32u) /* MCUXCLOSCCASM2_SM2P256_SIZE_ */
77#ifdef MCUXCL_FEATURE_SM2_SIGNATURE
78#define MCUXCLOSCCASM2_SM2P256_SIZE_SIGNATURE (2u * MCUXCLOSCCASM2_SM2P256_SIZE_BASEPOINTORDER)
79#endif /* MCUXCL_FEATURE_SM2_SIGNATURE */
80
81#ifdef MCUXCL_FEATURE_SM2_CIPHER
82#define MCUXCLOSCCASM2_SM2P256_SIZE_CIPHER_MESSAGE (128U)
83#endif /* MCUXCL_FEATURE_SM2_CIPHER */
84
85/**********************************************************/
86/* Parameter structure of mcuxClOscca SM2 APIs */
87/**********************************************************/
88typedef struct mcuxClOsccaSm2_DomainParam mcuxClOsccaSm2_DomainParam_t;
89
90#ifdef MCUXCL_FEATURE_SM2_INTERNAL
91#ifdef MCUXCL_FEATURE_SM2_SIGNATURE
92typedef struct mcuxClOsccaSm2_SignatureProtocolDescriptor mcuxClOsccaSm2_SignatureProtocolDescriptor_t;
93#endif /* MCUXCL_FEATURE_SM2_SIGNATURE */
94#endif /* MCUXCL_FEATURE_SM2_INTERNAL */
95
96/***********************************************************
97 * MACROS RELATED TO FUNCTION STATUS
98 **********************************************************/
99
106#define MCUXCLOSCCASM2_STATUS_OK ((mcuxClOsccaSm2_Status_t)0x011B2E03u)
107#define MCUXCLOSCCASM2_STATUS_FAILURE ((mcuxClOsccaSm2_Status_t)0x011B5354U)
108#define MCUXCLOSCCASM2_STATUS_INVALID_PARAMS ((mcuxClOsccaSm2_Status_t)0x011B5330u)
109#define MCUXCLOSCCASM2_STATUS_RNG_ERROR ((mcuxClOsccaSm2_Status_t)0x011B5334U)
110#define MCUXCLOSCCASM2_STATUS_INVALID_SIGNATURE ((mcuxClOsccaSm2_Status_t)0x011B8930u)
111#define MCUXCLOSCCASM2_STATUS_FAULT_ATTACK ((mcuxClOsccaSm2_Status_t)0x011BF0F0u)
112 /* mcuxClOsccaSm2_Types */
116
117
118#endif /* MCUXCLOSCCASM2_TYPES_H_ */
Definition of macros.
Definition of function identifiers for the flow protection mechanism.
: Global type definitions
Provides the API for the CSSL flow protection mechanism.
uint32_t mcuxClOsccaSm2_Status_t
Type for SM2 status codes.
Definition mcuxClOsccaSm2_Types.h:49