HAL HASH Functions

HASH initialization and de-initialization functions

group HASH_Exported_Functions_Group1

This section provides functions allowing to:

  • Initialize the HASH handle and associate it to a given HASH peripheral instance.

  • DeInitialize the HASH peripheral.

Functions

hal_status_t HAL_HASH_Init ( hal_hash_handle_t * hhash , hal_hash_t instance )

Initialize the selected HAL HASH handle and associate an HASH peripheral instance.

Parameters :
Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – HASH handle has been correctly initialized.

void HAL_HASH_DeInit ( hal_hash_handle_t * hhash )

DeInitialize the HASH peripheral.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

HASH Set and Get configurations functions

group HASH_Exported_Functions_Group2

This subsection provides a set of functions allowing to set and get the HASH configuration.

  • Use the function HAL_HASH_SetConfig() to Configure HASH with the specified parameters in the hal_hash_config_t Parameters which are :

    • Data Swapping : no swap or half word swap or bit swap or byte swap.

    • algorithm : MD5 or SHA1 or SH224 or SH256.

  • Use the function HAL_HASH_GetConfig() to retrieve the HAL HASH configuration.

Functions

hal_status_t HAL_HASH_SetConfig ( hal_hash_handle_t * hhash , const hal_hash_config_t * p_config )

Configure the HASH according to the specified parameters in the hal_hash_config_t .

Parameters :
Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – HASH instance has been correctly configured.

void HAL_HASH_GetConfig ( hal_hash_handle_t * hhash , hal_hash_config_t * p_config )

Get HASH Configuration parameters.

Parameters :

HASH processing functions

group HASH_Exported_Functions_Group3

This section provides API allowing to calculate the hash value using one of the HASH algorithms supported by the peripheral.

For a single buffer to be hashed, user can resort to one of three processing functions available:

In case of multi-buffer HASH processing (a single digest is computed while several buffers are fed to the peripheral), the user can resort to successive calls to :

To retrieve the digest computation, call HAL_HASH_Finish() .

Functions

hal_status_t HAL_HASH_Compute ( hal_hash_handle_t * hhash , const void * p_input_buffer , uint32_t input_size_byte , void * p_output_buffer , uint32_t * p_output_size_byte , uint32_t timeout_ms )

Compute HASH input buffer in polling mode then retrieve the computed digest in the output buffer.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

  • timeout_ms – Specify timeout value in millisecond

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Operation completed.

hal_status_t HAL_HASH_Compute_IT ( hal_hash_handle_t * hhash , const void * p_input_buffer , uint32_t input_size_byte , void * p_output_buffer , uint32_t * p_output_size_byte )

Compute HASH input buffer in interrupt mode then retrieve the computed digest in the output buffer.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Operation started correctly.

hal_status_t HAL_HASH_Compute_DMA ( hal_hash_handle_t * hhash , const void * p_input_buffer , uint32_t input_size_byte , void * p_output_buffer , uint32_t * p_output_size_byte )

Compute HASH input buffer in DMA mode then retrieve the computed digest in the output buffer.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_input_buffer – pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Operation started correctly.

hal_status_t HAL_HASH_Update ( hal_hash_handle_t * hhash , const void * p_add_input_buffer , uint32_t input_size_byte , uint32_t timeout_ms )

HASH update process in polling mode with several input buffers.

Note

Consecutive calls to HAL_HASH_Update() can be used to feed several input buffersback-to-back to the peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASH_Finish() .

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_add_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • timeout_ms – Specify timeout value in millisecond.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Input buffer fed correctly.

hal_status_t HAL_HASH_Update_IT ( hal_hash_handle_t * hhash , const void * p_add_input_buffer , uint32_t input_size_byte )

HASH update process in interrupt mode several input buffers.

Note

Consecutive calls to HAL_HASH_Update_IT() can be used to feed several input buffers back-to-back to the peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASH_Finish() .

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_add_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – The update of the given buffer has been processed correctly.

hal_status_t HAL_HASH_Update_DMA ( hal_hash_handle_t * hhash , const void * p_add_input_buffer , uint32_t input_size_byte )

HASH update process in DMA mode with several input buffers.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_add_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – The update of the given buffer has been processed correctly.

hal_status_t HAL_HASH_Finish ( hal_hash_handle_t * hhash , void * p_output_buffer , uint32_t * p_output_size_byte , uint32_t timeout_ms )

Finish HASH update process.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

  • timeout_ms – Specify timeout value in millisecond.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Hash operation correctly completed and digest available in the output buffer.

