Classes | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_hmac.h File Reference

Header file containing functions prototypes of HMAC HAL library. More...

`#include "gr55xx_ll_hmac.h"`
`#include "gr55xx_hal_def.h"`
Include dependency graph for gr55xx_hal_hmac.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | _hmac_init
| HMAC init Structure definition. More...
struct | _hmac_handle
| HMAC handle Structure definition. More...
struct | _hal_hmac_callback
| HAL_HMAC Callback function definition. More...

## Macros
#define | HAL_HMAC_ERROR_NONE ((uint32_t)0x00000000)
| No error More...
#define | HAL_HMAC_ERROR_TIMEOUT ((uint32_t)0x00000001)
| Timeout error More...
#define | HAL_HMAC_ERROR_TRANSFER ((uint32_t)0x00000002)
| Transfer error More...
#define | HAL_HMAC_ERROR_INVALID_PARAM ((uint32_t)0x00000004)
| Invalid parameters error. More...
#define | HMAC_MODE_SHA LL_HMAC_CALCULATETYPE_SHA
| SHA mode More...
#define | HMAC_MODE_HMAC LL_HMAC_CALCULATETYPE_HMAC
| HMAC mode. More...
#define | HMAC_BLOCK_MAX (512)
| Block max size More...
#define | HMAC_BLOCKSIZE_BITS (512)
| Block size in bits More...
#define | HMAC_BLOCKSIZE_BYTES (HMAC_BLOCKSIZE_BITS >> 3)
| Block size in bytes More...
#define | HMAC_BLOCKSIZE_WORDS (HMAC_BLOCKSIZE_BYTES >> 2)
| Block size in words More...
#define | HMAC_DIGESTSIZE_BITS (256)
| Digest size in bits More...
#define | HMAC_DIGESTSIZE_BYTES (HMAC_DIGESTSIZE_BITS >> 3)
| Digest size in bytes More...
#define | HMAC_DIGESTSIZE_WORDS (HMAC_DIGESTSIZE_BYTES >> 2)
| Digest size in words More...
#define | HMAC_DMA_BLOCK_MAX (512)
| DMA Block max size More...
#define | HMAC_FLAG_DATAREADY_SHA LL_HMAC_FLAG_DATAREADY_SHA
| HMAC data ready (SHA mode) More...
#define | HMAC_FLAG_DATAREADY_HMAC LL_HMAC_FLAG_DATAREADY_HMAC
| HMAC data ready (HAMC mode) More...
#define | HMAC_FLAG_DMA_MESSAGEDONE LL_HMAC_FLAG_DMA_MESSAGEDONE
| HMAC DMA message done More...
#define | HMAC_FLAG_DMA_DONE LL_HMAC_FLAG_DMA_DONE
| HMAC DMA transfer done More...
#define | HMAC_FLAG_DMA_ERR LL_HMAC_FLAG_DMA_ERR
| HMAC DMA transfer error More...
#define | HMAC_FLAG_KEY_VALID LL_HMAC_FLAG_KEY_VALID
| HMAC has fetched key More...
#define | HAL_HMAC_KEYTYPE_MCU LL_HMAC_KEYTYPE_MCU
| Key from MCU More...
#define | HAL_HMAC_KEYTYPE_AHB LL_HMAC_KEYTYPE_AHB
| Key from AHB master. More...
#define | HAL_HMAC_KEYTYPE_KRAM LL_HMAC_KEYTYPE_KRAM
| Key from Key Port More...
#define | HMAC_IT_DONE ((uint32_t)0x00000001)
| Operation Done Interrupt source More...
#define | HAL_HMAC_TIMEOUT_DEFAULT_VALUE ((uint32_t)5000)
| 5s More...
#define | __HAL_HMAC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_HMAC_STATE_RESET)
| Reset HMAC handle states. More...
#define | __HAL_HMAC_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL, HMAC_CTRL_ENABLE)
| Enable the specified HMAC peripheral. More...
#define | __HAL_HMAC_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL, HMAC_CTRL_ENABLE)
| Disable the specified HMAC peripheral. More...
#define | __HAL_HMAC_ENABLE_IT(__HANDLE__) ll_hmac_enable_it_done((__HANDLE__)->p_instance)
| Enable the HMAC interrupt. More...
#define | __HAL_HMAC_DISABLE_IT(__HANDLE__) ll_hmac_disable_it_done((__HANDLE__)->p_instance)
| Disable the HMAC interrupt. More...
#define | __HAL_HMAC_GET_FLAG_IT(__HANDLE__, __FLAG__) (READ_BITS((__HANDLE__)->p_instance->INTERRUPT, (__FLAG__)) == (__FLAG__))
| Check whether the specified HMAC interrupt flag is set or not. More...
#define | __HAL_HMAC_CLEAR_FLAG_IT(__HANDLE__, __FLAG__) SET_BITS((__HANDLE__)->p_instance->INTERRUPT, (__FLAG__))
| Clear the specified HMAC interrupt flag. More...
#define | __HAL_HMAC_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STATUS, (__FLAG__)) != 0) ? SET : RESET)
| Check whether the specified HMAC flag is set or not. More...

