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/* 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 <mcuxClBuffer.h>
30#include <mcuxCsslAnalysis.h>
31#ifdef MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC
32#include <mcuxClMac.h>
33#endif /* MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC */
34
35#include <mcuxClEcc_Types.h>
36
37#include <mcuxClKey.h>
38
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44/**********************************************************/
45/* Public APIs of mcuxClEcc */
46/**********************************************************/
64 mcuxClSession_Handle_t pSession,
65 const mcuxClEcc_KeyGen_Param_t * pParam
66 );
67
68
78 mcuxClSession_Handle_t pSession,
79 const mcuxClEcc_Sign_Param_t * pParam
80 );
81
82
91 mcuxClSession_Handle_t pSession,
92 const mcuxClEcc_Verify_Param_t * pParam
93 );
94
95
126 mcuxClSession_Handle_t pSession,
127 const mcuxClEcc_PointMult_Param_t * pParam
128 );
129
130
154 mcuxClSession_Handle_t pSession,
155 mcuxClKey_Handle_t privKey,
156 mcuxClKey_Handle_t pubKey
157 );
158
185 mcuxClSession_Handle_t pSession,
187 mcuxClKey_Handle_t otherKey,
188 uint8_t * pOut,
189 uint32_t * const pOutLength
190 );
191
192
193MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
218MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
221 mcuxClSession_Handle_t pSession,
223 mcuxClKey_Handle_t privKey,
224 mcuxClKey_Handle_t pubKey
225 );
226
227MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
258MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
261 mcuxClSession_Handle_t pSession,
265 uint32_t inSize,
266 mcuxCl_Buffer_t pSignature,
267 uint32_t * const pSignatureSize
268 );
269
270MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS("Links are allowed in comments.")
300MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS()
307 uint32_t inSize,
308 mcuxCl_InputBuffer_t pSignature,
309 uint32_t signatureSize
310 );
311
325 mcuxClSession_Handle_t pSession,
327 const uint8_t *pPrivKey
328 );
329
346 mcuxClSession_Handle_t pSession,
347 const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams,
349 uint32_t phflag,
350 mcuxCl_InputBuffer_t pContext,
351 uint32_t contextLen
352 );
353
354
355
356
357
358#ifdef MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC
359
376MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_DeterministicECDSA_GenerateProtocolDescriptor)
377MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_DeterministicECDSA_GenerateProtocolDescriptor(
379 mcuxClEcc_ECDSA_SignatureProtocolDescriptor_t * const pDeterministicECDSAProtocolDescriptor,
380 mcuxClMac_Mode_t hmacMode
381 );
382#endif /* MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC */
383
384 /* mcuxClEcc_Functions */
388
389
390#ifdef __cplusplus
391} /* extern "C" */
392#endif
393
394#endif /* MCUXCLECC_FUNCTIONS_H_ */
Provides the API for the CL buffer types.
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 mcuxClMac component.
Top-level include file for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:46
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:55
mcuxClEcc_Status_t mcuxClEcc_MontDH_KeyAgreement(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, mcuxClKey_Handle_t otherKey, uint8_t *pOut, uint32_t *const pOutLength)
Implements the MontDH key agreement according to rfc7748.
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 ...
mcuxClEcc_Status_t mcuxClEcc_Sign(mcuxClSession_Handle_t pSession, const mcuxClEcc_Sign_Param_t *pParam)
implements ECDSA signature generation.
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,...
mcuxClEcc_Status_t mcuxClEcc_MontDH_GenerateKeyPair(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey)
implements ECC key pair generation step for a MontDH key agreement according to rfc7748.
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...
mcuxClEcc_Status_t mcuxClEcc_Verify(mcuxClSession_Handle_t pSession, const mcuxClEcc_Verify_Param_t *pParam)
implements ECDSA signature verification.
mcuxClEcc_Status_t mcuxClEcc_PointMult(mcuxClSession_Handle_t pSession, const mcuxClEcc_PointMult_Param_t *pParam)
implements ECC point multiplication.
mcuxClEcc_Status_t mcuxClEcc_KeyGen(mcuxClSession_Handle_t pSession, const mcuxClEcc_KeyGen_Param_t *pParam)
implements ECDSA key generation.
mcuxClEcc_Status_t mcuxClEcc_EdDSA_VerifySignature(mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, const mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t *mode, mcuxCl_InputBuffer_t pIn, uint32_t inSize, mcuxCl_InputBuffer_t pSignature, uint32_t signatureSize)
This function implements the EdDSA signature verification for Ed25519 and Ed448 as specified in rfc80...
mcuxClEcc_Status_t mcuxClEcc_EdDSA_GenerateSignature(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, const mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t *mode, mcuxCl_InputBuffer_t pIn, uint32_t inSize, mcuxCl_Buffer_t pSignature, uint32_t *const pSignatureSize)
This function implements the EdDSA signature generation for Ed25519 and Ed448 as specified in rfc8032...
struct mcuxClEcc_EdDSA_DomainParams mcuxClEcc_EdDSA_DomainParams_t
Type for EdDSA domain parameters.
Definition mcuxClEcc_Types.h:58
struct mcuxClEcc_ECDSA_SignatureProtocolDescriptor mcuxClEcc_ECDSA_SignatureProtocolDescriptor_t
ECDSA SignatureProtocol variant descriptor type.
Definition mcuxClEcc_Types.h:93
struct mcuxClEcc_EdDSA_GenerateKeyPairDescriptor mcuxClEcc_EdDSA_GenerateKeyPairDescriptor_t
EdDSA GenerateKeyPair variant descriptor type.
Definition mcuxClEcc_Types.h:68
struct mcuxClEcc_EdDSA_SignatureProtocolDescriptor mcuxClEcc_EdDSA_SignatureProtocolDescriptor_t
EdDSA SignatureProtocol variant descriptor type.
Definition mcuxClEcc_Types.h:78
uint32_t mcuxClEcc_Status_t
Type for mcuxClEcc component return codes.
Definition mcuxClEcc_Types.h:45
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:88
const mcuxClMac_ModeDescriptor_t *const mcuxClMac_Mode_t
MAC mode/algorithm type.
Definition mcuxClMac_Types.h:67
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:113
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:125
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:81
Parameter structure for function mcuxClEcc_KeyGen.
Definition mcuxClEcc_Types.h:131
Parameter structure for function mcuxClEcc_Sign.
Definition mcuxClEcc_Types.h:144
Parameter structure for function mcuxClEcc_Verify.
Definition mcuxClEcc_Types.h:164
Parameter structure for function mcuxClEcc_PointMult.
Definition mcuxClEcc_Types.h:187