PSoC 6 Peripheral Driver Library

General Description

Functions

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha (CRYPTO_Type *base, uint8_t const *message, uint32_t messageSize, uint8_t *digest, cy_en_crypto_sha_mode_t mode)
 Performs the SHA Hash function. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Init (CRYPTO_Type *base, cy_stc_crypto_sha_state_t *shaHashState, cy_en_crypto_sha_mode_t mode, void *shaBuffers)
 The function to initialize the SHA operation. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Start (CRYPTO_Type *base, cy_stc_crypto_sha_state_t *hashState)
 Initializes the initial Hash vector. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Update (CRYPTO_Type *base, cy_stc_crypto_sha_state_t *hashState, uint8_t const *message, uint32_t messageSize)
 Performs the SHA calculation on one message. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Finish (CRYPTO_Type *base, cy_stc_crypto_sha_state_t *hashState, uint8_t *digest)
 Completes the SHA calculation. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Free (CRYPTO_Type *base, cy_stc_crypto_sha_state_t *hashState)
 Clears the used memory buffers. More...
 

Function Documentation

◆ Cy_Crypto_Core_Sha()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha ( CRYPTO_Type *  base,
uint8_t const *  message,
uint32_t  messageSize,
uint8_t *  digest,
cy_en_crypto_sha_mode_t  mode 
)

Performs the SHA Hash function.

Parameters
baseThe pointer to the CRYPTO instance.
modecy_en_crypto_sha_mode_t
messageThe pointer to the message whose hash value is being computed.
messageSizeThe size of the message.
digestThe pointer to the hash digest.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Sha_Init()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Init ( CRYPTO_Type *  base,
cy_stc_crypto_sha_state_t shaHashState,
cy_en_crypto_sha_mode_t  mode,
void *  shaBuffers 
)

The function to initialize the SHA operation.

Parameters
baseThe pointer to the CRYPTO instance.
shaHashStateThe pointer to a Hash state.
modeOne of these: CY_CRYPTO_SHA256, CY_CRYPTO_SHA1, CY_CRYPTO_SHA256_224, CY_CRYPTO_SHA512, CY_CRYPTO_SHA384, CY_CRYPTO_SHA512_224, CY_CRYPTO_SHA512_256
shaBuffersThe pointer to the memory buffers storage.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Sha_Start()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Start ( CRYPTO_Type *  base,
cy_stc_crypto_sha_state_t hashState 
)

Initializes the initial Hash vector.

Parameters
baseThe pointer to the CRYPTO instance.
hashStateThe pointer to the SHA context.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Sha_Update()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Update ( CRYPTO_Type *  base,
cy_stc_crypto_sha_state_t hashState,
uint8_t const *  message,
uint32_t  messageSize 
)

Performs the SHA calculation on one message.

Parameters
baseThe pointer to the CRYPTO instance.
hashStateThe pointer to the SHA context.
messageThe pointer to the message whose Hash is being computed.
messageSizeThe size of the message whose Hash is being computed.
Returns
cy_en_crypto_status_t
Note
This function can be called several times only with message lengths dividable by the block size. Only the last call to the function can process a message with a not-dividable size.

◆ Cy_Crypto_Core_Sha_Finish()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Finish ( CRYPTO_Type *  base,
cy_stc_crypto_sha_state_t hashState,
uint8_t *  digest 
)

Completes the SHA calculation.

Parameters
baseThe pointer to the CRYPTO instance.
hashStateThe pointer to the SHA context.
digestThe pointer to the calculated Hash digest.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Sha_Free()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Sha_Free ( CRYPTO_Type *  base,
cy_stc_crypto_sha_state_t hashState 
)

Clears the used memory buffers.

Parameters
baseThe pointer to the CRYPTO instance.
hashStateThe pointer to the SHA context.
Returns
cy_en_crypto_status_t