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 Proprietary. 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 */
10/* license terms, then you may not retain, install, activate or otherwise */
11/* use the software. */
12/*--------------------------------------------------------------------------*/
13
20#ifndef MCUXCLECC_FUNCTIONS_H_
21#define MCUXCLECC_FUNCTIONS_H_
22
23
24#include <mcuxClCore_Platform.h>
25#include <mcuxClSession.h>
26#include <mcuxClBuffer.h>
29#include <mcuxCsslAnalysis.h>
30#ifdef MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC
31#include <mcuxClMac.h>
32#endif /* MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC */
33
34#include <mcuxClEcc_Types.h>
35
36#include <mcuxClKey.h>
37
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/**********************************************************/
44/* Public APIs of mcuxClEcc */
45/**********************************************************/
63 mcuxClSession_Handle_t pSession,
64 const mcuxClEcc_KeyGen_Param_t * pParam
65 );
66
67
77 mcuxClSession_Handle_t pSession,
78 const mcuxClEcc_Sign_Param_t * pParam
79 );
80
81
90 mcuxClSession_Handle_t pSession,
91 const mcuxClEcc_Verify_Param_t * pParam
92 );
93
94
125 mcuxClSession_Handle_t pSession,
126 const mcuxClEcc_PointMult_Param_t * pParam
127 );
128
129
153 mcuxClSession_Handle_t pSession,
154 mcuxClKey_Handle_t privKey,
155 mcuxClKey_Handle_t pubKey
156 );
157
184 mcuxClSession_Handle_t pSession,
186 mcuxClKey_Handle_t otherKey,
187 uint8_t * pOut,
188 uint32_t * const pOutLength
189 );
190
191
192MCUX_CSSL_ANALYSIS_START_PATTERN_HYPERLINK_IN_COMMENTS()
217MCUX_CSSL_ANALYSIS_STOP_PATTERN_HYPERLINK_IN_COMMENTS()
220 mcuxClSession_Handle_t pSession,
222 mcuxClKey_Handle_t privKey,
223 mcuxClKey_Handle_t pubKey
224 );
225
226MCUX_CSSL_ANALYSIS_START_PATTERN_HYPERLINK_IN_COMMENTS()
257MCUX_CSSL_ANALYSIS_STOP_PATTERN_HYPERLINK_IN_COMMENTS()
260 mcuxClSession_Handle_t pSession,
264 uint32_t inSize,
265 mcuxCl_Buffer_t pSignature,
266 uint32_t * const pSignatureSize
267 );
268
269MCUX_CSSL_ANALYSIS_START_PATTERN_HYPERLINK_IN_COMMENTS()
299MCUX_CSSL_ANALYSIS_STOP_PATTERN_HYPERLINK_IN_COMMENTS()
306 uint32_t inSize,
307 mcuxCl_InputBuffer_t pSignature,
308 uint32_t signatureSize
309 );
310
324 mcuxClSession_Handle_t pSession,
326 const uint8_t *pPrivKey
327 );
328
345 mcuxClSession_Handle_t pSession,
346 const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams,
348 uint32_t phflag,
349 mcuxCl_InputBuffer_t pContext,
350 uint32_t contextLen
351 );
352
353
354
355
356
357#ifdef MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC
358
379MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
380MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEcc_ECDSA_GenerateProtocolDescriptor_Deterministic)
381MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEcc_Status_t) mcuxClEcc_ECDSA_GenerateProtocolDescriptor_Deterministic(
383 mcuxClEcc_ECDSA_SignatureProtocolDescriptor_t * const pProtocolDescriptor,
384 mcuxClMac_Mode_t hmacMode
385 );
386MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
387#define mcuxClEcc_DeterministicECDSA_GenerateProtocolDescriptor mcuxClEcc_ECDSA_GenerateProtocolDescriptor_Deterministic
388#endif /* MCUXCL_FEATURE_ECC_ECDSA_DETERMINISTIC */
389
390 /* mcuxClEcc_Functions */
394
395
396#ifdef __cplusplus
397} /* extern "C" */
398#endif
399
400#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