Defines all functions of mcuxClEcc.
More...
|
| mcuxClEcc_Status_t | mcuxClEcc_EdDSA_InitPrivKeyInputMode (mcuxClSession_Handle_t pSession, mcuxClKey_GenerationDescriptor_t *generationMode, const uint8_t *pPrivKey) |
| | This function initializes an EdDSA mode descriptor for EdDSA key pair generation with private key input.
|
| mcuxClEcc_Status_t | mcuxClEcc_EdDSA_GenerateSignatureModeDescriptor (mcuxClSession_Handle_t pSession, const mcuxClEcc_EdDSA_DomainParams_t *pDomainParams, mcuxClSignature_ModeDescriptor_t *pSignatureMode, uint32_t phflag, mcuxCl_InputBuffer_t pContext, uint32_t contextLen) |
| | This function implements the signature mode descriptor generation for Ed25519ctx, Ed25519ph, Ed448 and Ed448ph.
|
| 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.
|
| mcuxClEcc_Status_t | mcuxClEcc_WeierECC_GenerateCustomKeyType (mcuxClKey_CustomType_t customType, mcuxClKey_AlgorithmId_t algoId, mcuxClKey_Size_t size, void *pCustomParams, mcuxClKey_Encoding_t plainEncoding) |
| | Key type constructor.
|
| mcuxClEcc_Status_t | mcuxClEcc_WeierECC_DecodePoint (mcuxClSession_Handle_t pSession, mcuxCl_InputBuffer_t pEncodedPoint, mcuxCl_Buffer_t pDecodedPoint, mcuxClEcc_WeierECC_PointEncType_t pointEncType, mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams) |
| | Point decoding function.
|
Defines all functions of mcuxClEcc.
◆ mcuxClEcc_EdDSA_InitPrivKeyInputMode()
◆ mcuxClEcc_EdDSA_GenerateSignatureModeDescriptor()
This function implements the signature mode descriptor generation for Ed25519ctx, Ed25519ph, Ed448 and Ed448ph.
- Parameters
-
| [in] | pSession | Handle for the current CL session |
| [in] | pDomainParams | Pointer to domain parameters of the used curve |
| [in] | pSignatureMode | Mode descriptor specifying the EdDSA variant |
| [in] | phflag | Option whether pre-hashing is enabled |
| [in] | pContext | User input context for the hash prefix |
| [in] | contextLen | Length of the context |
- Returns
- A code-flow protected error code (see MCUXCLECC_STATUS_)
- Return values
-
- Examples
- mcuxClEcc_EdDSA_Ed25519ctx_example.c, and mcuxClEcc_EdDSA_Ed25519ph_example.c.
◆ mcuxClEcc_WeierECC_GenerateDomainParams()
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
-
| pSession | Handle for the current CL session. |
| [out] | pEccWeierDomainParams | Pointer to memory area in which the optimized domain parameters shall be stored. |
| [in] | pEccWeierBasicDomainParams | Pointer to struct containing pointers and lengths specifying the custom domain parameters. |
| [in] | options | Parameter 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
-
- Examples
- mcuxClEcc_WeierECC_CustomEccWeierType_BN256_example.c.
◆ mcuxClEcc_WeierECC_GenerateCustomKeyType()
Key type constructor.
This function allows to generate custom key types according to the passed algoId.
- Parameters
-
| [out] | customType | Handle for the custom key type. |
| [in] | algoId | Algorithm 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] | size | Algorithm based key size. |
| [in] | pCustomParams | Pointer 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
|
| [in] | plainEncoding | The plain encoding function for the key. |
- Returns
- status
- Return values
-
- Examples
- mcuxClEcc_WeierECC_CustomEccWeierType_BN256_example.c.
◆ mcuxClEcc_WeierECC_DecodePoint()
Point decoding function.
Given a point on a short Weierstrass curve defined over the prime p in encoded form, this decoding function derives its plain format given by its x- and y-coordinates.
The following encoding variants are supported:
- SEC encoding according to SEC 1: Elliptic Curve Cryptography
For each encoding variant dedicated point encoding type descriptors and buffer for the encoded points are available. Please refer to the definition of these descriptors for further information about the respective encoding.
- Parameters
-
| pSession | Handle for the current CL session. |
| [in] | pEncodedPoint | Pointer to buffer containing the encoded point. The size of the buffer depends on the encoding variant. |
| [out] | pDecodedPoint | Pointer to buffer to where the x- and y-coordinates, both elements of GF(p), of the decoded point (x,y) shall be written. The coordinates x and y are written one after another in big endian format with byte length equal to the byte length of p. If MCUXCLECC_STATUS_NEUTRAL_POINT is returned, nothing is written to this buffer. |
| [in] | pointEncType | Point encoding type specifying all information needed about the applied point encoding format. |
| [in] | pEccWeierDomainParams | Pointer to short Weierstrass curve custom parameters. |
- Returns
- status
- Return values
-
- Examples
- mcuxClEcc_WeierECC_DecodePoint_brainpoolP384r1_example.c, and mcuxClEcc_WeierECC_DecodePoint_secp224r1_example.c.