Classes | Macros | Typedefs | Functions
gr55xx_ll_hmac.h File Reference

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

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

Go to the source code of this file.

## Classes
struct | _ll_hmac_init_t
| LL HMAC Init Structure definition. More...

## Macros
#define | LL_HMAC_FLAG_DATAREADY_SHA HMAC_STAT_HASH_READY
| HMAC data ready(SHA mode) More...
#define | LL_HMAC_FLAG_DATAREADY_HMAC HMAC_STAT_HMAC_READY
| HMAC data ready(HAMC mode) More...
#define | LL_HMAC_FLAG_DMA_MESSAGEDONE HMAC_STAT_DMA_MSG_DONE
| HMAC dma message done More...
#define | LL_HMAC_FLAG_DMA_DONE HMAC_STAT_DMA_TX_DONE
| HMAC dma transfer done More...
#define | LL_HMAC_FLAG_DMA_ERR HMAC_STAT_DMA_TX_ERR
| HMAC dma transfer error More...
#define | LL_HMAC_FLAG_KEY_VALID HMAC_STAT_KEY_VALID
| HMAC has fetched key More...
#define | LL_HMAC_HASH_STANDARD 0x00000000U
| Standard Mode. More...
#define | LL_HMAC_HASH_USER (1UL << HMAC_CFG_HASH_POS)
| User Mode More...
#define | LL_HMAC_CALCULATETYPE_HMAC 0x00000000U
| HMAC mode. More...
#define | LL_HMAC_CALCULATETYPE_SHA (1UL << HMAC_CFG_CALC_TYPE_POS)
| SHA moe More...
#define | LL_HMAC_KEYTYPE_MCU 0x00000000U
| MCU More...
#define | LL_HMAC_KEYTYPE_AHB (1UL << HMAC_CFG_KEY_TYPE_POS)
| AHB master. More...
#define | LL_HMAC_KEYTYPE_KRAM (2UL << HMAC_CFG_KEY_TYPE_POS)
| Key Port More...
#define | LL_HMAC_DMA_TRANSIZE_MIN (1)
| Min size = 1 block More...
#define | LL_HMAC_DMA_TRANSIZE_MAX (512)
| Min size = 512 blocks More...
#define | LL_HMAC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
| Write a value in HMAC register. More...
#define | LL_HMAC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
| Read a value in HMAC register. More...

## Typedefs
typedef struct _ll_hmac_init_t | ll_hmac_init_t
| LL HMAC Init Structure definition. More...

