STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
stm32f4xx_hal_hash.h
Go to the documentation of this file.
1
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32F4xx_HAL_HASH_H
21#define STM32F4xx_HAL_HASH_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32f4xx_hal_def.h"
29
33#if defined (HASH)
38/* Exported types ------------------------------------------------------------*/
46typedef struct
47{
48 uint32_t DataType;
51 uint32_t KeySize;
53 uint8_t *pKey;
56
69
84
93
94#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1U)
98typedef enum
99{
100 HAL_HASH_MSPINIT_CB_ID = 0x00U,
101 HAL_HASH_MSPDEINIT_CB_ID = 0x01U,
102 HAL_HASH_INPUTCPLT_CB_ID = 0x02U,
103 HAL_HASH_DGSTCPLT_CB_ID = 0x03U,
104 HAL_HASH_ERROR_CB_ID = 0x04U,
105} HAL_HASH_CallbackIDTypeDef;
106#endif /* USE_HAL_HASH_REGISTER_CALLBACKS */
107
108
112#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1)
113typedef struct __HASH_HandleTypeDef
114#else
115typedef struct
116#endif /* (USE_HAL_HASH_REGISTER_CALLBACKS) */
117{
120 uint8_t *pHashInBuffPtr;
128 uint32_t HashBuffSize;
130 __IO uint32_t HashInCount;
132 __IO uint32_t HashITCounter;
134 __IO uint32_t HashKeyCount;
150 __IO uint32_t NbWordsAlreadyPushed;
152 __IO uint32_t ErrorCode;
154 __IO uint32_t Accumulation;
156#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1)
157 void (* InCpltCallback)(struct __HASH_HandleTypeDef *hhash);
159 void (* DgstCpltCallback)(struct __HASH_HandleTypeDef *hhash);
161 void (* ErrorCallback)(struct __HASH_HandleTypeDef *hhash);
163 void (* MspInitCallback)(struct __HASH_HandleTypeDef *hhash);
165 void (* MspDeInitCallback)(struct __HASH_HandleTypeDef *hhash);
167#endif /* (USE_HAL_HASH_REGISTER_CALLBACKS) */
169
170#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1U)
174typedef void (*pHASH_CallbackTypeDef)(HASH_HandleTypeDef *hhash);
175#endif /* USE_HAL_HASH_REGISTER_CALLBACKS */
176
181/* Exported constants --------------------------------------------------------*/
182
190#define HASH_ALGOSELECTION_SHA1 0x00000000U
191#define HASH_ALGOSELECTION_MD5 HASH_CR_ALGO_0
192#define HASH_ALGOSELECTION_SHA224 HASH_CR_ALGO_1
193#define HASH_ALGOSELECTION_SHA256 HASH_CR_ALGO
201#define HASH_ALGOMODE_HASH 0x00000000U
202#define HASH_ALGOMODE_HMAC HASH_CR_MODE
210#define HASH_DATATYPE_32B 0x00000000U
211#define HASH_DATATYPE_16B HASH_CR_DATATYPE_0
212#define HASH_DATATYPE_8B HASH_CR_DATATYPE_1
213#define HASH_DATATYPE_1B HASH_CR_DATATYPE
221#define HASH_HMAC_KEYTYPE_SHORTKEY 0x00000000U
222#define HASH_HMAC_KEYTYPE_LONGKEY HASH_CR_LKEY
230#define HASH_FLAG_DINIS HASH_SR_DINIS
231#define HASH_FLAG_DCIS HASH_SR_DCIS
232#define HASH_FLAG_DMAS HASH_SR_DMAS
233#define HASH_FLAG_BUSY HASH_SR_BUSY
234#define HASH_FLAG_DINNE HASH_CR_DINNE
243#define HASH_IT_DINI HASH_IMR_DINIE
244#define HASH_IT_DCI HASH_IMR_DCIE
253#define HAL_HASH_ERROR_NONE 0x00000000U
254#define HAL_HASH_ERROR_IT 0x00000001U
255#define HAL_HASH_ERROR_DMA 0x00000002U
256#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1U)
257#define HAL_HASH_ERROR_INVALID_CALLBACK 0x00000004U
258#endif /* USE_HAL_HASH_REGISTER_CALLBACKS */
267/* Exported macros -----------------------------------------------------------*/
282#define __HAL_HASH_GET_FLAG(__FLAG__) (((__FLAG__) > 8U) ? \
283 ((HASH->CR & (__FLAG__)) == (__FLAG__)) :\
284 ((HASH->SR & (__FLAG__)) == (__FLAG__)) )
285
286
294#define __HAL_HASH_CLEAR_FLAG(__FLAG__) CLEAR_BIT(HASH->SR, (__FLAG__))
295
296
304#define __HAL_HASH_ENABLE_IT(__INTERRUPT__) SET_BIT(HASH->IMR, (__INTERRUPT__))
305
313#define __HAL_HASH_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(HASH->IMR, (__INTERRUPT__))
314
320#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1)
321#define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) do{\
322 (__HANDLE__)->State = HAL_HASH_STATE_RESET;\
323 (__HANDLE__)->MspInitCallback = NULL; \
324 (__HANDLE__)->MspDeInitCallback = NULL; \
325 }while(0)
326#else
327#define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HASH_STATE_RESET)
328#endif /* USE_HAL_HASH_REGISTER_CALLBACKS */
329
330
335#define __HAL_HASH_RESET_HANDLE_STATUS(__HANDLE__) ((__HANDLE__)->Status = HAL_OK)
336
342#define __HAL_HASH_SET_MDMAT() SET_BIT(HASH->CR, HASH_CR_MDMAT)
343
348#define __HAL_HASH_RESET_MDMAT() CLEAR_BIT(HASH->CR, HASH_CR_MDMAT)
349
350
355#define __HAL_HASH_START_DIGEST() SET_BIT(HASH->STR, HASH_STR_DCAL)
356
362#define __HAL_HASH_SET_NBVALIDBITS(__SIZE__) MODIFY_REG(HASH->STR, HASH_STR_NBLW, 8U * ((__SIZE__) % 4U))
363
368#define __HAL_HASH_INIT() SET_BIT(HASH->CR, HASH_CR_INIT)
369
375/* Private macros --------------------------------------------------------*/
383#if defined(HASH_CR_MDMAT)
384#define HASH_DIGEST_LENGTH() ((READ_BIT(HASH->CR, HASH_CR_ALGO) == HASH_ALGOSELECTION_SHA1) ? 20U : \
385 ((READ_BIT(HASH->CR, HASH_CR_ALGO) == HASH_ALGOSELECTION_SHA224) ? 28U : \
386 ((READ_BIT(HASH->CR, HASH_CR_ALGO) == HASH_ALGOSELECTION_SHA256) ? 32U : 16U ) ) )
387#else
388#define HASH_DIGEST_LENGTH() ((READ_BIT(HASH->CR, HASH_CR_ALGO) == HASH_ALGOSELECTION_SHA1) ? 20U : 16)
389#endif /* HASH_CR_MDMAT*/
394#define HASH_NBW_PUSHED() ((READ_BIT(HASH->CR, HASH_CR_NBW)) >> 8U)
395
401#define IS_HASH_DATATYPE(__DATATYPE__) (((__DATATYPE__) == HASH_DATATYPE_32B)|| \
402 ((__DATATYPE__) == HASH_DATATYPE_16B)|| \
403 ((__DATATYPE__) == HASH_DATATYPE_8B) || \
404 ((__DATATYPE__) == HASH_DATATYPE_1B))
405
413#define IS_HASH_DMA_MULTIBUFFER_SIZE(__SIZE__) ((READ_BIT(HASH->CR, HASH_CR_MDMAT) == 0U) || (((__SIZE__) % 4U) == 0U))
414
423#define IS_HMAC_DMA_MULTIBUFFER_SIZE(__HANDLE__,__SIZE__) ((((__HANDLE__)->DigestCalculationDisable) == RESET)\
424 || (((__SIZE__) % 4U) == 0U))
430#define IS_HASH_PROCESSING(__HANDLE__) ((__HANDLE__)->Phase == HAL_HASH_PHASE_PROCESS)
431
437#define IS_HMAC_PROCESSING(__HANDLE__) (((__HANDLE__)->Phase == HAL_HASH_PHASE_HMAC_STEP_1) || \
438 ((__HANDLE__)->Phase == HAL_HASH_PHASE_HMAC_STEP_2) || \
439 ((__HANDLE__)->Phase == HAL_HASH_PHASE_HMAC_STEP_3))
440
445/* Include HASH HAL Extended module */
447/* Exported functions --------------------------------------------------------*/
448
457/* Initialization/de-initialization methods **********************************/
465/* Callbacks Register/UnRegister functions ***********************************/
466#if (USE_HAL_HASH_REGISTER_CALLBACKS == 1)
467HAL_StatusTypeDef HAL_HASH_RegisterCallback(HASH_HandleTypeDef *hhash, HAL_HASH_CallbackIDTypeDef CallbackID,
468 pHASH_CallbackTypeDef pCallback);
469HAL_StatusTypeDef HAL_HASH_UnRegisterCallback(HASH_HandleTypeDef *hhash, HAL_HASH_CallbackIDTypeDef CallbackID);
470#endif /* USE_HAL_HASH_REGISTER_CALLBACKS */
471
472
482/* HASH processing using polling *********************************************/
483HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
484 uint32_t Timeout);
485HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
486 uint32_t Timeout);
487HAL_StatusTypeDef HAL_HASH_MD5_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
488HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
489HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
490 uint8_t *pOutBuffer, uint32_t Timeout);
491HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
492 uint8_t *pOutBuffer, uint32_t Timeout);
493
494
503/* HASH processing using IT **************************************************/
504HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
505 uint8_t *pOutBuffer);
506HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
507HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
508 uint8_t *pOutBuffer);
509HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
510 uint8_t *pOutBuffer);
511HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
512HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
513 uint8_t *pOutBuffer);
523/* HASH processing using DMA *************************************************/
524HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
525HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout);
526HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
527HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout);
528
537/* HASH-MAC processing using polling *****************************************/
538HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
539 uint32_t Timeout);
540HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
541 uint32_t Timeout);
542
551HAL_StatusTypeDef HAL_HMAC_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
552 uint8_t *pOutBuffer);
553HAL_StatusTypeDef HAL_HMAC_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
554 uint8_t *pOutBuffer);
555
564/* HASH-HMAC processing using DMA ********************************************/
565HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
566HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
567
577/* Peripheral State methods **************************************************/
580void HAL_HASH_ContextSaving(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer);
581void HAL_HASH_ContextRestoring(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer);
585
594/* Private functions -----------------------------------------------------------*/
595
600/* Private functions */
601HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
602 uint32_t Timeout, uint32_t Algorithm);
603HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm);
604HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm);
605HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
606 uint32_t Algorithm);
607HAL_StatusTypeDef HASH_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm);
608HAL_StatusTypeDef HASH_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout);
609HAL_StatusTypeDef HMAC_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
610 uint32_t Timeout, uint32_t Algorithm);
611HAL_StatusTypeDef HMAC_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
612 uint32_t Algorithm);
613HAL_StatusTypeDef HMAC_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm);
614
622#endif /* HASH*/
628#ifdef __cplusplus
629}
630#endif
631
632
633#endif /* STM32F4xx_HAL_HASH_H */
634
void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash)
DeInitialize the HASH MSP.
void HAL_HASH_DgstCpltCallback(HASH_HandleTypeDef *hhash)
Digest computation complete call back.
HAL_StatusTypeDef HAL_HASH_DeInit(HASH_HandleTypeDef *hhash)
DeInitialize the HASH peripheral.
void HAL_HASH_InCpltCallback(HASH_HandleTypeDef *hhash)
Input data transfer complete call back.
HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash)
Initialize the HASH according to the specified parameters in the HASH_HandleTypeDef and create the as...
void HAL_HASH_MspInit(HASH_HandleTypeDef *hhash)
Initialize the HASH MSP.
void HAL_HASH_ErrorCallback(HASH_HandleTypeDef *hhash)
Error callback.
HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
Initialize the HASH peripheral in MD5 mode, next process pInBuffer then read the computed digest.
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
End computation of a single HASH signature after several calls to HAL_HASH_MD5_Accmlt() API.
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
If not already done, initialize the HASH peripheral in MD5 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
End computation of a single HASH signature after several calls to HAL_HASH_SHA1_Accmlt() API.
HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
Initialize the HASH peripheral in SHA1 mode, next process pInBuffer then read the computed digest.
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
If not already done, initialize the HASH peripheral in SHA1 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
Initialize the HASH peripheral in SHA1 mode, next process pInBuffer then read the computed digest in ...
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
End computation of a single HASH signature after several calls to HAL_HASH_MD5_Accmlt_IT() API.
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
If not already done, initialize the HASH peripheral in MD5 mode then processes pInBuffer in interrupt...
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
End computation of a single HASH signature after several calls to HAL_HASH_SHA1_Accmlt_IT() API.
HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
Initialize the HASH peripheral in MD5 mode, next process pInBuffer then read the computed digest in i...
void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash)
Handle HASH interrupt request.
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
If not already done, initialize the HASH peripheral in SHA1 mode then processes pInBuffer in interrup...
HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
Return the computed digest in MD5 mode.
HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
Initialize the HASH peripheral in MD5 mode then initiate a DMA transfer to feed the input buffer to t...
HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
Initialize the HASH peripheral in SHA1 mode then initiate a DMA transfer to feed the input buffer to ...
HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
Return the computed digest in SHA1 mode.
HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
Initialize the HASH peripheral in HMAC MD5 mode, next process pInBuffer then read the computed digest...
HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
Initialize the HASH peripheral in HMAC SHA1 mode, next process pInBuffer then read the computed diges...
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
Initialize the HASH peripheral in HMAC SHA1 mode, next process pInBuffer then read the computed diges...
HAL_StatusTypeDef HAL_HMAC_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
Initialize the HASH peripheral in HMAC MD5 mode, next process pInBuffer then read the computed digest...
HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
Initialize the HASH peripheral in HMAC MD5 mode then initiate the required DMA transfers to feed the ...
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
Initialize the HASH peripheral in HMAC SHA1 mode then initiate the required DMA transfers to feed the...
void HAL_HASH_ContextSaving(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
Save the HASH context in case of processing suspension.
HAL_HASH_StateTypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash)
Return the HASH handle state.
HAL_StatusTypeDef HAL_HASH_GetStatus(HASH_HandleTypeDef *hhash)
Return the HASH HAL status.
uint32_t HAL_HASH_GetError(HASH_HandleTypeDef *hhash)
Return the HASH handle error code.
void HAL_HASH_ContextRestoring(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
Restore the HASH context in case of processing resumption.
void HAL_HASH_SwFeed_ProcessSuspend(HASH_HandleTypeDef *hhash)
Initiate HASH processing suspension when in polling or interruption mode.
HAL_StatusTypeDef HAL_HASH_DMAFeed_ProcessSuspend(HASH_HandleTypeDef *hhash)
Suspend the HASH processing when in DMA mode.
HAL_HASH_PhaseTypeDef
HAL phase structures definition.
HAL_HASH_SuspendTypeDef
HAL HASH mode suspend definitions.
HAL_HASH_StateTypeDef
HAL State structures definition.
@ HAL_HASH_PHASE_HMAC_STEP_1
@ HAL_HASH_PHASE_HMAC_STEP_3
@ HAL_HASH_PHASE_READY
@ HAL_HASH_PHASE_PROCESS
@ HAL_HASH_PHASE_HMAC_STEP_2
@ HAL_HASH_SUSPEND
@ HAL_HASH_SUSPEND_NONE
@ HAL_HASH_STATE_BUSY
@ HAL_HASH_STATE_SUSPENDED
@ HAL_HASH_STATE_READY
@ HAL_HASH_STATE_ERROR
@ HAL_HASH_STATE_TIMEOUT
@ HAL_HASH_STATE_RESET
HAL_StatusTypeDef HMAC_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout, uint32_t Algorithm)
Initialize the HASH peripheral in HMAC mode, next process pInBuffer then read the computed digest.
HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
If not already done, initialize the HASH peripheral then processes pInBuffer.
HAL_StatusTypeDef HASH_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
Initialize the HASH peripheral then initiate a DMA transfer to feed the input buffer to the Periphera...
HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout, uint32_t Algorithm)
Initialize the HASH peripheral, next process pInBuffer then read the computed digest.
HAL_StatusTypeDef HASH_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
Return the computed digest.
HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
If not already done, initialize the HASH peripheral then processes pInBuffer in interruption mode.
HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Algorithm)
Initialize the HASH peripheral, next process pInBuffer then read the computed digest in interruption ...
HAL_StatusTypeDef HMAC_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
Initialize the HASH peripheral in HMAC mode then initiate the required DMA transfers to feed the key ...
HAL_StatusTypeDef HMAC_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Algorithm)
Initialize the HASH peripheral in HMAC mode, next process pInBuffer then read the computed digest in ...
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition
HAL_LockTypeDef
HAL Lock structures definition
Header file of HASH HAL module.
HASH Handle Structure definition.
HAL_StatusTypeDef Status
__IO uint32_t NbWordsAlreadyPushed
HAL_HASH_PhaseTypeDef Phase
__IO HAL_HASH_StateTypeDef State
HASH_InitTypeDef Init
FlagStatus DigestCalculationDisable
__IO uint32_t HashITCounter
DMA_HandleTypeDef * hdmain
HAL_HASH_SuspendTypeDef SuspendRequest
HASH Configuration Structure definition.
DMA handle Structure definition.