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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
instance – HASH instance.
- 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.
- 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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
instance – HASH instance.
- 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.
- 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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
instance – HASH instance.
- 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 configuration 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 : SHA-1, SHA2-224, SHA2-256, and on some supported devices SHA2-384, SHA2-512224, SHA2-512256 and SHA2-512.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure
p_config – Pointer to a hal_hash_config_t structure that contains the configuration for HASH module.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_OK – HASH instance has been correctly configured.
-
void
HAL_HASH_GetConfig
(
const
hal_hash_handle_t
*
hhash
,
hal_hash_config_t
*
p_config
)
¶
-
Get HASH Configuration parameters.
- Parameters :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_config_t structure.
- 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 : SHA-1, SHA2-224, SHA2-256, and on some supported devices SHA2-384, SHA2-512224, SHA2-512256 and SHA2-512.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure
p_config – Pointer to a hal_hash_config_t structure that contains the configuration for HASH module.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_OK – HASH instance has been correctly configured.
-
void
HAL_HASH_GetConfig
(
const
hal_hash_handle_t
*
hhash
,
hal_hash_config_t
*
p_config
)
-
Get HASH Configuration parameters.
- Parameters :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_config_t structure.
- 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 : SHA-1, SHA2-224, SHA2-256, and on some supported devices SHA2-384, SHA2-512224, SHA2-512256 and SHA2-512.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure
p_config – Pointer to a hal_hash_config_t structure that contains the configuration for HASH module.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_OK – HASH instance has been correctly configured.
-
void
HAL_HASH_GetConfig
(
const
hal_hash_handle_t
*
hhash
,
hal_hash_config_t
*
p_config
)
-
Get HASH Configuration parameters.
- Parameters :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_config_t structure.
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:
Polling mode : HAL_HASH_Compute()
Interrupt mode : HAL_HASH_Compute_IT()
DMA mode : HAL_HASH_Compute_DMA()
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 :
Polling mode : Call HAL_HASH_Update() to continue HASH update process.
Interrupt mode : Call HAL_HASH_Update_IT() to continue HASH update process.
DMA mode: Call HAL_HASH_Update_DMA() to continue HASH update process.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
,
uint32_t
timeout_ms
)
¶
-
Compute HASH input buffer in polling mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
¶
-
Compute HASH input buffer in interrupt mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
¶
-
Compute HASH input buffer in DMA mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the 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 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.
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_ERROR – An error has occurred.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error has occurred.
HAL_OK – Hash operation correctly completed and digest available in the output buffer.
- 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:
Polling mode : HAL_HASH_Compute()
Interrupt mode : HAL_HASH_Compute_IT()
DMA mode : HAL_HASH_Compute_DMA()
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 :
Polling mode : Call HAL_HASH_Update() to continue HASH update process.
Interrupt mode : Call HAL_HASH_Update_IT() to continue HASH update process.
DMA mode: Call HAL_HASH_Update_DMA() to continue HASH update process.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
,
uint32_t
timeout_ms
)
-
Compute HASH input buffer in polling mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH input buffer in interrupt mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH input buffer in DMA mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the 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 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.
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_ERROR – An error has occurred.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error has occurred.
HAL_OK – Hash operation correctly completed and digest available in the output buffer.
- 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:
Polling mode : HAL_HASH_Compute()
Interrupt mode : HAL_HASH_Compute_IT()
DMA mode : HAL_HASH_Compute_DMA()
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 :
Polling mode : Call HAL_HASH_Update() to continue HASH update process.
Interrupt mode : Call HAL_HASH_Update_IT() to continue HASH update process.
DMA mode: Call HAL_HASH_Update_DMA() to continue HASH update process.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
,
uint32_t
timeout_ms
)
-
Compute HASH input buffer in polling mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH input buffer in interrupt mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH input buffer in DMA mode then retrieve the computed digest in the output buffer and its size in bytes.
- 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 – Size of the input buffer in bytes.
p_output_buffer – Pointer to the computed digest.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the 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 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.
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_ERROR – An error has occurred.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error has occurred.
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.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_hmac_config_t structure.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has occurred.
HAL_OK – Operation started correctly.
-
void
HAL_HASH_HMAC_GetConfig
(
const
hal_hash_handle_t
*
hhash
,
hal_hash_hmac_config_t
*
p_config
)
¶
-
Get HASH HMAC Configuration parameters.
- Parameters :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_hmac_config_t structure.
- 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.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_hmac_config_t structure.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has occurred.
HAL_OK – Operation started correctly.
-
void
HAL_HASH_HMAC_GetConfig
(
const
hal_hash_handle_t
*
hhash
,
hal_hash_hmac_config_t
*
p_config
)
-
Get HASH HMAC Configuration parameters.
- Parameters :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_hmac_config_t structure.
- 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.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_hmac_config_t structure.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has occurred.
HAL_OK – Operation started correctly.
-
void
HAL_HASH_HMAC_GetConfig
(
const
hal_hash_handle_t
*
hhash
,
hal_hash_hmac_config_t
*
p_config
)
-
Get HASH HMAC Configuration parameters.
- Parameters :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_config – Pointer to a hal_hash_hmac_config_t structure.
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:
Polling mode : HAL_HASH_HMAC_Compute()
Interrupt mode : HAL_HASH_HMAC_Compute_IT()
DMA mode : HAL_HASH_HMAC_Compute_DMA()
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 :
Polling mode : Call HAL_HASH_HMAC_Update() to continue HASH HMAC update process.
Interrupt mode : Call HAL_HASH_HMAC_Update_IT() to continue HASH HMAC update process.
DMA mode: Call HAL_HASH_HMAC_Update_DMA() to continue HASH HMAC update process.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
,
uint32_t
timeout_ms
)
¶
-
Compute HASH HMAC input buffer in polling mode, then retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
¶
-
Compute HASH HMAC input buffer in interrupt mode, retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
¶
-
Compute HASH HMAC input buffer in DMA mode, then retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error has occurred.
HAL_OK – Hash operation correctly completed and digest available in the output buffer.
- 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:
Polling mode : HAL_HASH_HMAC_Compute()
Interrupt mode : HAL_HASH_HMAC_Compute_IT()
DMA mode : HAL_HASH_HMAC_Compute_DMA()
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 :
Polling mode : Call HAL_HASH_HMAC_Update() to continue HASH HMAC update process.
Interrupt mode : Call HAL_HASH_HMAC_Update_IT() to continue HASH HMAC update process.
DMA mode: Call HAL_HASH_HMAC_Update_DMA() to continue HASH HMAC update process.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
,
uint32_t
timeout_ms
)
-
Compute HASH HMAC input buffer in polling mode, then retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH HMAC input buffer in interrupt mode, retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH HMAC input buffer in DMA mode, then retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error has occurred.
HAL_OK – Hash operation correctly completed and digest available in the output buffer.
- 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:
Polling mode : HAL_HASH_HMAC_Compute()
Interrupt mode : HAL_HASH_HMAC_Compute_IT()
DMA mode : HAL_HASH_HMAC_Compute_DMA()
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 :
Polling mode : Call HAL_HASH_HMAC_Update() to continue HASH HMAC update process.
Interrupt mode : Call HAL_HASH_HMAC_Update_IT() to continue HASH HMAC update process.
DMA mode: Call HAL_HASH_HMAC_Update_DMA() to continue HASH HMAC update process.
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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
,
uint32_t
timeout_ms
)
-
Compute HASH HMAC input buffer in polling mode, then retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error 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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH HMAC input buffer in interrupt mode, retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_size_byte
)
-
Compute HASH HMAC input buffer in DMA mode, then retrieve the computed digest in the output buffer and its size in bytes.
- 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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_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
output_buffer_size_byte
,
uint32_t
*
p_output_hash_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.
output_buffer_size_byte – Size of the output buffer in bytes provided by the user.
p_output_hash_size_byte – Pointer to the size of the digest in bytes.
timeout_ms – Specify timeout value in millisecond.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_TIMEOUT – A timeout has occurred.
HAL_ERROR – An error has occurred.
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:
Abort in polling mode with HAL_HASH_Abort().
Abort in IT and DMA mode with HAL_HASH_Abort_IT().
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.
- group HASH_Exported_Functions_Group6
-
This section provides functions allowing to:
Abort in polling mode with HAL_HASH_Abort().
Abort in IT and DMA mode with HAL_HASH_Abort_IT().
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.
- group HASH_Exported_Functions_Group6
-
This section provides functions allowing to:
Abort in polling mode with HAL_HASH_Abort().
Abort in IT and DMA mode with HAL_HASH_Abort_IT().
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, callbacks, and link DMA functions ¶
- group HASH_Exported_Functions_Group7
-
This section provides HASH IRQ handler and callback functions.
HAL_HASH_IRQHandler() : HASH interrupt request.
HAL_HASH_InputCpltCallback() : Input data transfer complete callback.
HAL_HASH_DigestCpltCallback() : Digest computation complete callback.
HAL_HASH_ErrorCallback() : HASH error callback.
HAL_HASH_SuspendCallback() : HASH suspend callback.
HAL_HASH_AbortCallback() : HASH abort callback.
The compilation define USE_HAL_HASH_REGISTER_CALLBACKS when set to 1 allows the user to register custom callbacks.
Use the function HAL_HASH_RegisterInputCpltCallback() to register a user input complete callback.
Use the function HAL_HASH_RegisterDigestComputationCpltCallback() to register a user digest computation complete callback.
Use the function HAL_HASH_RegisterErrorCpltCallback() to register a user error callback.
Use the function HAL_HASH_RegisterSuspendCpltCallback() to register a user suspend callback.
Use the function HAL_HASH_RegisterAbortCpltCallback() to register a user abort callback.
Use the function HAL_HASH_SetInDMA() to link the input FIFO HAL DMA handle into the HAL HASH handle.
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 in interrupt mode or through DMA mode.
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 in interrupt mode and is not relevant in DMA mode.
- 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 (overridden) 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 (overridden) 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 (overridden) 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 (overridden) 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 (overridden) 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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
hdma_in – Pointer to a hal_dma_handle_t.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_OK – Operation completed.
- group HASH_Exported_Functions_Group7
-
This section provides HASH IRQ handler and callback functions.
HAL_HASH_IRQHandler() : HASH interrupt request.
HAL_HASH_InputCpltCallback() : Input data transfer complete callback.
HAL_HASH_DigestCpltCallback() : Digest computation complete callback.
HAL_HASH_ErrorCallback() : HASH error callback.
HAL_HASH_SuspendCallback() : HASH suspend callback.
HAL_HASH_AbortCallback() : HASH abort callback.
The compilation define USE_HAL_HASH_REGISTER_CALLBACKS when set to 1 allows the user to register custom callbacks.
Use the function HAL_HASH_RegisterInputCpltCallback() to register a user input complete callback.
Use the function HAL_HASH_RegisterDigestComputationCpltCallback() to register a user digest computation complete callback.
Use the function HAL_HASH_RegisterErrorCpltCallback() to register a user error callback.
Use the function HAL_HASH_RegisterSuspendCpltCallback() to register a user suspend callback.
Use the function HAL_HASH_RegisterAbortCpltCallback() to register a user abort callback.
Use the function HAL_HASH_SetInDMA() to link the input FIFO HAL DMA handle into the HAL HASH handle.
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 in interrupt mode or through DMA mode.
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 in interrupt mode and is not relevant in DMA mode.
- 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 (overridden) 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 (overridden) 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 (overridden) 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 (overridden) 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 (overridden) 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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
hdma_in – Pointer to a hal_dma_handle_t.
- Return values :
-
HAL_INVALID_PARAM – Invalid parameter.
HAL_OK – Operation completed.
- group HASH_Exported_Functions_Group7
-
This section provides HASH IRQ handler and callback functions.
HAL_HASH_IRQHandler() : HASH interrupt request.
HAL_HASH_InputCpltCallback() : Input data transfer complete callback.
HAL_HASH_DigestCpltCallback() : Digest computation complete callback.
HAL_HASH_ErrorCallback() : HASH error callback.
HAL_HASH_SuspendCallback() : HASH suspend callback.
HAL_HASH_AbortCallback() : HASH abort callback.
The compilation define USE_HAL_HASH_REGISTER_CALLBACKS when set to 1 allows the user to register custom callbacks.
Use the function HAL_HASH_RegisterInputCpltCallback() to register a user input complete callback.
Use the function HAL_HASH_RegisterDigestComputationCpltCallback() to register a user digest computation complete callback.
Use the function HAL_HASH_RegisterErrorCpltCallback() to register a user error callback.
Use the function HAL_HASH_RegisterSuspendCpltCallback() to register a user suspend callback.
Use the function HAL_HASH_RegisterAbortCpltCallback() to register a user abort callback.
Use the function HAL_HASH_SetInDMA() to link the input FIFO HAL DMA handle into the HAL HASH handle.
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 in interrupt mode or through DMA mode.
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 in interrupt mode and is not relevant in DMA mode.
- 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 (overridden) 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 (overridden) 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 (overridden) 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 (overridden) 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 (overridden) 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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
hdma_in – Pointer to a hal_dma_handle_t.
- 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.
Use the function HAL_HASH_RequestSuspendComputation() to request an IT computation process suspension.
Use the function HAL_HASH_RequestSuspendUpdate() to request an IT update process suspension.
Use the function HAL_HASH_ResumeComputation() to resume the low-priority computation process.
Use the function HAL_HASH_ResumeUpdate() to resume the low-priority update process.
Use the function HAL_HASH_SaveContext() to save the context of the suspended process to start another high priority one.
Use the function HAL_HASH_RestoreContext() to restore the saved context of the low-priority process.
Note that these APIs are also valid for HMAC operations.
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_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_BUSY – Process is already ongoing.
HAL_ERROR – An error has occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has been occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_BUSY – Process is already ongoing.
HAL_ERROR – An error has been occurred.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_context – Pointer to a hal_hash_suspended_context_t structure where to store the parameters of the suspend HASH processing.
-
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_context – Pointer to a hal_hash_suspended_context_t structure where to store the parameters of the suspend HASH processing.
- group HASH_Exported_Functions_Group8
-
This section provides HASH suspend and resume functions.
Use the function HAL_HASH_RequestSuspendComputation() to request an IT computation process suspension.
Use the function HAL_HASH_RequestSuspendUpdate() to request an IT update process suspension.
Use the function HAL_HASH_ResumeComputation() to resume the low-priority computation process.
Use the function HAL_HASH_ResumeUpdate() to resume the low-priority update process.
Use the function HAL_HASH_SaveContext() to save the context of the suspended process to start another high priority one.
Use the function HAL_HASH_RestoreContext() to restore the saved context of the low-priority process.
Note that these APIs are also valid for HMAC operations.
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_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_BUSY – Process is already ongoing.
HAL_ERROR – An error has occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has been occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_BUSY – Process is already ongoing.
HAL_ERROR – An error has been occurred.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_context – Pointer to a hal_hash_suspended_context_t structure where to store the parameters of the suspend HASH processing.
-
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_context – Pointer to a hal_hash_suspended_context_t structure where to store the parameters of the suspend HASH processing.
- group HASH_Exported_Functions_Group8
-
This section provides HASH suspend and resume functions.
Use the function HAL_HASH_RequestSuspendComputation() to request an IT computation process suspension.
Use the function HAL_HASH_RequestSuspendUpdate() to request an IT update process suspension.
Use the function HAL_HASH_ResumeComputation() to resume the low-priority computation process.
Use the function HAL_HASH_ResumeUpdate() to resume the low-priority update process.
Use the function HAL_HASH_SaveContext() to save the context of the suspended process to start another high priority one.
Use the function HAL_HASH_RestoreContext() to restore the saved context of the low-priority process.
Note that these APIs are also valid for HMAC operations.
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_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_BUSY – Process is already ongoing.
HAL_ERROR – An error has occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_ERROR – An error has been occurred.
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_INVALID_PARAM – Invalid parameter.
HAL_BUSY – Process is already ongoing.
HAL_ERROR – An error has been occurred.
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_context – Pointer to a hal_hash_suspended_context_t structure where to store the parameters of the suspend HASH processing.
-
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 :
-
hhash – Pointer to a hal_hash_handle_t structure.
p_context – Pointer to a hal_hash_suspended_context_t structure where to store the parameters of the suspend HASH processing.
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:
Use the function HAL_HASH_GetState() to get the HASH global state.
Use the function HAL_HASH_GetLastErrorCodes() to get the last error codes.
Use the function HAL_HASH_SetUserData() to set the user data.
Use the function HAL_HASH_GetUserData() to get the user data.
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.
- group HASH_Exported_Functions_Group9
-
This subsection provides a set of functions to get the HASH error information and state:
Use the function HAL_HASH_GetState() to get the HASH global state.
Use the function HAL_HASH_GetLastErrorCodes() to get the last error codes.
Use the function HAL_HASH_SetUserData() to set the user data.
Use the function HAL_HASH_GetUserData() to get the user data.
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.
- group HASH_Exported_Functions_Group9
-
This subsection provides a set of functions to get the HASH error information and state:
Use the function HAL_HASH_GetState() to get the HASH global state.
Use the function HAL_HASH_GetLastErrorCodes() to get the last error codes.
Use the function HAL_HASH_SetUserData() to set the user data.
Use the function HAL_HASH_GetUserData() to get the user data.
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 static inline functions ¶
- group HASH_Exported_Functions_Group10
-
This section provides functions that allow you to manage HASH interrupts and flags:
Call the function HAL_HASH_IsActiveFlag() to check whether the specified HASH flag is set or not.
Call the function HAL_HASH_GetITSource() to check whether the specified HASH interrupt source is enabled or not.
Call the function HAL_HASH_EnableIT() to enable the HASH device interrupt.
Call the function HAL_HASH_DisableIT() to disable the device interrupt.
Call the function HAL_HASH_ClearFlag() to clear the specified HASH flag.
Functions
-
uint32_t
HAL_HASH_IsActiveFlag
(
const
hal_hash_handle_t
*
hhash
,
uint32_t
flag
)
¶
-
Check whether 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.
- Parameters :
-
hhash – Specifies the HASH handle.
interrupt – Source to check. This parameter must be a combination of HASH interrupts definitions.
- Return values :
-
uint32_t – State of the interrupt (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.
- group HASH_Exported_Functions_Group10
-
This section provides functions that allow you to manage HASH interrupts and flags:
Call the function HAL_HASH_IsActiveFlag() to check whether the specified HASH flag is set or not.
Call the function HAL_HASH_GetITSource() to check whether the specified HASH interrupt source is enabled or not.
Call the function HAL_HASH_EnableIT() to enable the HASH device interrupt.
Call the function HAL_HASH_DisableIT() to disable the device interrupt.
Call the function HAL_HASH_ClearFlag() to clear the specified HASH flag.
Functions
-
uint32_t
HAL_HASH_IsActiveFlag
(
const
hal_hash_handle_t
*
hhash
,
uint32_t
flag
)
-
Check whether 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.
- Parameters :
-
hhash – Specifies the HASH handle.
interrupt – Source to check. This parameter must be a combination of HASH interrupts definitions.
- Return values :
-
uint32_t – State of the interrupt (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.
- group HASH_Exported_Functions_Group10
-
This section provides functions that allow you to manage HASH interrupts and flags:
Call the function HAL_HASH_IsActiveFlag() to check whether the specified HASH flag is set or not.
Call the function HAL_HASH_GetITSource() to check whether the specified HASH interrupt source is enabled or not.
Call the function HAL_HASH_EnableIT() to enable the HASH device interrupt.
Call the function HAL_HASH_DisableIT() to disable the device interrupt.
Call the function HAL_HASH_ClearFlag() to clear the specified HASH flag.
Functions
-
uint32_t
HAL_HASH_IsActiveFlag
(
const
hal_hash_handle_t
*
hhash
,
uint32_t
flag
)
-
Check whether 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.
- Parameters :
-
hhash – Specifies the HASH handle.
interrupt – Source to check. This parameter must be a combination of HASH interrupts definitions.
- Return values :
-
uint32_t – State of the interrupt (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.