HASH HMAC Set and Get configurations functions

group HASH_Exported_Functions_Group4

This subsection provides a set of functions allowing to set and get the HASH HMAC configuration.

  • Use the function HAL_HASH_HMAC_SetConfig() to Configure HASH HMAC with the specified parameters in the hal_hash_hmac_config_t Parameters which are :

    • Data Swapping : no swap or half word swap or bit swap or byte swap.

    • algorithm : MD5 or SHA1 or SH224 or SH256.

    • Key and key size in byte to use for the HMAC operation

  • Use the function HAL_HASH_HMAC_GetConfig() to retrieve the HAL HASH HMAC configuration.

Functions

hal_status_t HAL_HASH_HMAC_SetConfig ( hal_hash_handle_t * hhash , const hal_hash_hmac_config_t * p_config )

Configure the HASH HMAC according to the specified parameters in the hal_hash_hmac_config_t .

Parameters :
Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_BUSY – Process is already ongoing.

  • HAL_ERROR – A timeout has occurred.

  • HAL_OK – Operation started correctly.

void HAL_HASH_HMAC_GetConfig ( hal_hash_handle_t * hhash , hal_hash_hmac_config_t * p_config )

Get HASH HMAC Configuration parameters.

Parameters :

HMAC processing functions

group HASH_Exported_Functions_Group5

This section provides API allowing to calculate the HMAC (keyed-hash message authentication code).

To calculate the HMAC for a single buffer, user can resort to one of three processing functions available:

In case of multi-buffer HMAC processing (a single digest is computed while several buffers are fed to the peripheral), the user can resort to successive calls to :

To retrieve the digest computation, call HAL_HASH_HMAC_Finish() .

Functions

hal_status_t HAL_HASH_HMAC_Compute ( hal_hash_handle_t * hhash , const void * p_input_buffer , uint32_t input_size_byte , void * p_output_buffer , uint32_t * p_output_size_byte , uint32_t timeout_ms )

Compute HASH HMAC input buffer in polling mode, then retrieve the computed digest in the output buffer.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

  • timeout_ms – Specify timeout value in millisecond.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Operation completed.

hal_status_t HAL_HASH_HMAC_Compute_IT ( hal_hash_handle_t * hhash , const void * p_input_buffer , uint32_t input_size_byte , void * p_output_buffer , uint32_t * p_output_size_byte )

Compute HASH HMAC input buffer in interrupt mode, retrieve the computed digest in the output buffer.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Operation started correctly.

hal_status_t HAL_HASH_HMAC_Compute_DMA ( hal_hash_handle_t * hhash , const void * p_input_buffer , uint32_t input_size_byte , void * p_output_buffer , uint32_t * p_output_size_byte )

Compute HASH HMAC input buffer in DMA mode, then retrieve the computed digest in the output buffer.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Operation started correctly.

hal_status_t HAL_HASH_HMAC_Update ( hal_hash_handle_t * hhash , const void * p_add_input_buffer , uint32_t input_size_byte , uint32_t timeout_ms )

HASH HMAC update process in polling mode with several input buffers.

Note

Consecutive calls to HAL_HASH_HMAC_Update() can be used to feed several input buffers back-to-back to the peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASH_HMAC_Finish() .

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_add_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

  • timeout_ms – Specify timeout value in millisecond.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – The update of the given buffer has been processed correctly.

hal_status_t HAL_HASH_HMAC_Update_IT ( hal_hash_handle_t * hhash , const void * p_add_input_buffer , uint32_t input_size_byte )

HASH HMAC update process in IT mode with several input buffers.

Note

Consecutive calls to HAL_HASH_HMAC_Update_IT() can be used to feed several input buffers back-to-back to the peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASH_HMAC_Finish() .

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_add_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – The update of the given buffer has been processed correctly.

hal_status_t HAL_HASH_HMAC_Update_DMA ( hal_hash_handle_t * hhash , const void * p_add_input_buffer , uint32_t input_size_byte )

HASH HMAC update process in DMA mode with several input buffers.

Note

Multi-buffer HMAC processing is possible, consecutive calls to HAL_HASH_HMAC_Update_DMA() can be used to feed several input buffers back-to-back to the peripheral that will yield a single HASH signature once all buffers have been entered. Wrap-up of input buffers feeding and retrieval of digest is done by a call to HAL_HASH_HMAC_Finish() .

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_add_input_buffer – Pointer to the input buffer (buffer to be hashed).

  • input_size_byte – length of the input buffer in bytes.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_ERROR – An error has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – The update of the given buffer has been processed correctly.

