STM32F439xx HAL User Manual
Data Structures | Defines | Enumerations | Functions
stm32f4xx_hal_hash.h File Reference

Header file of HASH HAL module. More...

#include "stm32f4xx_hal_def.h"
#include "stm32f4xx_hal_hash_ex.h"

Go to the source code of this file.

Data Structures

struct  HASH_InitTypeDef
struct  HASH_HandleTypeDef

Defines

#define HASH_ALGOSELECTION_SHA1   0x00000000U
#define HASH_ALGOSELECTION_SHA224   HASH_CR_ALGO_1
#define HASH_ALGOSELECTION_SHA256   HASH_CR_ALGO
#define HASH_ALGOSELECTION_MD5   HASH_CR_ALGO_0
#define HASH_ALGOMODE_HASH   0x00000000U
#define HASH_ALGOMODE_HMAC   HASH_CR_MODE
#define HASH_DATATYPE_32B   0x00000000U
#define HASH_DATATYPE_16B   HASH_CR_DATATYPE_0
#define HASH_DATATYPE_8B   HASH_CR_DATATYPE_1
#define HASH_DATATYPE_1B   HASH_CR_DATATYPE
#define HASH_HMAC_KEYTYPE_SHORTKEY   0x00000000U
#define HASH_HMAC_KEYTYPE_LONGKEY   HASH_CR_LKEY
#define HASH_FLAG_DINIS   HASH_SR_DINIS
#define HASH_FLAG_DCIS   HASH_SR_DCIS
#define HASH_FLAG_DMAS   HASH_SR_DMAS
#define HASH_FLAG_BUSY   HASH_SR_BUSY
#define HASH_FLAG_DINNE   HASH_CR_DINNE
#define HASH_IT_DINI   HASH_IMR_DINIE
#define HASH_IT_DCI   HASH_IMR_DCIE
#define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->State = HAL_HASH_STATE_RESET)
 Reset HASH handle state.
#define __HAL_HASH_GET_FLAG(__FLAG__)
 Check whether the specified HASH flag is set or not.
#define __HAL_HASH_SET_MDMAT()   HASH->CR |= HASH_CR_MDMAT
 Enable the multiple DMA mode.
#define __HAL_HASH_RESET_MDMAT()   HASH->CR &= (uint32_t)(~HASH_CR_MDMAT)
 Disable the multiple DMA mode.
#define __HAL_HASH_START_DIGEST()   HASH->STR |= HASH_STR_DCAL
 Start the digest computation.
#define __HAL_HASH_SET_NBVALIDBITS(SIZE)
 Set the number of valid bits in last word written in Data register.
#define IS_HASH_ALGOSELECTION(__ALGOSELECTION__)
#define IS_HASH_ALGOMODE(__ALGOMODE__)
#define IS_HASH_DATATYPE(__DATATYPE__)
#define IS_HASH_HMAC_KEYTYPE(__KEYTYPE__)
#define IS_HASH_SHA1_BUFFER_SIZE(__SIZE__)   ((((__SIZE__)%4U) != 0U)? 0U: 1U)

Enumerations

enum  HAL_HASH_StateTypeDef {
  HAL_HASH_STATE_RESET = 0x00U, HAL_HASH_STATE_READY = 0x01U, HAL_HASH_STATE_BUSY = 0x02U, HAL_HASH_STATE_TIMEOUT = 0x03U,
  HAL_HASH_STATE_ERROR = 0x04U
}
enum  HAL_HASH_PhaseTypeDef { HAL_HASH_PHASE_READY = 0x01U, HAL_HASH_PHASE_PROCESS = 0x02U }

Functions

HAL_StatusTypeDef HAL_HASH_Init (HASH_HandleTypeDef *hhash)
 Initializes the HASH according to the specified parameters in the HASH_HandleTypeDef and creates the associated handle.
HAL_StatusTypeDef HAL_HASH_DeInit (HASH_HandleTypeDef *hhash)
 DeInitializes the HASH peripheral.
HAL_StatusTypeDef HAL_HASH_SHA1_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_MD5_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initializes the HASH peripheral in MD5 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_MD5_Accumulate (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in MD5 mode then writes the pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HMAC_SHA1_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initializes the HASH peripheral in HMAC SHA1 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HMAC_MD5_Start (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer, uint32_t Timeout)
 Initializes the HASH peripheral in HMAC MD5 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
 Initializes the HASH peripheral in SHA1 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_MD5_Start_IT (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer)
 Initializes the HASH peripheral in MD5 mode then processes pInBuffer.
HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in SHA1 mode then enables DMA to control data transfer.
HAL_StatusTypeDef HAL_HASH_SHA1_Finish (HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
 Returns the computed digest in SHA1 mode.
HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in MD5 mode then enables DMA to control data transfer.
HAL_StatusTypeDef HAL_HASH_MD5_Finish (HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, uint32_t Timeout)
 Returns the computed digest in MD5 mode.
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in HMAC SHA1 mode then enables DMA to control data transfer.
HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA (HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
 Initializes the HASH peripheral in HMAC MD5 mode then enables DMA to control data transfer.
void HAL_HASH_IRQHandler (HASH_HandleTypeDef *hhash)
 This function handles HASH interrupt request.
HAL_HASH_StateTypeDef HAL_HASH_GetState (HASH_HandleTypeDef *hhash)
 return the HASH state
void HAL_HASH_MspInit (HASH_HandleTypeDef *hhash)
 Initializes the HASH MSP.
void HAL_HASH_MspDeInit (HASH_HandleTypeDef *hhash)
 DeInitializes HASH MSP.
void HAL_HASH_InCpltCallback (HASH_HandleTypeDef *hhash)
 Input data transfer complete callback.
void HAL_HASH_DgstCpltCallback (HASH_HandleTypeDef *hhash)
 Digest computation complete callback.
void HAL_HASH_ErrorCallback (HASH_HandleTypeDef *hhash)
 Data transfer Error callback.

Detailed Description

Header file of HASH HAL module.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. Neither the name of STMicroelectronics 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 THE COPYRIGHT HOLDER OR 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 stm32f4xx_hal_hash.h.