## Functions
__STATIC_INLINE void | ll_hmac_enable (hmac_regs_t *HMACx)
| Enable HMAC. More...
__STATIC_INLINE void | ll_hmac_disable (hmac_regs_t *HMACx)
| Disable HMAC. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled (hmac_regs_t *HMACx)
| Indicate whether the HMAC is enabled. More...
__STATIC_INLINE void | ll_hmac_enable_dma_start (hmac_regs_t *HMACx)
| Enable HMAC DMA mode. More...
__STATIC_INLINE void | ll_hmac_disable_dma_start (hmac_regs_t *HMACx)
| Disable HMAC DMA mode. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled_dma_start (hmac_regs_t *HMACx)
| Indicate whether the HMAC DMA mode is enabled. More...
__STATIC_INLINE void | ll_hmac_enable_read_key (hmac_regs_t *HMACx)
| Enable fetch key through AHB/key port. More...
__STATIC_INLINE void | ll_hmac_enable_last_transfer (hmac_regs_t *HMACx)
| Enable last block transfer in MCU/DMA mode. More...
__STATIC_INLINE void | ll_hmac_enable_user_hash (hmac_regs_t *HMACx)
| Enable user HASH. More...
__STATIC_INLINE void | ll_hmac_disable_user_hash (hmac_regs_t *HMACx)
| Disable user HASH. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled_user_hash (hmac_regs_t *HMACx)
| Indicate whether the user HASH is enabled. More...
__STATIC_INLINE void | ll_hmac_enable_little_endian (hmac_regs_t *HMACx)
| Enable HMAC in little endian. More...
__STATIC_INLINE void | ll_hmac_disable_little_endian (hmac_regs_t *HMACx)
| Disable HMAC in little endian. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled_little_endian (hmac_regs_t *HMACx)
| Indicate whether the HMAC is in little endian. More...
__STATIC_INLINE void | ll_hmac_set_key_type (hmac_regs_t *HMACx, uint32_t type)
| Set ways to obtain HMAC key. More...
__STATIC_INLINE uint32_t | ll_hmac_get_key_type (hmac_regs_t *HMACx)
| Get ways to obtain HMAC key. More...
__STATIC_INLINE void | ll_hmac_enable_sha (hmac_regs_t *HMACx)
| Enable SHA mode. More...
__STATIC_INLINE void | ll_hmac_disable_sha (hmac_regs_t *HMACx)
| Disable SHA mode. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled_sha (hmac_regs_t *HMACx)
| Indicate whether the SHA mode is enabled. More...
__STATIC_INLINE void | ll_hmac_enable_private (hmac_regs_t *HMACx)
| Enable private mode. More...
__STATIC_INLINE void | ll_hmac_disable_private (hmac_regs_t *HMACx)
| Disable private mode. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled_private (hmac_regs_t *HMACx)
| Indicate whether the private mode is enabled. More...
__STATIC_INLINE void | ll_hmac_enable_it_done (hmac_regs_t *HMACx)
| Enable the done interrupt for HMAC. More...
__STATIC_INLINE void | ll_hmac_disable_it_done (hmac_regs_t *HMACx)
| Disable the done interrupt for HMAC. More...
__STATIC_INLINE uint32_t | ll_hmac_is_enabled_it_done (hmac_regs_t *HMACx)
| Indicate whether Done Interrupt is enabled. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_sha_ready (hmac_regs_t *HMACx)
| Indicate whether SHA Ready flag is set. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_hmac_ready (hmac_regs_t *HMACx)
| Indicate whether HMAC Ready flag is set. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_dma_message_done (hmac_regs_t *HMACx)
| Indicate whether DMA Transmit Message Done flag is set. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_dma_done (hmac_regs_t *HMACx)
| Indicate whether DMA Transfer Done flag is set. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_dma_error (hmac_regs_t *HMACx)
| Indicate whether DMA Transfer Error flag is set. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_key_valid (hmac_regs_t *HMACx)
| Indicate whether Key Valid flag is set. More...
__STATIC_INLINE uint32_t | ll_hmac_is_action_flag_it_done (hmac_regs_t *HMACx)
| Indicate whether Done interrupt flag is set. More...
__STATIC_INLINE void | ll_hmac_clear_flag_it_done (hmac_regs_t *HMACx)
| Clear Done interrupt flag. More...
__STATIC_INLINE void | ll_hmac_set_dma_transfer_block (hmac_regs_t *HMACx, uint32_t block)
| Set HMAC transfer blocks in DMA mode. More...
__STATIC_INLINE uint32_t | ll_hmac_get_dma_transfer_block (hmac_regs_t *HMACx)
| Get HMAC transfer blocks in DMA mode. More...
__STATIC_INLINE void | ll_hmac_set_dma_read_address (hmac_regs_t *HMACx, uint32_t address)
| Set HMAC read address of RAM in DMA mode. More...
__STATIC_INLINE uint32_t | ll_hmac_get_dma_read_address (hmac_regs_t *HMACx)
| Get HMAC read address of RAM in DMA mode. More...
__STATIC_INLINE void | ll_hmac_set_dma_write_address (hmac_regs_t *HMACx, uint32_t address)
| Set HMAC write address of RAM in DMA mode. More...
__STATIC_INLINE uint32_t | ll_hmac_get_dma_write_address (hmac_regs_t *HMACx)
| Get HMAC write address of RAM in DMA mode. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_255_224 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[255:224]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_223_192 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[223:192]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_191_160 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[191:160]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_159_128 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[159:128]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_127_96 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[127:96]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_95_64 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[95:64]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_63_32 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[63:32]. More...
__STATIC_INLINE void | ll_hmac_set_user_hash_31_0 (hmac_regs_t *HMACx, uint32_t hash)
| Set user HASH[31:0]. More...
__STATIC_INLINE uint32_t | ll_hmac_get_data (hmac_regs_t *HMACx)
| Get abstract from HMAC. More...
__STATIC_INLINE void | ll_hmac_set_data (hmac_regs_t *HMACx, uint32_t data)
| Send data to calculate. More...
__STATIC_INLINE void | ll_hmac_set_key0 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key0. More...
__STATIC_INLINE void | ll_hmac_set_key1 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key1. More...
__STATIC_INLINE void | ll_hmac_set_key2 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key2. More...
__STATIC_INLINE void | ll_hmac_set_key3 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key3. More...
__STATIC_INLINE void | ll_hmac_set_key4 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key4. More...
__STATIC_INLINE void | ll_hmac_set_key5 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key5. More...
__STATIC_INLINE void | ll_hmac_set_key6 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key6. More...
__STATIC_INLINE void | ll_hmac_set_key7 (hmac_regs_t *HMACx, uint32_t key)
| Set HMAC key7. More...
__STATIC_INLINE void | ll_hmac_set_key_address (hmac_regs_t *HMACx, uint32_t address)
| Set HMAC key address in memory. More...
__STATIC_INLINE uint32_t | ll_hmac_get_key_address (hmac_regs_t *HMACx)
| Get HMAC key address in memory. More...
__STATIC_INLINE void | ll_hmac_set_key_port_mask (hmac_regs_t *HMACx, uint32_t mask)
| Set HMAC fetch key port mask. More...
error_status_t | ll_hmac_deinit (hmac_regs_t *HMACx)
| De-initialize HMAC registers (Registers restored to their default values). More...
error_status_t | ll_hmac_init (hmac_regs_t *HMACx, ll_hmac_init_t *p_hmac_init)
| Initialize HMAC registers according to the specified parameters in p_hmac_init. More...
void | ll_hmac_struct_init (ll_hmac_init_t *p_hmac_init)
| Set each field of a ll_hmac_init_t type structure to default value. More...

## Detailed Description

Header file containing functions prototypes of HMAC LL 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_ll_hmac.h.