MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClEcc_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
40#ifndef MCUXCLECC_TYPES_H_
41#define MCUXCLECC_TYPES_H_
42
43
44#include <mcuxClCore_Platform.h>
46#include <mcuxClEcc_Constants.h>
47#include <mcuxCsslAnalysis.h>
48#include <mcuxClBuffer.h>
49
50#include <mcuxClSignature_Types.h>
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
62
66typedef uint32_t mcuxClEcc_Status_t;
67
72
73
74#ifdef MCUXCL_FEATURE_ECC_MONTDH
76typedef struct mcuxClEcc_MontDH_DomainParams mcuxClEcc_MontDH_DomainParams_t;
77#endif /* MCUXCL_FEATURE_ECC_MONTDH */
78
79#ifdef MCUXCL_FEATURE_ECC_EDDSA
80
82typedef struct mcuxClEcc_EdDSA_DomainParams mcuxClEcc_EdDSA_DomainParams_t;
83
87struct mcuxClEcc_EdDSA_GenerateKeyPairDescriptor;
88
92typedef struct mcuxClEcc_EdDSA_GenerateKeyPairDescriptor mcuxClEcc_EdDSA_GenerateKeyPairDescriptor_t;
93
97struct mcuxClEcc_EdDSA_SignatureProtocolDescriptor;
98
102typedef struct mcuxClEcc_EdDSA_SignatureProtocolDescriptor mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t;
103#endif /* MCUXCL_FEATURE_ECC_EDDSA */
104
105#ifdef MCUXCL_FEATURE_ECC_ARITHMETICOPERATION
109struct mcuxClEcc_ArithmeticOperationDescriptor;
110
114typedef struct mcuxClEcc_ArithmeticOperationDescriptor mcuxClEcc_ArithmeticOperationDescriptor_t;
115
119typedef const mcuxClEcc_ArithmeticOperationDescriptor_t * mcuxClEcc_ArithmeticOperation_t;
120#endif /* MCUXCL_FEATURE_ECC_ARITHMETICOPERATION */
121
123typedef struct mcuxClEcc_Weier_DomainParams mcuxClEcc_Weier_DomainParams_t;
124
128struct mcuxClEcc_WeierECC_PointEncDescriptor;
129
133typedef struct mcuxClEcc_WeierECC_PointEncDescriptor mcuxClEcc_WeierECC_PointEncDescriptor_t;
134
139
143struct mcuxClEcc_ECDSA_SignatureProtocolDescriptor;
144
148typedef struct mcuxClEcc_ECDSA_SignatureProtocolDescriptor mcuxClEcc_ECDSA_SignatureProtocolDescriptor_t;
149
150/**********************************************************/
151/* Parameter structure of mcuxClEcc APIs */
152/**********************************************************/
153
154
156typedef struct {
158 uint32_t pLen;
163 uint32_t nLen;
165
166 /* mcuxClEcc_Types */
170
171
172/**********************************************************/
173/* Descriptors of mcuxClEcc APIs */
174/**********************************************************/
181
182#ifdef MCUXCL_FEATURE_ECC_EDDSA
183
187
188/**********************************************************/
189/* Signature ProtocolDescriptors and ModeDescriptors */
190/**********************************************************/
191
195extern const mcuxClSignature_ModeDescriptor_t mcuxClSignature_ModeDescriptor_Ed25519;
196
197MCUX_CSSL_ANALYSIS_START_PATTERN_URL_IN_COMMENTS()
213MCUX_CSSL_ANALYSIS_STOP_PATTERN_URL_IN_COMMENTS()
214MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by mcuxClSignature component. Hence, it is declared but never referenced.")
215static mcuxClSignature_Mode_t mcuxClSignature_Mode_Ed25519 =
216 &mcuxClSignature_ModeDescriptor_Ed25519;
217MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
218
219 /* mcuxClEcc_EdDsaDescriptors */
221
222#endif /* MCUXCL_FEATURE_ECC_EDDSA */
223
224
228
229
237
243MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by mcuxClSignature component. Hence, it is declared but never referenced.")
246MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
247 /* mcuxClEcc_ECDSADescriptors */
249 /* mcuxClEcc_Descriptors */
253
260#ifdef MCUXCL_FEATURE_ECC_SECPK1_CURVES
261
275extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp160k1;
276
290extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp192k1;
291
305extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp224k1;
306
320extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp256k1;
321#endif /* MCUXCL_FEATURE_ECC_SECPK1_CURVES */
322#if defined(MCUXCL_FEATURE_ECC_SECPR1_CURVES) || defined(MCUXCL_FEATURE_ECC_NISTPR1_CURVES) || defined(MCUXCL_FEATURE_ECC_ANSIX9P_CURVES)
323
338extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp192r1;
339#define mcuxClEcc_Weier_DomainParams_NIST_P192 mcuxClEcc_Weier_DomainParams_secp192r1
340#define mcuxClEcc_Weier_DomainParams_ansix9p192r1 mcuxClEcc_Weier_DomainParams_secp192r1
341
356extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp224r1;
357#define mcuxClEcc_Weier_DomainParams_NIST_P224 mcuxClEcc_Weier_DomainParams_secp224r1
358#define mcuxClEcc_Weier_DomainParams_ansix9p224r1 mcuxClEcc_Weier_DomainParams_secp224r1
359
370extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp256r1;
371#define mcuxClEcc_Weier_DomainParams_NIST_P256 mcuxClEcc_Weier_DomainParams_secp256r1
372#define mcuxClEcc_Weier_DomainParams_ansix9p256r1 mcuxClEcc_Weier_DomainParams_secp256r1
373
384extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp384r1;
385#define mcuxClEcc_Weier_DomainParams_NIST_P384 mcuxClEcc_Weier_DomainParams_secp384r1
386#define mcuxClEcc_Weier_DomainParams_ansix9p384r1 mcuxClEcc_Weier_DomainParams_secp384r1
387
402extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp521r1;
403#define mcuxClEcc_Weier_DomainParams_NIST_P521 mcuxClEcc_Weier_DomainParams_secp521r1
404#define mcuxClEcc_Weier_DomainParams_ansix9p521r1 mcuxClEcc_Weier_DomainParams_secp521r1
405#endif /* defined(SECPR1_CURVES) || defined(NISTPR1_CURVES) || defined(ANSIX9P_CURVES) */
406#ifdef MCUXCL_FEATURE_ECC_BRAINPOOLR1_CURVES
407
421extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP160r1;
422
436extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP192r1;
437
451extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP224r1;
452
466extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP256r1;
467
481extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP320r1;
482
496extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP384r1;
497
511extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP512r1;
512#endif /* MCUXCL_FEATURE_ECC_BRAINPOOLR1_CURVES */
513#ifdef MCUXCL_FEATURE_ECC_BRAINPOOLT1_CURVES
514
528extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP160t1;
529
543extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP192t1;
544
558extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP224t1;
559
573extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP256t1;
574
588extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP320t1;
589
603extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP384t1;
604
618extern const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_brainpoolP512t1;
619#endif /* MCUXCL_FEATURE_ECC_BRAINPOOLT1_CURVES */
620
621
622/* Ed25519 domain parameters */
623extern const mcuxClEcc_EdDSA_DomainParams_t mcuxClEcc_EdDSA_DomainParams_Ed25519;
624 /* mcuxClEcc_DomainParamsDescriptor */
628
635
636
637/*********************************************************/
638/* Encoding types related to point encoding specified in */
639/* SEC 1: Elliptic Curve Cryptography */
640/*********************************************************/
641
647
666MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced.")
668MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
669 /* mcuxClEcc_WeierECC_PointEncDescriptors */
673
674
681
682#ifdef MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_POINTADD
686extern const mcuxClEcc_ArithmeticOperationDescriptor_t mcuxClEcc_ArithOpDesc_PointAdd;
687
715MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced.")
716static mcuxClEcc_ArithmeticOperation_t mcuxClEcc_ArithmeticOperation_PointAdd =
717 &mcuxClEcc_ArithOpDesc_PointAdd;
718MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
719#endif /* MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_POINTADD */
720
721
722#ifdef MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_POINTSUB
726extern const mcuxClEcc_ArithmeticOperationDescriptor_t mcuxClEcc_ArithOpDesc_PointSub;
727
755MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced.")
756static mcuxClEcc_ArithmeticOperation_t mcuxClEcc_ArithmeticOperation_PointSub =
757 &mcuxClEcc_ArithOpDesc_PointSub;
758MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
759#endif /* MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_POINTSUB */
760
761
762#ifdef MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_SCALARMULT
766extern const mcuxClEcc_ArithmeticOperationDescriptor_t mcuxClEcc_ArithOpDesc_ScalarMult;
767
795MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced.")
796static mcuxClEcc_ArithmeticOperation_t mcuxClEcc_ArithmeticOperation_ScalarMult =
797 &mcuxClEcc_ArithOpDesc_ScalarMult;
798MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
799#endif /* MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_SCALARMULT */
800
801
802#ifdef MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_SECURESCALARMULT
806extern const mcuxClEcc_ArithmeticOperationDescriptor_t mcuxClEcc_ArithOpDesc_SecureScalarMult;
807
835MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user / customer. Hence, it is declared but never referenced.")
836static mcuxClEcc_ArithmeticOperation_t mcuxClEcc_ArithmeticOperation_SecureScalarMult =
837 &mcuxClEcc_ArithOpDesc_SecureScalarMult;
838MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
839#endif /* MCUXCL_FEATURE_ECC_ARITHMETICOPERATION_SECURESCALARMULT */
840 /* mcuxClEcc_ArithmeticOperation */
842
843
844#ifdef __cplusplus
845} /* extern "C" */
846#endif
847
848#endif /* MCUXCLECC_TYPES_H_ */
Top-level include file for the mcuxClBuffer component.
Constant definitions of mcuxClEcc component.
Provides the API for the CSSL flow protection mechanism.
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:58
struct mcuxClEcc_WeierECC_PointEncDescriptor mcuxClEcc_WeierECC_PointEncDescriptor_t
Weierstrass point encoding variant descriptor type.
Definition mcuxClEcc_Types.h:133
mcuxClEcc_Status_t mcuxClEcc_Status_Protected_t
Deprecated type for mcuxClEcc component return codes.
Definition mcuxClEcc_Types.h:71
const mcuxClEcc_WeierECC_PointEncDescriptor_t * mcuxClEcc_WeierECC_PointEncType_t
Weierstrass point encoding variant type.
Definition mcuxClEcc_Types.h:138
struct mcuxClEcc_ECDSA_SignatureProtocolDescriptor mcuxClEcc_ECDSA_SignatureProtocolDescriptor_t
ECDSA SignatureProtocol variant descriptor type.
Definition mcuxClEcc_Types.h:148
uint32_t mcuxClEcc_Status_t
Type for mcuxClEcc component return codes.
Definition mcuxClEcc_Types.h:66
struct mcuxClEcc_Weier_DomainParams mcuxClEcc_Weier_DomainParams_t
Type for Weierstrass ECC domain parameters.
Definition mcuxClEcc_Types.h:123
static const mcuxClEcc_WeierECC_PointEncType_t mcuxClEcc_WeierECC_PointEncType_SEC
Point encoding type to be used for Weierstrass curve points as specified in SEC 1: Elliptic Curve Cry...
Definition mcuxClEcc_Types.h:667
const mcuxClEcc_WeierECC_PointEncDescriptor_t mcuxClEcc_WeierECC_PointEncDescriptor_SEC
Point encoding variant descriptor to be used for Weierstrass curve points as specified in SEC 1: Elli...
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
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:158
const mcuxClSignature_ModeDescriptor_t mcuxClSignature_ModeDescriptor_ECDSA
ECDSA Signature mode descriptor.
static mcuxClSignature_Mode_t mcuxClSignature_Mode_ECDSA
ECDSA Signature mode.
Definition mcuxClEcc_Types.h:244
Structure to define basic custom domain parameters for (short) Weierstrass curves with cofactor 1.
Definition mcuxClEcc_Types.h:156