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

Example of SHA2-256 hashing 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>

Functions

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

Variables

static ALIGNED uint8_t const sha256_padded_input [MCUXCLELS_HASH_BLOCK_SIZE_SHA_256]
 Data input for SHA2-256 hashing.
 
static ALIGNED uint8_t sha256_reference_digest [MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256]
 Expected hash value.
 
static ALIGNED uint8_t sha2_256_digest [MCUXCLELS_HASH_STATE_SIZE_SHA_256]
 Destination buffer to receive the hash output of the SHA2-256 hashing.
 

Detailed Description

Example of SHA2-256 hashing using the ELS (CLNS component mcuxClEls)

Function Documentation

◆ MCUXCLEXAMPLE_FUNCTION()

MCUXCLEXAMPLE_FUNCTION ( mcuxClEls_Hash_Sha256_One_Block_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

Disable the ELS

Variable Documentation

◆ sha256_padded_input

ALIGNED uint8_t const sha256_padded_input[MCUXCLELS_HASH_BLOCK_SIZE_SHA_256]
static

Data input for SHA2-256 hashing.

Examples
mcuxClEls_Hash_Sha256_One_Block_example.c.

◆ sha256_reference_digest

ALIGNED uint8_t sha256_reference_digest[MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256]
static

Expected hash value.

Examples
mcuxClEls_Hash_Sha256_One_Block_example.c.

◆ sha2_256_digest

ALIGNED uint8_t sha2_256_digest[MCUXCLELS_HASH_STATE_SIZE_SHA_256]
static

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

Examples
mcuxClEls_Hash_Sha256_One_Block_example.c.