MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClEls_Ecc_Verify_Sha_Direct_Hash_in_parallel_example.c File Reference

Example to show usage of ECDSA Verify and SHA-direct operations in parallel using the ELS (CLNS component mcuxClEls). More...

#include <mcuxClToolchain.h>
#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_Verify_Sha_Direct_Hash_in_parallel_example)
 Performs an ECDSA Verify operation, followed by a SHA-direct operation started in parallel.
 

Variables

static const uint32_t ecc_digest [MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256/sizeof(uint32_t)]
 Pre-hashed data to be signed and verified.
 
static const uint8_t ecc_input_to_hash [MCUXCLELS_HASH_BLOCK_SIZE_SHA_256]
 Data to be hashed and verified (SHA2-256 hashing with SHA direct).
 
static uint8_t sha256_reference_digest [MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256]
 Expected hash value for SHA2-256 SHA direct operation of the data to verify.
 
static uint8_t sha256_digest [MCUXCLELS_HASH_STATE_SIZE_SHA_256]
 Destination buffer to receive the hash output of the SHA2-256 hashing.
 
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.
 
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.
 

Detailed Description

Example to show usage of ECDSA Verify and SHA-direct operations in parallel using the ELS (CLNS component mcuxClEls).

ECC KeyGen and ECDSA Sign are done as preparation for the signature verification.

Function Documentation

◆ MCUXCLEXAMPLE_FUNCTION()

MCUXCLEXAMPLE_FUNCTION ( mcuxClEls_Ecc_Verify_Sha_Direct_Hash_in_parallel_example  )

Performs an ECDSA Verify operation, followed by a SHA-direct operation started in parallel.

Key generation and ECDSA Sign operations are done for setup only.

Return values
MCUXCLEXAMPLE_STATUS_OKThe example code completed successfully
MCUXCLEXAMPLE_STATUS_ERRORThe example code failed

Variable Documentation

◆ ecc_digest

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

Pre-hashed data to be signed and verified.

Data needs to be pre-hashed s.t. ECDSA operations can be run in parallel with SHA direct.

◆ ecc_input_to_hash

const uint8_t ecc_input_to_hash[MCUXCLELS_HASH_BLOCK_SIZE_SHA_256]
static

Data to be hashed and verified (SHA2-256 hashing with SHA direct).

◆ sha256_reference_digest

uint8_t sha256_reference_digest[MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256]
static

Expected hash value for SHA2-256 SHA direct operation of the data to verify.

◆ sha256_digest

uint8_t sha256_digest[MCUXCLELS_HASH_STATE_SIZE_SHA_256]
static

Destination buffer to receive the hash output of the SHA2-256 hashing.

◆ 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.

◆ 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.