MCUX CLNS MCUX Crypto Library Normal Secure |

Data Structures | Macros | Functions
mcuxClCss_Hash.h File Reference

CSSv2 header for hashing. More...

`#include <mcuxClCss_Common.h>`

Go to the source code of this file.

## Data Structures
union | mcuxClCss_HashOption_t
| Command option bit field for mcuxClCss_Hash_Async and mcuxClCss_Hash_ShaDirect. More...

## Macros
#define | MCUXCLCSS_HASH_INIT_ENABLE
| Set this option at mcuxClCss_HashOption_t.hashini to initialize the hash. More...
#define | MCUXCLCSS_HASH_INIT_DISABLE
| Set this option at mcuxClCss_HashOption_t.hashini to continue the hash. More...
#define | MCUXCLCSS_HASH_LOAD_ENABLE
| Set this option at mcuxClCss_HashOption_t.hashld to load the hash state from `pDigest`. More...
#define | MCUXCLCSS_HASH_LOAD_DISABLE
| Set this option at mcuxClCss_HashOption_t.hashld to not load the hash state. More...
#define | MCUXCLCSS_HASH_OUTPUT_ENABLE
| Set this option at mcuxClCss_HashOption_t.hashoe to output the hash to `pDigest`. More...
#define | MCUXCLCSS_HASH_OUTPUT_DISABLE
| Set this option at mcuxClCss_HashOption_t.hashoe to not output the hash. More...
#define | MCUXCLCSS_HASH_RTF_UPDATE_ENABLE
| Set this option at mcuxClCss_HashOption_t.rtfupd to update the run-time fingerprint (only supported by mcuxClCss_Hash_Async) More...
#define | MCUXCLCSS_HASH_RTF_UPDATE_DISABLE
| Set this option at mcuxClCss_HashOption_t.rtfupd to not update the run-time fingerprint. More...
#define | MCUXCLCSS_HASH_RTF_OUTPUT_ENABLE
| Set this option at mcuxClCss_HashOption_t.rtfoe to output the run-time fingerprint (only supported by mcuxClCss_Hash_Async) More...
#define | MCUXCLCSS_HASH_RTF_OUTPUT_DISABLE
| Set this option at mcuxClCss_HashOption_t.rtfoe to not output the run-time fingerprint. More...
#define | MCUXCLCSS_HASH_MODE_SHA_224
| Set this option at mcuxClCss_HashOption_t.hashmd to use the hash algorithm SHA-224. More...
#define | MCUXCLCSS_HASH_MODE_SHA_256
| Set this option at mcuxClCss_HashOption_t.hashmd to use the hash algorithm SHA-256. More...
#define | MCUXCLCSS_HASH_MODE_SHA_384
| Set this option at mcuxClCss_HashOption_t.hashmd to use the hash algorithm SHA-384. More...
#define | MCUXCLCSS_HASH_MODE_SHA_512
| Set this option at mcuxClCss_HashOption_t.hashmd to use the hash algorithm SHA-512. More...
#define | MCUXCLCSS_HASH_BLOCK_SIZE_SHA_224
| SHA-224 output size: 512 bit (64 bytes) More...
#define | MCUXCLCSS_HASH_BLOCK_SIZE_SHA_256
| SHA-256 output size: 512 bit (64 bytes) More...
#define | MCUXCLCSS_HASH_BLOCK_SIZE_SHA_384
| SHA-384 output size: 1024 bit (128 bytes) More...
#define | MCUXCLCSS_HASH_BLOCK_SIZE_SHA_512
| SHA-512 output size: 1024 bit (128 bytes) More...
#define | MCUXCLCSS_HASH_STATE_SIZE_SHA_224
| SHA-224 state size: 256 bit (32 bytes) More...
#define | MCUXCLCSS_HASH_STATE_SIZE_SHA_256
| SHA-256 state size: 256 bit (32 bytes) More...
#define | MCUXCLCSS_HASH_STATE_SIZE_SHA_384
| SHA-384 state size: 512 bit (64 bytes) More...
#define | MCUXCLCSS_HASH_STATE_SIZE_SHA_512
| SHA-512 state size: 512 bit (64 bytes) More...
#define | MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_224
| SHA-224 output size: 224 bit (28 bytes) More...
#define | MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_256
| SHA-256 output size: 256 bit (32 bytes) More...
#define | MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_384
| SHA-384 output size: 384 bit (48 bytes) More...
#define | MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_512
| SHA-512 output size: 512 bit (64 bytes) More...
#define | MCUXCLCSS_HASH_RTF_OUTPUT_SIZE

## Functions
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_Hash_Async (mcuxClCss_HashOption_t options, uint8_t const *pInput, size_t inputLength, uint8_t *pDigest)
| Computes the hash of a message. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_ShaDirect_Enable (void)
| Enables SHA-direct mode. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_ShaDirect_Disable (void)
| Disables SHA-direct mode. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_Hash_ShaDirect (mcuxClCss_HashOption_t options, uint8_t const *pInput, size_t inputLength, uint8_t *pDigest, mcuxClCss_TransferToRegisterFunction_t pCallback, void *pCallerData)
| Calculates the hash of a message using SHA-Direct mode. More...

## Detailed Description

CSSv2 header for hashing.

This header exposes functions that enable using the CSSv2 for hashing. There are two modes to hash a message: The asynchronous way as a CSSv2 command, and the SHA-Direct mode which feeds data to the internal registers of the CSSv2 and is synchronous (blocking). The SHA-Direct mode is meant to be used when another command should be executed in parallel on the CSSv2 while the hash operation is still ongoing. For this, use the DMA callback option in mcuxClCss_Hash_ShaDirect.