## Typedefs
typedef struct _hmac_init | hmac_init_t
| HMAC init Structure definition. More...
typedef struct _hmac_handle | hmac_handle_t
| HMAC handle Structure definition. More...
typedef struct _hal_hmac_callback | hal_hmac_callback_t
| HAL_HMAC Callback function definition. More...

## Enumerations
enum | hal_hmac_state_t { HAL_HMAC_STATE_RESET = 0x00, HAL_HMAC_STATE_READY = 0x01, HAL_HMAC_STATE_BUSY = 0x02, HAL_HMAC_STATE_ERROR = 0x03, HAL_HMAC_STATE_TIMEOUT = 0x04, HAL_HMAC_STATE_SUSPENDED = 0x05 }
| HAL HMAC State enumerations definition. More...

## Functions
hal_status_t | hal_hmac_init (hmac_handle_t *p_hmac)
| Initialize the HMAC according to the specified parameters in the hmac_init_t and initialize the associated handle. More...
hal_status_t | hal_hmac_deinit (hmac_handle_t *p_hmac)
| De-initialize the HMAC peripheral. More...
void | hal_hmac_msp_init (hmac_handle_t *p_hmac)
| Initialize the HMAC MSP. More...
void | hal_hmac_msp_deinit (hmac_handle_t *p_hmac)
| De-initialize the HMAC MSP. More...
hal_status_t | hal_hmac_sha256_digest (hmac_handle_t *p_hmac, uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout)
| xxx in blocking mode in SHA/HMAC mode. More...
hal_status_t | hal_hmac_sha256_digest_it (hmac_handle_t *p_hmac, uint32_t *p_message, uint32_t number, uint32_t *p_digest)
| xxx in non-blocking mode with interrupt in SHA/HMAC mode. More...
hal_status_t | hal_hmac_sha256_digest_dma (hmac_handle_t *p_hmac, uint32_t *p_message, uint32_t number, uint32_t *p_digest)
| xxx in non-blocking mode with DMA in SHA/HMAC mode. More...
void | hal_hmac_irq_handler (hmac_handle_t *p_hmac)
| Handle HMAC interrupt request. More...
void | hal_hmac_done_callback (hmac_handle_t *p_hmac)
| Digest Done callback. More...
void | hal_hmac_error_callback (hmac_handle_t *p_hmac)
| HMAC error callback. More...
hal_hmac_state_t | hal_hmac_get_state (hmac_handle_t *p_hmac)
| Return the HMAC handle state. More...
uint32_t | hal_hmac_get_error (hmac_handle_t *p_hmac)
| Return the HMAC error code. More...
void | hal_hmac_set_timeout (hmac_handle_t *p_hmac, uint32_t timeout)
| Set the HMAC internal process timeout value. More...
hal_status_t | hal_hmac_suspend_reg (hmac_handle_t *p_hmac)
| Suspend some registers related to HMAC configuration before sleep. More...
hal_status_t | hal_hmac_resume_reg (hmac_handle_t *p_hmac)
| Restore some registers related to HMAC configuration after sleep. More...

## Detailed Description

Header file containing functions prototypes of HMAC HAL library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_hal_hmac.h.