hal_status_t HAL_HASH_HMAC_Finish ( hal_hash_handle_t * hhash , void * p_output_buffer , uint32_t * p_output_size_byte , uint32_t timeout_ms )

Finish HASH update process.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_output_buffer – Pointer to the computed digest.

  • p_output_size_byte – Pointer to the length of the computed digest in bytes.

  • timeout_ms – Specify timeout value in millisecond.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – Hash operation correctly completed and digest available in the output buffer.

HASH Abort functions

group HASH_Exported_Functions_Group6

This section provides functions allowing to:

Functions

hal_status_t HAL_HASH_Abort ( hal_hash_handle_t * hhash , uint32_t timeout_ms )

Abort HASH/HMAC in polling mode.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • timeout_ms – Specify timeout value in millisecond.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_TIMEOUT – A timeout has occurred.

  • HAL_ERROR – In case of user timeout.

  • HAL_OK – Operation completed.

hal_status_t HAL_HASH_Abort_IT ( hal_hash_handle_t * hhash )

Abort HASH/HMAC in interrupt mode.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Operation completed.

HASH IRQ handler management

group HASH_Exported_Functions_Group7

This section provides HASH IRQ handler and callback functions.

The compilation define USE_HAL_HASH_REGISTER_CALLBACKS when set to 1 allows the user to register custom callbacks.

Functions

void HAL_HASH_IRQHandler ( hal_hash_handle_t * hhash )

HASH interrupt request.

Note

HAL_HASH_IRQHandler() handles interrupts in HMAC processing as well.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

void HAL_HASH_InputCpltCallback ( hal_hash_handle_t * hhash )

Input data transfer complete callback.

Warning

HAL_HASH_InputCpltCallback() is called when the complete input message has been fed to the peripheral. This API is invoked only when input data are entered under interruption or through DMA.

Warning

In case of HASH or HMAC update DMA feeding case, HAL_HASH_InputCpltCallback() is called at the end of each buffer feeding to the peripheral.

Parameters :

hhash – pointer to a hal_hash_handle_t structure.

void HAL_HASH_DigestCpltCallback ( hal_hash_handle_t * hhash )

Digest computation complete callback.

Note

HAL_HASH_DigestCpltCallback() is used under interruption, is not relevant with DMA.

Parameters :

hhash – pointer to a hal_hash_handle_t structure.

void HAL_HASH_ErrorCallback ( hal_hash_handle_t * hhash )

HASH error callback.

Parameters :

hhash – pointer to a hal_hash_handle_t structure.

void HAL_HASH_SuspendCallback ( hal_hash_handle_t * hhash )

HASH suspend callback.

Parameters :

hhash – pointer to a hal_hash_handle_t structure.

void HAL_HASH_AbortCallback ( hal_hash_handle_t * hhash )

HASH abort callback.

Parameters :

hhash – pointer to a hal_hash_handle_t structure.

hal_status_t HAL_HASH_RegisterInputCpltCallback ( hal_hash_handle_t * hhash , hal_hash_cb_t callback )

Register the user hash input callback to be used instead of the weak (surcharged) predefined callback.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • callback – Pointer to the callback function.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Register callback completed successfully.

hal_status_t HAL_HASH_RegisterDigestComputationCpltCallback ( hal_hash_handle_t * hhash , hal_hash_cb_t callback )

Register the user hash digest Callback to be used instead of the weak (surcharged) predefined callback.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • callback – Pointer to the callback function.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Register callback completed successfully.

hal_status_t HAL_HASH_RegisterErrorCpltCallback ( hal_hash_handle_t * hhash , hal_hash_cb_t callback )

Register the user hash error Callback to be used instead of the weak (surcharged) predefined callback.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • callback – Pointer to the callback function.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Register callback completed successfully.

hal_status_t HAL_HASH_RegisterSuspendCpltCallback ( hal_hash_handle_t * hhash , hal_hash_cb_t callback )

Register the user hash suspend Callback to be used instead of the weak (surcharged) predefined callback.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • callback – Pointer to the Callback function.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Register callback completed successfully.

hal_status_t HAL_HASH_RegisterAbortCpltCallback ( hal_hash_handle_t * hhash , hal_hash_cb_t callback )

Register the user hash abort Callback to be used instead of the weak (surcharged) predefined callback.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • callback – Pointer to the Callback function.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Register callback completed successfully.

hal_status_t HAL_HASH_SetInDMA ( hal_hash_handle_t * hhash , hal_dma_handle_t * hdma_in )

