MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClOsccaSm2_ModeConstants.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2023 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
40
41#ifndef MCUXCLOSCCASM2_MODECONSTANTS_H_
42#define MCUXCLOSCCASM2_MODECONSTANTS_H_
43
44#include <mcuxCsslAnalysis.h>
46#ifdef MCUXCL_FEATURE_SM2_SIGNATURE
47#include <mcuxClSignature_Types.h>
48#endif /* MCUXCL_FEATURE_SM2_SIGNATURE */
49#ifdef MCUXCL_FEATURE_KEY_GENERATION
50#include <mcuxClKey_Types.h>
51#endif /* MCUXCL_FEATURE_KEY_GENERATION */
52#ifdef MCUXCL_FEATURE_SM2_CIPHER
53#include <mcuxClCipher_Types.h>
54#endif /* MCUXCL_FEATURE_SM2_CIPHER */
55
56#ifdef __cplusplus
57extern "C"
58{
59#endif
60
61
62MCUX_CSSL_ANALYSIS_START_PATTERN_EXTERNAL_API_DECLARATIONS()
63
64#ifdef MCUXCL_FEATURE_SM2_INTERNAL
65
72
73
74/* The parameters for SM2 256-bit standard elliptic curves in the prime field */
75extern const mcuxClOsccaSm2_DomainParam_t mcuxClOsccaSm2_DomainParams_SM2P256_Std;
76
77/* The parameters for SM2 256-bit extend elliptic curves in the prime field */
78extern const mcuxClOsccaSm2_DomainParam_t mcuxClOsccaSm2_DomainParams_SM2P256_Ext;
79
80#ifdef MCUXCL_FEATURE_SM2_SIGNATURE
84extern const mcuxClSignature_ModeDescriptor_t mcuxClSignature_ModeDescriptor_SM2;
85
89static mcuxClSignature_Mode_t mcuxClSignature_Mode_SM2 =
90 &mcuxClSignature_ModeDescriptor_SM2;
91
92
93#ifdef MCUXCL_FEATURE_SIGNATURE_SELFTEST
97extern const mcuxClSignature_TestDescriptor_t mcuxClSignature_TestDescriptor_SM2_VerifyOnly;
98
102static mcuxClSignature_Test_t mcuxClSignature_Test_SM2_VerifyOnly =
103 &mcuxClSignature_TestDescriptor_SM2_VerifyOnly;
104
108extern const mcuxClSignature_TestDescriptor_t mcuxClSignature_TestDescriptor_SM2_SignVerify;
109
113static mcuxClSignature_Test_t mcuxClSignature_Test_SM2_SignVerify =
114 &mcuxClSignature_TestDescriptor_SM2_SignVerify;
115
116#endif /* MCUXCL_FEATURE_SIGNATURE_SELFTEST */
117
118#endif /* MCUXCL_FEATURE_SM2_SIGNATURE */
119
120#ifdef MCUXCL_FEATURE_KEY_GENERATION
121#ifdef MCUXCL_FEATURE_SM2_KEYGEN
125extern const mcuxClKey_GenerationDescriptor_t mcuxClKey_GenerationDescriptor_SM2;
126
130static mcuxClKey_Generation_t mcuxClKey_Generation_SM2 =
131 &mcuxClKey_GenerationDescriptor_SM2;
132#endif /* MCUXCL_FEATURE_SM2_KEYGEN */
133#endif /* MCUXCL_FEATURE_KEY_GENERATION */
134
135#ifdef MCUXCL_FEATURE_SM2_CIPHER
136
137extern const mcuxClCipher_ModeDescriptor_t mcuxClOscca_Cipher_ModeDesc_SM2_ENC;
138static mcuxClCipher_Mode_t mcuxClCipher_Mode_SM2_ENC =
139 &mcuxClOscca_Cipher_ModeDesc_SM2_ENC;
140
141extern const mcuxClCipher_ModeDescriptor_t mcuxClOscca_Cipher_ModeDesc_SM2_DEC;
142static mcuxClCipher_Mode_t mcuxClCipher_Mode_SM2_DEC =
143 &mcuxClOscca_Cipher_ModeDesc_SM2_DEC;
144
145
146#endif /* MCUXCL_FEATURE_SM2_CIPHER */
147
148#ifdef MCUXCL_FEATURE_SM2_KEYAGREEMENT
149extern const mcuxClKey_AgreementDescriptor_t mcuxClOsccaSm2_AgreementDesc_Initiator;
150static mcuxClKey_Agreement_t mcuxClOsccaSm2_Agreement_Initiator =
151 &mcuxClOsccaSm2_AgreementDesc_Initiator;
152
153extern const mcuxClKey_AgreementDescriptor_t mcuxClOsccaSm2_AgreementDesc_Responder;
154static mcuxClKey_Agreement_t mcuxClOsccaSm2_Agreement_Responder =
155 &mcuxClOsccaSm2_AgreementDesc_Responder;
156
157extern const mcuxClKey_TestDescriptor_t mcuxClKey_TestDescriptor_SM2_Agreement;
158static mcuxClKey_Test_t mcuxClKey_Test_SM2_Agreement =
159 &mcuxClKey_TestDescriptor_SM2_Agreement;
160#endif /* MCUXCL_FEATURE_SM2_KEYAGREEMENT */
161 /* mcuxClOsccaSm2_ModeConstants */
165
166 #endif /* MCUXCL_FEATURE_SM2_INTERNAL */
167
168 MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXTERNAL_API_DECLARATIONS()
169
170#ifdef __cplusplus
171} /* extern "C" */
172#endif
173
174#endif /* MCUXCLOSCCASM2_MODECONSTANTS_H_ */
Type definitions for the mcuxClCipher component.
Type definitions for the mcuxClKey component.
Type definitions of mcuxClOsccaSm2 component.
struct mcuxClCipher_ModeDescriptor mcuxClCipher_ModeDescriptor_t
Cipher mode/algorithm descriptor type.
Definition mcuxClCipher_Types.h:74
const mcuxClCipher_ModeDescriptor_t *const mcuxClCipher_Mode_t
Cipher mode/algorithm type.
Definition mcuxClCipher_Types.h:81
struct mcuxClKey_GenerationDescriptor mcuxClKey_GenerationDescriptor_t
Key generation descriptor type.
Definition mcuxClKey_Types.h:238
const mcuxClKey_GenerationDescriptor_t *const mcuxClKey_Generation_t
Key generation type.
Definition mcuxClKey_Types.h:245
const mcuxClSignature_TestDescriptor_t *const mcuxClSignature_Test_t
Signature selftest mode/algorithm type.
Definition mcuxClSignature_Types.h:95
struct mcuxClSignature_TestDescriptor mcuxClSignature_TestDescriptor_t
Signature selftest mode/algorithm descriptor type.
Definition mcuxClSignature_Types.h:88
const mcuxClSignature_ModeDescriptor_t *const mcuxClSignature_Mode_t
Signature mode/algorithm type.
Definition mcuxClSignature_Types.h:72
struct mcuxClSignature_ModeDescriptor mcuxClSignature_ModeDescriptor_t
Signature mode/algorithm descriptor type.
Definition mcuxClSignature_Types.h:65