MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c File Reference

Example of ECC for key generation, signing and verification using the ELS (CLNS component mcuxClEls) More...

#include <mcuxClEls.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <mcuxClCore_Examples.h>
#include <mcuxClExample_ELS_Helper.h>
#include <mcuxClExample_ELS_Key_Helper.h>

Functions

 MCUXCLEXAMPLE_FUNCTION (mcuxClEls_Ecc_Keygen_Sign_Verify_example)
 Performs SHA2-256 hashing using mcuxClEls functions. More...
 

Variables

static uint32_t const ecc_digest [MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256/sizeof(uint32_t)]
 Pre-hashed data to be signed. More...
 
static uint32_t ecc_public_key [MCUXCLELS_ECC_PUBLICKEY_SIZE/sizeof(uint32_t)]
 Destination buffer to receive the public key of the mcuxClEls_EccKeyGen_Async operation. More...
 
static uint32_t ecc_signature [MCUXCLELS_ECC_SIGNATURE_SIZE/sizeof(uint32_t)]
 Destination buffer to receive the signature of the mcuxClEls_EccSign_Async operation. More...
 
static uint32_t ecc_signature_r [MCUXCLELS_ECC_SIGNATURE_R_SIZE/sizeof(uint32_t)]
 Destination buffer to receive the signature part r of the VerifyOptions operation. More...
 
static uint32_t ecc_signature_and_public_key [(MCUXCLELS_ECC_SIGNATURE_SIZE+MCUXCLELS_ECC_PUBLICKEY_SIZE)/sizeof(uint32_t)]
 Concatenation of the ECC signature and public key, needed for the mcuxClEls_EccVerify_Async operation. More...
 

Detailed Description

Example of ECC for key generation, signing and verification using the ELS (CLNS component mcuxClEls)

Function Documentation

◆ MCUXCLEXAMPLE_FUNCTION()

MCUXCLEXAMPLE_FUNCTION ( mcuxClEls_Ecc_Keygen_Sign_Verify_example  )

Performs SHA2-256 hashing using mcuxClEls functions.

Return values
MCUXCLEXAMPLE_STATUS_OKThe example code completed successfully
MCUXCLEXAMPLE_STATUS_ERRORThe example code failed

Initialize ELS, Enable the ELS

deleted keyIdx keySlot

Disable the ELS

Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.

Variable Documentation

◆ ecc_digest

uint32_t const ecc_digest[MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256/sizeof(uint32_t)]
static

Pre-hashed data to be signed.

Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.

◆ ecc_public_key

uint32_t ecc_public_key[MCUXCLELS_ECC_PUBLICKEY_SIZE/sizeof(uint32_t)]
static

Destination buffer to receive the public key of the mcuxClEls_EccKeyGen_Async operation.

Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.

◆ ecc_signature

uint32_t ecc_signature[MCUXCLELS_ECC_SIGNATURE_SIZE/sizeof(uint32_t)]
static

Destination buffer to receive the signature of the mcuxClEls_EccSign_Async operation.

Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.

◆ ecc_signature_r

uint32_t ecc_signature_r[MCUXCLELS_ECC_SIGNATURE_R_SIZE/sizeof(uint32_t)]
static

Destination buffer to receive the signature part r of the VerifyOptions operation.

Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.

◆ ecc_signature_and_public_key

uint32_t ecc_signature_and_public_key[(MCUXCLELS_ECC_SIGNATURE_SIZE+MCUXCLELS_ECC_PUBLICKEY_SIZE)/sizeof(uint32_t)]
static

Concatenation of the ECC signature and public key, needed for the mcuxClEls_EccVerify_Async operation.

Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.