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 <mcuxCsslAnalysis.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 
60  mcuxClSession_Handle_t pSession,
61  const mcuxClEcc_KeyGen_Param_t * pParam
62  );
63 
73  mcuxClSession_Handle_t pSession,
74  const mcuxClEcc_Sign_Param_t * pParam
75  );
76 
77 
86  mcuxClSession_Handle_t pSession,
87  const mcuxClEcc_Verify_Param_t * pParam
88  );
89 
120  mcuxClSession_Handle_t pSession,
121  const mcuxClEcc_PointMult_Param_t * pParam
122  );
123 
124 
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 
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 
198 MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
223 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
226  mcuxClSession_Handle_t pSession,
228  mcuxClKey_Handle_t privKey,
229  mcuxClKey_Handle_t pubKey
230  );
231 
232 MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
263 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
266  mcuxClSession_Handle_t pSession,
267  mcuxClKey_Handle_t key,
269  const uint8_t *pIn,
270  uint32_t inSize,
271  uint8_t *pSignature,
272  uint32_t * const pSignatureSize
273  );
274 
275 MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
305 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
308  mcuxClSession_Handle_t session,
309  mcuxClKey_Handle_t key,
311  const uint8_t *pIn,
312  uint32_t inSize,
313  const uint8_t *pSignature,
314  uint32_t signatureSize
315  );
316 
330  mcuxClSession_Handle_t pSession,
332  const uint8_t *pPrivKey
333  );
334 
351  mcuxClSession_Handle_t pSession,
352  const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams,
354  uint32_t phflag,
355  mcuxCl_InputBuffer_t pContext,
356  uint32_t contextLen);
357 
358 
359 
360 
361  /* mcuxClEcc_Functions */
365 
366 #ifdef __cplusplus
367 } /* extern "C" */
368 #endif
369 
370 #endif /* MCUXCLECC_FUNCTIONS_H_ */
mcuxClEcc_Status_t mcuxClEcc_Verify(mcuxClSession_Handle_t pSession, const mcuxClEcc_Verify_Param_t *pParam)
implements ECDSA signature verification.
Parameter structure for function mcuxClEcc_PointMult.
Definition: mcuxClEcc_Types.h:205
Top-level include file for the mcuxClSession component.
Parameter structure for function mcuxClEcc_Verify.
Definition: mcuxClEcc_Types.h:183
mcuxClEcc_Status_t mcuxClEcc_Mont_DhKeyGeneration(mcuxClSession_Handle_t pSession, mcuxClKey_Type_t type, mcuxClKey_Protection_t protection, mcuxClKey_Handle_t privKey, uint8_t *pPrivData, uint32_t *const pPrivDataLength, mcuxClKey_Handle_t pubKey, uint8_t *pPubData, uint32_t *const pPubDataLength)
implements ECC key pair generation step for a MontDh key agreement according to rfc7748.
struct mcuxClEcc_EdDSA_SignatureProtocolDescriptor mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t
EdDSA SignatureProtocol variant descriptor type.
Definition: mcuxClEcc_Types.h:116
mcuxClEcc_Status_t mcuxClEcc_EdDSA_InitPrivKeyInputMode(mcuxClSession_Handle_t pSession, mcuxClEcc_EdDSA_GenerateKeyPairDescriptor_t *mode, const uint8_t *pPrivKey)
This function initializes an EdDSA mode descriptor for EdDSA key pair generation with private key inp...
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
struct mcuxClEcc_EdDSA_DomainParams mcuxClEcc_EdDSA_DomainParams_t
Type for EdDSA domain parameters.
Definition: mcuxClEcc_Types.h:96
mcuxClEcc_Status_t mcuxClEcc_Sign(mcuxClSession_Handle_t pSession, const mcuxClEcc_Sign_Param_t *pParam)
implements ECDSA signature generation.
uint32_t mcuxClEcc_Status_t
Type for mcuxClEcc component return codes.
Definition: mcuxClEcc_Types.h:48
Parameter structure for function mcuxClEcc_Sign.
Definition: mcuxClEcc_Types.h:164
mcuxClEcc_Status_t mcuxClEcc_EdDSA_GenerateSignature(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, const mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t *mode, const uint8_t *pIn, uint32_t inSize, uint8_t *pSignature, uint32_t *const pSignatureSize)
This function implements the EdDSA signature generation for Ed25519 and Ed448 as specified in rfc8032...
mcuxClEcc_Status_t mcuxClEcc_Mont_DhKeyAgreement(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, mcuxClKey_Handle_t otherKey, uint8_t *pOut, uint32_t *const pOutLength)
implements ECC key agreement according to rfc7748.
mcuxClEcc_Status_t mcuxClEcc_EdDSA_GenerateProtocolDescriptor(mcuxClSession_Handle_t pSession, const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams, mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t *pProtocolDescriptor, uint32_t phflag, mcuxCl_InputBuffer_t pContext, uint32_t contextLen)
This function implements the protocol descriptor generation for Ed25519ctx, Ed25519ph,...
Parameter structure for function mcuxClEcc_KeyGen.
Definition: mcuxClEcc_Types.h:152
struct mcuxClEcc_EdDSA_GenerateKeyPairDescriptor mcuxClEcc_EdDSA_GenerateKeyPairDescriptor_t
EdDSA GenerateKeyPair variant descriptor type.
Definition: mcuxClEcc_Types.h:106
mcuxClEcc_Status_t mcuxClEcc_KeyGen(mcuxClSession_Handle_t pSession, const mcuxClEcc_KeyGen_Param_t *pParam)
implements ECDSA key generation.
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition: mcuxClKey_Types.h:111
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition: mcuxClKey_Types.h:88
mcuxClEcc_Status_t mcuxClEcc_EdDSA_GenerateKeyPair(mcuxClSession_Handle_t pSession, const mcuxClEcc_EdDSA_GenerateKeyPairDescriptor_t *mode, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey)
This function implements the EdDSA key pair generation for Ed25519 and Ed448 as specified in rfc8032 ...
Definition of function identifiers for the flow protection mechanism.
Provides the API for the CSSL flow protection mechanism.
Type definitions of mcuxClEcc component.
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition: mcuxClSession_Types.h:133
mcuxClEcc_Status_t mcuxClEcc_EdDSA_VerifySignature(mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, const mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t *mode, const uint8_t *pIn, uint32_t inSize, const uint8_t *pSignature, uint32_t signatureSize)
This function implements the EdDSA signature verification for Ed25519 and Ed448 as specified in rfc80...
const mcuxClKey_ProtectionDescriptor_t * mcuxClKey_Protection_t
Key protection mechanism type.
Definition: mcuxClKey_Types.h:141
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:125
mcuxClEcc_Status_t mcuxClEcc_PointMult(mcuxClSession_Handle_t pSession, const mcuxClEcc_PointMult_Param_t *pParam)
implements ECC point multiplication.
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition: mcuxCsslFlowProtection.h:81
Top-level include file for the mcuxClKey component.