app_hmac.h
Go to the documentation of this file.
1
52 #ifndef _APP_HMAC_H_
53 #define _APP_HMAC_H_
54
55 #include "gr55xx_hal.h"
56 #include "app_drv_error.h"
57 #ifdef ENV_USE_FREERTOS
58 #include "app_rtos_cfg.h"
59 #endif
60
61
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65
66 #ifdef HAL_HMAC_MODULE_ENABLED
67
75 typedef enum
76 {
77 APP_HMAC_TYPE_INTERRUPT,
78 APP_HMAC_TYPE_POLLING,
79 APP_HMAC_TYPE_DMA,
80 APP_HMAC_TYPE_MAX
81 } app_hmac_type_t;
82
86 typedef enum
87 {
88 APP_HMAC_EVT_ERROR,
89 APP_HMAC_EVT_DONE
90 } app_hmac_evt_type_t;
99 typedef struct
100 {
101 app_hmac_type_t use_type;
102 hmac_init_t init;
103 } app_hmac_params_t;
104
108 typedef struct
109 {
110 app_hmac_evt_type_t type;
111 uint32_t error_code;
112 } app_hmac_evt_t;
113
117 typedef void (*app_hmac_evt_handler_t)(app_hmac_evt_t *p_evt);
118
121 /* Exported functions --------------------------------------------------------*/
139 uint16_t app_hmac_init(app_hmac_params_t *p_params, app_hmac_evt_handler_t evt_handler);
140
148 uint16_t app_hmac_deinit(void);
149
159 uint16_t app_hmac_user_hash(uint32_t *p_user_hash);
160
173 uint16_t app_sha256_sync(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout);
174
187 uint16_t app_sha256_async(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout);
188
201 uint16_t app_hmac_sha256_sync(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout);
202
215 uint16_t app_hmac_sha256_async(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout);
216
224 hmac_handle_t *app_hmac_get_handle(void);
225
226 #ifdef ENV_RTOS_USE_SEMP
227
239 uint16_t app_sha256_sem_sync(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout);
240 #endif
241
244 #endif
245
246 #ifdef __cplusplus
247 }
248 #endif
249
250 #endif
251
app_hmac_evt_type_t
app_hmac_evt_type_t
HMAC event Enumerations definition.
Definition: app_hmac.h:87
app_hmac_init
uint16_t app_hmac_init(app_hmac_params_t *p_params, app_hmac_evt_handler_t evt_handler)
Initialize the APP HMAC DRIVER according to the specified parameters in the app_hmac_params_t and app...
app_hmac_evt_t
HMAC event structure definition.
Definition: app_hmac.h:109
_hmac_init
HMAC init Structure definition.
Definition: gr55xx_hal_hmac.h:103
app_sha256_sync
uint16_t app_sha256_sync(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout)
xxx in blocking mode in SHA256 mode.
APP_HMAC_TYPE_DMA
@ APP_HMAC_TYPE_DMA
Definition: app_hmac.h:79
app_hmac_sha256_async
uint16_t app_hmac_sha256_async(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout)
xxx in non-blocking mode in HMAC mode.
app_hmac_params_t::init
hmac_init_t init
Definition: app_hmac.h:102
app_hmac_evt_t::type
app_hmac_evt_type_t type
Definition: app_hmac.h:110
APP_HMAC_TYPE_POLLING
@ APP_HMAC_TYPE_POLLING
Definition: app_hmac.h:78
app_hmac_user_hash
uint16_t app_hmac_user_hash(uint32_t *p_user_hash)
Update p_user_hash parameters.
app_hmac_deinit
uint16_t app_hmac_deinit(void)
De-initialize the APP HMAC DRIVER peripheral.
app_hmac_sha256_sync
uint16_t app_hmac_sha256_sync(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout)
xxx in blocking mode in HMAC mode.
APP_HMAC_EVT_ERROR
@ APP_HMAC_EVT_ERROR
Definition: app_hmac.h:88
APP_HMAC_TYPE_INTERRUPT
@ APP_HMAC_TYPE_INTERRUPT
Definition: app_hmac.h:77
APP_HMAC_TYPE_MAX
@ APP_HMAC_TYPE_MAX
Definition: app_hmac.h:80
app_hmac_get_handle
hmac_handle_t * app_hmac_get_handle(void)
Return the hmac handle.
_hmac_handle
HMAC handle Structure definition.
Definition: gr55xx_hal_hmac.h:130
app_hmac_params_t::use_type
app_hmac_type_t use_type
Definition: app_hmac.h:101
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_hmac_type_t
app_hmac_type_t
HMAC operating mode Enumerations definition.
Definition: app_hmac.h:76
app_hmac_evt_t::error_code
uint32_t error_code
Definition: app_hmac.h:111
APP_HMAC_EVT_DONE
@ APP_HMAC_EVT_DONE
Definition: app_hmac.h:89
app_hmac_params_t
HMAC parameters structure definition.
Definition: app_hmac.h:100
app_sha256_async
uint16_t app_sha256_async(uint32_t *p_message, uint32_t number, uint32_t *p_digest, uint32_t timeout)
xxx in non-blocking mode with interrupt in SHA256 mode.
app_rtos_cfg.h
Header file of app rtos config code.
app_drv_error.h
Header file of app driver error code.
app_hmac_evt_handler_t
void(* app_hmac_evt_handler_t)(app_hmac_evt_t *p_evt)
HMAC event callback definition.
Definition: app_hmac.h:117