MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClEcc_WeierECC.h File Reference

header of mcuxClEcc functionalities related to ECC protocols based on (short) Weierstrass curves More...

Go to the source code of this file.

Data Structures

struct  mcuxClEcc_Weier_BasicDomainParams_t
 Structure to define basic custom domain parameters for (short) Weierstrass curves with cofactor 1. More...
 

Macros

#define MCUXCLECC_OPTION_GENERATEPRECPOINT_YES
 
#define MCUXCLECC_OPTION_GENERATEPRECPOINT_NO
 
#define MCUXCLECC_OPTION_GENERATEPRECPOINT_MASK
 
#define MCUXCLECC_OPTION_GENERATEPRECPOINT_OFFSET
 

Functions

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. More...
 
mcuxClEcc_Status_t mcuxClEcc_WeierECC_GenerateCustomKeyType (mcuxClKey_CustomType_t customType, mcuxClKey_AlgorithmId_t algoId, mcuxClKey_Size_t size, void *pCustomParams)
 Key type constructor. More...
 

Detailed Description

header of mcuxClEcc functionalities related to ECC protocols based on (short) Weierstrass curves

Function Documentation

◆ mcuxClEcc_WeierECC_GenerateDomainParams()

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.

Given pointers and lengths specifying domain parameters of a custom (short) Weierstrass curve with cofactor 1, this function generates a corresponding optimized custom domain parameter struct.

Parameters
pSessionHandle for the current CL session.
[out]pEccWeierDomainParamsPointer to memory area in which the optimized domain parameters shall be stored.
[in]pEccWeierBasicDomainParamsPointer to struct containing pointers and lengths specifying the custom domain parameters.
[in]optionsParameter specifying whether or not the pre-computed point (2 ^ (byteLenN * 4)) * G corresponding to the base point G shall be calculated or not, If set to
  • MCUXCLECC_OPTION_GENERATEPRECPOINT_YES, the pre-computed point will be calculated
  • MCUXCLECC_OPTION_GENERATEPRECPOINT_NO, the pre-computed point will not be calculated
Attention
the generated optimized domain parameter cannot be copied or moved, but shall be used in the original memory address where it is generated.
Returns
A code-flow protected error code (see MCUXCLECC_STATUS_)
Return values
MCUXCLECC_STATUS_OKif optimized domain parameters are generated successfully;
MCUXCLECC_STATUS_INVALID_PARAMSif parameters are invalid;
MCUXCLECC_STATUS_FAULT_ATTACKif fault attack (unexpected behavior) is detected.
Examples
mcuxClEcc_WeierECC_CustomEccWeierType_BN256_example.c.

◆ mcuxClEcc_WeierECC_GenerateCustomKeyType()

mcuxClEcc_Status_t mcuxClEcc_WeierECC_GenerateCustomKeyType ( mcuxClKey_CustomType_t  customType,
mcuxClKey_AlgorithmId_t  algoId,
mcuxClKey_Size_t  size,
void *  pCustomParams 
)

Key type constructor.

This function allows to generate custom key types according to the passed algoId.

Parameters
[out]customTypeHandle for the custom key type.
[in]algoIdAlgorithm identifier specifying the key type descriptor to be generated. The supported algoIds are
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_EPHEMERAL_CUSTOM | MCUXCLKEY_ALGO_ID_PUBLIC_KEY
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_EPHEMERAL_CUSTOM | MCUXCLKEY_ALGO_ID_PRIVATE_KEY
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_EPHEMERAL_CUSTOM | MCUXCLKEY_ALGO_ID_KEY_PAIR
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_STATIC_CUSTOM | MCUXCLKEY_ALGO_ID_PUBLIC_KEY
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_STATIC_CUSTOM | MCUXCLKEY_ALGO_ID_PRIVATE_KEY
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_STATIC_CUSTOM | MCUXCLKEY_ALGO_ID_KEY_PAIR All other values will trigger an error.
[in]sizeAlgorithm based key size.
[in]pCustomParamsPointer to algorithm based custom parameters. If algoId & MCUXCLKEY_ALGO_ID_ALGO_MASK equals
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_EPHEMERAL_CUSTOM, a pointer to an mcuxClEcc_Weier_BasicDomainParams_t struct specifying custom ECC Weierstrass domain parameters
  • MCUXCLKEY_ALGO_ID_ECC_SHWS_GFP_STATIC_CUSTOM, a pointer to an mcuxClEcc_Weier_DomainParams_t struct specifying optimized custom ECC Weierstrass domain parameters In all other cases, the pointer shall be set to NULL
Returns
status
Return values
MCUXCLECC_STATUS_OKif custom key type is generated successfully;
MCUXCLECC_STATUS_INVALID_PARAMSif Parameters are invalid.
MCUXCLECC_STATUS_FAULT_ATTACKif fault attack (unexpected behavior) is detected.
Examples
mcuxClEcc_WeierECC_CustomEccWeierType_BN256_example.c.