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

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

`#include "ll_hmac.h"`
`#include "ll_misc.h"`
`#include "hal_def.h"`

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)
#define | HAL_HMAC_ERROR_BUSY ((uint32_t)0x00000001)
#define | HAL_HMAC_ERROR_TIMEOUT ((uint32_t)0x00000002)
#define | HAL_HMAC_ERROR_TRANSFER ((uint32_t)0x00000004)
#define | HAL_HMAC_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
#define | HMAC_MODE_SHA LL_HMAC_CALCULATETYPE_SHA
#define | HMAC_MODE_HMAC LL_HMAC_CALCULATETYPE_HMAC
#define | HAL_HMAC_KEYTYPE_MCU LL_HMAC_KEYTYPE_MCU
#define | HAL_HMAC_KEYTYPE_AHB LL_HMAC_KEYTYPE_AHB
#define | HAL_HMAC_KEYTYPE_KRAM LL_HMAC_KEYTYPE_KRAM
#define | HAL_HMAC_DPA_MODE_ENABLE (1U)
#define | HAL_HMAC_DPA_MODE_DISABLE (0U)
#define | HMAC_BLOCKSIZE_BITS (512U)
#define | HMAC_BLOCKSIZE_BYTES (HMAC_BLOCKSIZE_BITS >> 3)
#define | HMAC_BLOCKSIZE_WORDS (HMAC_BLOCKSIZE_BYTES >> 2)
#define | HMAC_DIGESTSIZE_BITS (256U)
#define | HMAC_DIGESTSIZE_BYTES (HMAC_DIGESTSIZE_BITS >> 3)
#define | HMAC_DIGESTSIZE_WORDS (HMAC_DIGESTSIZE_BYTES >> 2)
#define | HMAC_DMA_BLOCK_MAX (512U)
#define | HMAC_FLAG_DATAREADY_SHA LL_HMAC_FLAG_DATAREADY_SHA
#define | HMAC_FLAG_DATAREADY_HMAC LL_HMAC_FLAG_DATAREADY_HMAC
#define | HMAC_FLAG_DMA_MESSAGEDONE LL_HMAC_FLAG_DMA_MESSAGEDONE
#define | HMAC_FLAG_DMA_DONE LL_HMAC_FLAG_DMA_DONE
#define | HMAC_FLAG_DMA_ERR LL_HMAC_FLAG_DMA_ERR
#define | HMAC_FLAG_KEY_VALID LL_HMAC_FLAG_KEY_VALID
#define | HMAC_IT_DONE ((uint32_t)0x00000001)
#define | HAL_HMAC_TIMEOUT_DEFAULT_VALUE ((uint32_t)5000)
#define | __HAL_HMAC_DMA_START_LAST_TRF(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL, (HMAC_CTRL_LST_TX | HMAC_CTRL_DMA_START))
| Start DMA Last block transfer. More...
#define | __HAL_HMAC_CLEAR_FLAG_IT(__HANDLE__, __FLAG__) SET_BITS((__HANDLE__)->p_instance->INT, (__FLAG__))
| Clear the specified HMAC interrupt flag. More...
#define | __HAL_HMAC_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->STAT, (__FLAG__)) != 0U) ? 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 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 HMAC/SHA 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 HMAC/SHA 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 HMAC/SHA 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...

## 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 hal_hmac.h.