MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClEcc_Functions.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2024 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_FUNCTIONS_H_
41#define MCUXCLECC_FUNCTIONS_H_
42
43
44#include <mcuxClCore_Platform.h>
45#include <mcuxClSession.h>
46#include <mcuxClBuffer.h>
49#include <mcuxClSignature.h>
50#include <mcuxCsslAnalysis.h>
51
52#include <mcuxClEcc_Types.h>
53
54#include <mcuxClKey.h>
55
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61/**********************************************************/
62/* Public APIs of mcuxClEcc */
63/**********************************************************/
70
71#ifdef MCUXCL_FEATURE_ECC_EDDSA
85MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_InitPrivKeyInputMode)
86MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_InitPrivKeyInputMode(
89 const uint8_t *pPrivKey
90 );
91
106MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_GenerateSignatureModeDescriptor)
107MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_GenerateSignatureModeDescriptor(
108 mcuxClSession_Handle_t pSession,
109 const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams,
110 mcuxClSignature_ModeDescriptor_t *pSignatureMode,
111 uint32_t phflag,
112 mcuxCl_InputBuffer_t pContext,
113 uint32_t contextLen);
114
115#endif /* MCUXCL_FEATURE_ECC_EDDSA */
116
117#ifdef MCUXCL_FEATURE_ECC_ARITHMETICOPERATION
145MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_ArithmeticOperation)
146MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_ArithmeticOperation(
147 mcuxClSession_Handle_t pSession,
148 mcuxClEcc_ArithmeticOperation_t arithmeticOperation,
149 mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams,
151 uint32_t op1Size,
153 uint32_t op2Size,
154 mcuxCl_Buffer_t pResult,
155 uint32_t * const pResultSize
156 );
157#endif /* MCUXCL_FEATURE_ECC_ARITHMETICOPERATION */
158
159
186 mcuxClSession_Handle_t pSession,
187 mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams,
188 mcuxClEcc_Weier_BasicDomainParams_t *pEccWeierBasicDomainParams,
189 uint32_t options
190 );
191
222 mcuxClKey_CustomType_t customType,
224 mcuxClKey_Size_t size,
225 void *pCustomParams,
226 mcuxClKey_Encoding_t plainEncoding
227 );
228
229
259 mcuxClSession_Handle_t pSession,
260 mcuxCl_InputBuffer_t pEncodedPoint,
261 mcuxCl_Buffer_t pDecodedPoint,
263 mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams
264 );
265
266 /* mcuxClEcc_Functions */
270
271
272#ifdef __cplusplus
273} /* extern "C" */
274#endif
275
276#endif /* MCUXCLECC_FUNCTIONS_H_ */
Top-level include file for the mcuxClBuffer component.
Definition of function identifiers for the flow protection mechanism.
Type definitions and descriptors of mcuxClEcc component.
Top-level include file for the mcuxClKey component.
Top-level include file for the mcuxClSession component.
Top-level include file for the mcuxClSignature component.
Provides the API for the CSSL flow protection mechanism.
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:58
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:67
mcuxClEcc_Status_t mcuxClEcc_WeierECC_GenerateDomainParams(mcuxClSession_Handle_t pSession, mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams, mcuxClEcc_Weier_BasicDomainParams_t *pEccWeierBasicDomainParams, uint32_t options)
ECC Weierstrass custom domain parameter generation function.
mcuxClEcc_Status_t mcuxClEcc_WeierECC_DecodePoint(mcuxClSession_Handle_t pSession, mcuxCl_InputBuffer_t pEncodedPoint, mcuxCl_Buffer_t pDecodedPoint, mcuxClEcc_WeierECC_PointEncType_t pointEncType, mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams)
Point decoding function.
mcuxClEcc_Status_t mcuxClEcc_WeierECC_GenerateCustomKeyType(mcuxClKey_CustomType_t customType, mcuxClKey_AlgorithmId_t algoId, mcuxClKey_Size_t size, void *pCustomParams, mcuxClKey_Encoding_t plainEncoding)
Key type constructor.
const mcuxClEcc_WeierECC_PointEncDescriptor_t * mcuxClEcc_WeierECC_PointEncType_t
Weierstrass point encoding variant type.
Definition mcuxClEcc_Types.h:138
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
const mcuxClKey_EncodingDescriptor_t * mcuxClKey_Encoding_t
Key encoding mechanism type.
Definition mcuxClKey_Types.h:164
mcuxClKey_TypeDescriptor_t * mcuxClKey_CustomType_t
Custom key type handle type.
Definition mcuxClKey_Types.h:141
uint32_t mcuxClKey_Size_t
Type for algorithm based key size.
Definition mcuxClKey_Types.h:75
struct mcuxClKey_GenerationDescriptor mcuxClKey_GenerationDescriptor_t
Key generation descriptor type.
Definition mcuxClKey_Types.h:239
uint32_t mcuxClKey_AlgorithmId_t
Type for algorithm based key id.
Definition mcuxClKey_Types.h:70
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:118
struct mcuxClSignature_ModeDescriptor mcuxClSignature_ModeDescriptor_t
Signature mode/algorithm descriptor type.
Definition mcuxClSignature_Types.h:65
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:186
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:158
Structure to define basic custom domain parameters for (short) Weierstrass curves with cofactor 1.
Definition mcuxClEcc_Types.h:156