MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Hashcrypt_background_driver_hash

Functions

void HASHCRYPT_SHA_SetCallback (HASHCRYPT_Type *base, hashcrypt_hash_ctx_t *ctx, hashcrypt_callback_t callback, void *userData)
 Initializes the HASHCRYPT handle for background hashing. More...
 
status_t HASHCRYPT_SHA_UpdateNonBlocking (HASHCRYPT_Type *base, hashcrypt_hash_ctx_t *ctx, const uint8_t *input, size_t inputSize)
 Create running hash on given data. More...
 

Detailed Description

Function Documentation

void HASHCRYPT_SHA_SetCallback ( HASHCRYPT_Type *  base,
hashcrypt_hash_ctx_t ctx,
hashcrypt_callback_t  callback,
void *  userData 
)

This function initializes the hash context for background hashing (Non-blocking) APIs. This is less typical interface to hash function, but can be used for parallel processing, when main CPU has something else to do. Example is digital signature RSASSA-PKCS1-V1_5-VERIFY((n,e),M,S) algorithm, where background hashing of M can be started, then CPU can compute S^e mod n (in parallel with background hashing) and once the digest becomes available, CPU can proceed to comparison of EM with EM'.

Parameters
baseHASHCRYPT peripheral base address.
[out]ctxHash context.
callbackCallback function.
userDataUser data (to be passed as an argument to callback function, once callback is invoked from isr).
status_t HASHCRYPT_SHA_UpdateNonBlocking ( HASHCRYPT_Type *  base,
hashcrypt_hash_ctx_t ctx,
const uint8_t *  input,
size_t  inputSize 
)

Configures the HASHCRYPT to compute new running hash as AHB master and returns immediately. HASHCRYPT AHB Master mode supports only aligned input address and can be called only once per continuous block of data. Every call to this function must be preceded with HASHCRYPT_SHA_Init() and finished with HASHCRYPT_SHA_Finish(). Once callback function is invoked by HASHCRYPT isr, it should set a flag for the main application to finalize the hashing (padding) and to read out the final digest by calling HASHCRYPT_SHA_Finish().

Parameters
baseHASHCRYPT peripheral base address
ctxSpecifies callback. Last incomplete 512-bit block of the input is copied into clear buffer for padding.
input32-bit word aligned pointer to Input data.
inputSizeSize of input data in bytes (must be word aligned)
Returns
Status of the hash update operation.