MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClEls_Ecc.h File Reference

ELS header for elliptic curve cryptography This header exposes functions that enable using the ELS for elliptic curve cryptography. More...

#include <mcuxClConfig.h>
#include <mcuxClEls_Common.h>

Go to the source code of this file.

Data Structures

union  mcuxClEls_EccSignOption_t
 Command option bit field for mcuxClEls_EccSign_Async Bit field to configure mcuxClEls_EccSign_Async. More...
 
union  mcuxClEls_EccVerifyOption_t
 Command option bit field for mcuxClEls_EccVerify_Async Bit field to configure mcuxClEls_EccVerifyOption_t. More...
 
union  mcuxClEls_EccKeyGenOption_t
 Command option bit field for mcuxClEls_EccKeyGen_Async Bit field to configure mcuxClEls_EccKeyGenOption_t. More...
 
union  mcuxClEls_EccKeyExchOption_t
 Command option bit field for mcuxClEls_EccKeyExchange_Async, for internal use only. More...
 

Macros

#define MCUXCLELS_ECC_VALUE_HASHED
 Set this option at mcuxClEls_EccSignOption_t.value or mcuxClEls_EccVerifyOption_t.value to specify input is the hash of the message.
 
#define MCUXCLELS_ECC_VALUE_NOT_HASHED
 Set this option at mcuxClEls_EccSignOption_t.value or mcuxClEls_EccVerifyOption_t.value to specify input is the plain message.
 
#define MCUXCLELS_ECC_VALUE_RTF
 Set this option at mcuxClEls_EccSignOption_t.value to include the RTF in the signature, only for mcuxClEls_EccSignOption_t.
 
#define MCUXCLELS_ECC_VALUE_NO_RTF
 Set this option at mcuxClEls_EccSignOption_t.value to not include the RTF in the signature, only for mcuxClEls_EccSignOption_t.
 
#define MCUXCLELS_KEYGEN_VALUE_SIGN_PUBLICKEY
 Set this option at mcuxClEls_EccKeyGenOption_t.value to sign the public key.
 
#define MCUXCLELS_KEYGEN_VALUE_TYPE_SIGN
 Set this option at mcuxClEls_EccKeyGenOption_t.value to specify output key will be a signing key usable by mcuxClEls_EccSign_Async.
 
#define MCUXCLELS_KEYGEN_VALUE_TYPE_KEYEXCHANGE
 Set this option at mcuxClEls_EccKeyGenOption_t.value to specify output key will be a Diffie Helman key usable by mcuxClEls_EccKeyExchange_Async.
 
#define MCUXCLELS_KEYGEN_VALUE_DETERMINISTIC
 Set this option at mcuxClEls_EccKeyGenOption_t.value to specify output key is deterministic.
 
#define MCUXCLELS_KEYGEN_VALUE_RANDOM
 Set this option at mcuxClEls_EccKeyGenOption_t.value to specify output key is random.
 
#define MCUXCLELS_KEYGEN_VALUE_GEN_PUB_KEY
 Set this option at mcuxClEls_EccKeyGenOption_t.value to generate a public key.
 
#define MCUXCLELS_KEYGEN_VALUE_NO_PUB_KEY
 Set this option at mcuxClEls_EccKeyGenOption_t.value to not generate a public key.
 
#define MCUXCLELS_KEYGEN_VALUE_NO_RANDOM_DATA
 Set this option at mcuxClEls_EccKeyGenOption_t.value to not use random data for signing the public key.
 
#define MCUXCLELS_KEYGEN_VALUE_USE_RANDOM_DATA
 Set this option at mcuxClEls_EccKeyGenOption_t.value to use random data for signing the public key.
 
#define MCUXCLELS_ECC_HASHED
 Set this option at mcuxClEls_EccSignOption_t.echashchl or mcuxClEls_EccVerifyOption_t.echashchl to specify input is the hash of the message.
 
#define MCUXCLELS_ECC_NOT_HASHED
 Set this option at mcuxClEls_EccSignOption_t.echashchl or mcuxClEls_EccVerifyOption_t.echashchl to specify input is the plain message.
 
#define MCUXCLELS_ECC_RTF
 Set this option at mcuxClEls_EccSignOption_t.signrtf to include the RTF in the signature.
 
#define MCUXCLELS_ECC_NO_RTF
 Set this option at mcuxClEls_EccSignOption_t.signrtf to not include the RTF in the signature.
 