link/store HAL DMA handle into the HAL HASH handle.

Parameters :
Return values :
  • HAL_INVALID_PARAM – Invalid parameter.

  • HAL_OK – Operation completed.

HASH Suspend/Resume functions

group HASH_Exported_Functions_Group8

This section provides HASH Suspend and Resume functions.

Functions

hal_status_t HAL_HASH_RequestSuspendComputation ( hal_hash_handle_t * hhash )

Request suspension for hash interrupt mode computation.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :

HAL_OK – The HASH processing suspension is well requested.

hal_status_t HAL_HASH_ResumeComputation ( hal_hash_handle_t * hhash )

Resumption of the suspended HASH processing computation.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :
  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – HASH suspended processing is resumed.

hal_status_t HAL_HASH_RequestSuspendUpdate ( hal_hash_handle_t * hhash )

Request suspension for hash interrupt mode processing update.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :

HAL_OK – The HASH processing suspension is well requested.

hal_status_t HAL_HASH_ResumeUpdate ( hal_hash_handle_t * hhash )

Resumption of the suspended HASH processing update.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :
  • HAL_BUSY – Process is already ongoing.

  • HAL_OK – HASH suspended processing is resumed.

void HAL_HASH_SaveContext ( hal_hash_handle_t * hhash , hal_hash_suspended_context_t * p_context )

Save parameters of the suspended HASH processing.

Parameters :
void HAL_HASH_RestoreContext ( hal_hash_handle_t * hhash , const hal_hash_suspended_context_t * p_context )

Restore the HASH context in case of processing resumption.

Parameters :

HASH peripheral State, Error and User data functions

group HASH_Exported_Functions_Group9

This subsection provides a set of functions to get the HASH error information and state:

Functions

hal_hash_state_t HAL_HASH_GetState ( const hal_hash_handle_t * hhash )

Return the HASH handle state.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :

HAL – HASH global state.

uint32_t HAL_HASH_GetLastErrorCodes ( const hal_hash_handle_t * hhash )

Return the HASH handle error code.

Note

When the return is 0xAAAAAAAAU this is a HAL_INVALID_PARAM

Parameters :

hhash – pointer to a hal_hash_handle_t structure.

Return values :

HASH – last error Codes.

void HAL_HASH_SetUserData ( hal_hash_handle_t * hhash , const void * p_user_data )

Store the user data pointer into the HASH handle.

Parameters :
  • hhash – Pointer to a hal_hash_handle_t structure.

  • p_user_data – Pointer to the user data.

const void * HAL_HASH_GetUserData ( const hal_hash_handle_t * hhash )

Retrieve the user data from the HASH handle.

Parameters :

hhash – Pointer to a hal_hash_handle_t structure.

Return values :

Pointer – to the user data.

HASH Interrupt And Flag Configuration

group HASH_Exported_Functions_Group10

This section provides functions allowing to initialize and de-initialize the HASH card device :

Functions

uint32_t HAL_HASH_IsActiveFlag ( const hal_hash_handle_t * hhash , uint32_t flag )

Check whether or not the specified HASH flag is set.

Parameters :
  • hhash – specifies the HASH handle.

  • flag – specifies the flag to check. This parameter must be a combination of HASH flags definitions .

Return values :

uint32_t – The state of flag (0 or 1).

uint32_t HAL_HASH_GetITSource ( const hal_hash_handle_t * hhash , uint32_t interrupt )

Check whether the specified HASH interrupt source is enabled or not.

Parameters :
Return values :

uint32_t – State of interruption (0 or 1).

void HAL_HASH_EnableIT ( hal_hash_handle_t * hhash , uint32_t interrupt )

Enable the specified HASH interrupt.

Parameters :
  • hhash – specifies the HASH handle.

  • interrupt – specifies the HASH interrupt source to enable. This parameter must be a combination of HASH interrupts definitions .

void HAL_HASH_DisableIT ( hal_hash_handle_t * hhash , uint32_t interrupt )

Disable the specified HASH interrupt.

Parameters :
  • hhash – specifies the HASH handle.

  • interrupt – specifies the HASH interrupt source to disable. This parameter must be a combination of HASH interrupts definitions .

void HAL_HASH_ClearFlag ( hal_hash_handle_t * hhash , uint32_t flag )

Clear the specified HASH flag.

Parameters :
  • hhash – specifies the HASH handle.

  • flag – specifies the flag to clear. This parameter must be a combination of HASH flags definitions .