MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClEcc_Functions.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2020-2023 NXP */
3 /* */
4 /* NXP Confidential. 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 license */
10 /* terms, then you may not retain, install, activate or otherwise use the */
11 /* software. */
12 /*--------------------------------------------------------------------------*/
13 
20 #ifndef MCUXCLECC_FUNCTIONS_H_
21 #define MCUXCLECC_FUNCTIONS_H_
22 
23 
24 #include <stdint.h>
25 #include <mcuxClConfig.h> // Exported features flags header
26 #include <mcuxClSession.h>
27 #include <mcuxCsslFlowProtection.h>
29 #include <mcuxClCore_Analysis.h>
30 
31 #include <mcuxClEcc_Types.h>
32 
33 #include <mcuxClKey.h>
34 
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /**********************************************************/
41 /* Public APIs of mcuxClEcc */
42 /**********************************************************/
43 
58 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_KeyGen)
60  mcuxClSession_Handle_t pSession,
62  );
63 
71 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_Sign)
73  mcuxClSession_Handle_t pSession,
75  );
76 
77 
84 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_Verify)
86  mcuxClSession_Handle_t pSession,
88  );
89 
118 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_PointMult)
120  mcuxClSession_Handle_t pSession,
122  );
123 
124 
151 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_Mont_DhKeyGeneration)
152 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_Mont_DhKeyGeneration(
153  mcuxClSession_Handle_t pSession,
154  mcuxClKey_Type_t type,
155  mcuxClKey_Protection_t protection,
156  mcuxClKey_Handle_t privKey,
157  uint8_t * pPrivData,
158  uint32_t * const pPrivDataLength,
159  mcuxClKey_Handle_t pubKey,
160  uint8_t * pPubData,
161  uint32_t * const pPubDataLength
162  );
163 
188 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_Mont_DhKeyAgreement)
189 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_Mont_DhKeyAgreement(
190  mcuxClSession_Handle_t pSession,
191  mcuxClKey_Handle_t key,
192  mcuxClKey_Handle_t otherKey,
193  uint8_t * pOut,
194  uint32_t * const pOutLength
195  );
196 
197 
209 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_InitPrivKeyInputMode)
210 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_InitPrivKeyInputMode(
211  mcuxClSession_Handle_t pSession,
213  const uint8_t *pPrivKey
214  );
215 
216 
217 MCUXCLCORE_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
242 MCUXCLCORE_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
243 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_GenerateKeyPair)
244 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_GenerateKeyPair(
245  mcuxClSession_Handle_t pSession,
247  mcuxClKey_Handle_t privKey,
248  mcuxClKey_Handle_t pubKey
249  );
250 
251 MCUXCLCORE_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
282 MCUXCLCORE_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
283 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_GenerateSignature)
284 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_GenerateSignature(
285  mcuxClSession_Handle_t pSession,
286  mcuxClKey_Handle_t key,
288  const uint8_t *pIn,
289  uint32_t inSize,
290  uint8_t *pSignature,
291  uint32_t * const pSignatureSize
292  );
293 
294 MCUXCLCORE_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
324 MCUXCLCORE_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
325 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_VerifySignature)
326 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_VerifySignature(
327  mcuxClSession_Handle_t pSession,
328  mcuxClKey_Handle_t key,
330  const uint8_t *pIn,
331  uint32_t inSize,
332  const uint8_t *pSignature,
333  uint32_t signatureSize
334  );
335 
350 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_EdDSA_GenerateProtocolDescriptor)
351 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_EdDSA_GenerateProtocolDescriptor(
352  mcuxClSession_Handle_t pSession,
353  const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams,
355  uint32_t phflag,
356  mcuxCl_InputBuffer_t pContext,
357  uint32_t contextLen);
358 
359 
360 
361 
362  /* mcuxClEcc_Functions */
366 
367 #ifdef __cplusplus
368 } /* extern "C" */
369 #endif
370 
371 #endif /* MCUXCLECC_FUNCTIONS_H_ */
Parameter structure for function #mcuxClEcc_Sign.
Definition: mcuxClEcc_Types.h:164
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition: mcuxClSession_Types.h:124
const mcuxClKey_ProtectionDescriptor_t * mcuxClKey_Protection_t
Key protection mechanism type.
Definition: mcuxClKey_Types.h:140
struct mcuxClEcc_EdDSA_SignatureProtocolDescriptor mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t
EdDSA SignatureProtocol variant descriptor type.
Definition: mcuxClEcc_Types.h:116
Parameter structure for function #mcuxClEcc_KeyGen.
Definition: mcuxClEcc_Types.h:152
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition: mcuxClKey_Types.h:87
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:125
const mcuxClEcc_KeyGen_Param_t * pParam
< [in] pointer to mcuxClSession_Descriptor.
Definition: mcuxClEcc_Functions.h:62
struct mcuxClEcc_EdDSA_GenerateKeyPairDescriptor mcuxClEcc_EdDSA_GenerateKeyPairDescriptor_t
EdDSA GenerateKeyPair variant descriptor type.
Definition: mcuxClEcc_Types.h:106
Top-level include file for the mcuxClKey component.
uint32_t mcuxClEcc_Status_t
Type for mcuxClEcc component return codes.
Definition: mcuxClEcc_Types.h:48
Parameter structure for function #mcuxClEcc_Verify.
Definition: mcuxClEcc_Types.h:183
Definition of function identifiers for the flow protection mechanism.
const uint8_t *const mcuxCl_InputBuffer_t
Input buffer typeThis type provides a pointer to the memory location that should be used to read inpu...
Definition: mcuxClCore_Buffer.h:42
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition: mcuxClKey_Types.h:110
Top-level include file for the mcuxClSession component.
struct mcuxClEcc_EdDSA_DomainParams mcuxClEcc_EdDSA_DomainParams_t
Type for EdDSA domain parameters.
Definition: mcuxClEcc_Types.h:96
Provides the API for the CSSL flow protection mechanism.
Type definitions of mcuxClEcc component.
Parameter structure for function #mcuxClEcc_PointMult.
Definition: mcuxClEcc_Types.h:205
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_KeyGen(mcuxClSession_Handle_t pSession
implements ECDSA key generation.
Definition: mcuxCsslFlowProtection_example.c:137