#define MCUXCLELS_ECC_PUBLICKEY_SIGN_ENABLE
 Set this option at mcuxClEls_EccKeyGenOption_t.kgsign to sign the public key (signature will be concatenated to the output public key)
 
#define MCUXCLELS_ECC_PUBLICKEY_SIGN_DISABLE
 Set this option at mcuxClEls_EccKeyGenOption_t.kgsign to not sign the public key.
 
#define MCUXCLELS_ECC_OUTPUTKEY_SIGN
 Set this option at mcuxClEls_EccKeyGenOption_t.kgtypedh to specify output key will be a signing key usable by mcuxClEls_EccSign_Async.
 
#define MCUXCLELS_ECC_OUTPUTKEY_KEYEXCHANGE
 Set this option at mcuxClEls_EccKeyGenOption_t.kgtypedh to specify output key will be a Diffie Helman key usable by mcuxClEls_EccKeyExchange_Async.
 
#define MCUXCLELS_ECC_OUTPUTKEY_DETERMINISTIC
 Set this option at mcuxClEls_EccKeyGenOption_t.kgsrc to specify output key is deterministic.
 
#define MCUXCLELS_ECC_OUTPUTKEY_RANDOM
 Set this option at mcuxClEls_EccKeyGenOption_t.kgsrc to specify output key is random.
 
#define MCUXCLELS_ECC_GEN_PUBLIC_KEY
 Set this option at mcuxClEls_EccKeyGenOption_t.skip_pbk to generate a public key.
 
#define MCUXCLELS_ECC_SKIP_PUBLIC_KEY
 Set this option at mcuxClEls_EccKeyGenOption_t.skip_pbk to not generate a public key.
 
#define MCUXCLELS_ECC_NO_RANDOM_DATA
 Set this option at mcuxClEls_EccKeyGenOption_t.kgsign_rnd to not include user provided random data for the signature.
 
#define MCUXCLELS_ECC_INCLUDE_RANDOM_DATA
 Set this option at mcuxClEls_EccKeyGenOption_t.kgsign_rnd to include user provided random data for the signature.
 
#define MCUXCLELS_ECC_REVERSEFETCH_ENABLE
 Reverse Fetch enabled. For internal use.
 
#define MCUXCLELS_ECC_REVERSEFETCH_DISABLE
 Reverse Fetch disabled. For internal use.
 
#define MCUXCLELS_ECC_PUBLICKEY_SIZE
 Size of the public key.
 
#define MCUXCLELS_ECC_SIGNATURE_SIZE
 Size of the signature.
 
#define MCUXCLELS_ECC_SIGNATURE_R_SIZE
 Size of the signature part r.
 

Typedefs

typedef uint8_t mcuxClEls_EccByte_t
 Data type for ECC parameters in ELS format.
 

Functions

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_EccKeyGen_Async (mcuxClEls_EccKeyGenOption_t options, mcuxClEls_KeyIndex_t signingKeyIdx, mcuxClEls_KeyIndex_t privateKeyIdx, mcuxClEls_KeyProp_t generatedKeyProperties, uint8_t const *pRandomData, uint8_t *pPublicKey)
 Generates an ECC key pair on the NIST P-256 curve.
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_EccKeyExchange_Async (mcuxClEls_KeyIndex_t privateKeyIdx, uint8_t const *pPublicKey, mcuxClEls_KeyIndex_t sharedSecretIdx, mcuxClEls_KeyProp_t sharedSecretProperties)
 Performs a Diffie-Hellman key exchange with an internal ECC private key and an external ECC public key.
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_EccSign_Async (mcuxClEls_EccSignOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pInputHash, uint8_t const *pInputMessage, size_t inputMessageLength, uint8_t *pOutput)
 Generates an ECDSA signature of a given message.
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_EccVerify_Async (mcuxClEls_EccVerifyOption_t options, uint8_t const *pInputHash, uint8_t const *pInputMessage, size_t inputMessageLength, uint8_t const *pSignatureAndPubKey, uint8_t *pOutput)
 Verifies an ECDSA signature of a given message.
 

Detailed Description

ELS header for elliptic curve cryptography This header exposes functions that enable using the ELS for elliptic curve cryptography.

All functions operate on the NIST P-256 curve. The ECC operations supported are:

  • ECC key generation
  • ECC Diffie-Hellman key exchange
  • ECDSA signature generation/verification