mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
yusuke_kyo
Date:
Wed Apr 08 08:04:18 2015 +0000
Revision:
98:01a414ca7d6d
Parent:
93:e188a91d3eaa
remove SerialHalfDuplex.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 93:e188a91d3eaa 1 /**
Kojto 93:e188a91d3eaa 2 ******************************************************************************
Kojto 93:e188a91d3eaa 3 * @file stm32f4xx_hal_hash.h
Kojto 93:e188a91d3eaa 4 * @author MCD Application Team
Kojto 93:e188a91d3eaa 5 * @version V1.1.0
Kojto 93:e188a91d3eaa 6 * @date 19-June-2014
Kojto 93:e188a91d3eaa 7 * @brief Header file of HASH HAL module.
Kojto 93:e188a91d3eaa 8 ******************************************************************************
Kojto 93:e188a91d3eaa 9 * @attention
Kojto 93:e188a91d3eaa 10 *
Kojto 93:e188a91d3eaa 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 93:e188a91d3eaa 12 *
Kojto 93:e188a91d3eaa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 93:e188a91d3eaa 14 * are permitted provided that the following conditions are met:
Kojto 93:e188a91d3eaa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 93:e188a91d3eaa 16 * this list of conditions and the following disclaimer.
Kojto 93:e188a91d3eaa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 93:e188a91d3eaa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 93:e188a91d3eaa 19 * and/or other materials provided with the distribution.
Kojto 93:e188a91d3eaa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 93:e188a91d3eaa 21 * may be used to endorse or promote products derived from this software
Kojto 93:e188a91d3eaa 22 * without specific prior written permission.
Kojto 93:e188a91d3eaa 23 *
Kojto 93:e188a91d3eaa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 93:e188a91d3eaa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 93:e188a91d3eaa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 93:e188a91d3eaa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 93:e188a91d3eaa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 93:e188a91d3eaa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 93:e188a91d3eaa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 93:e188a91d3eaa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 93:e188a91d3eaa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 93:e188a91d3eaa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 93:e188a91d3eaa 34 *
Kojto 93:e188a91d3eaa 35 ******************************************************************************
Kojto 93:e188a91d3eaa 36 */
Kojto 93:e188a91d3eaa 37
Kojto 93:e188a91d3eaa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 93:e188a91d3eaa 39 #ifndef __STM32F4xx_HAL_HASH_H
Kojto 93:e188a91d3eaa 40 #define __STM32F4xx_HAL_HASH_H
Kojto 93:e188a91d3eaa 41
Kojto 93:e188a91d3eaa 42 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 43 extern "C" {
Kojto 93:e188a91d3eaa 44 #endif
Kojto 93:e188a91d3eaa 45
Kojto 93:e188a91d3eaa 46 #if defined(STM32F415xx) || defined(STM32F417xx) || defined(STM32F437xx) || defined(STM32F439xx)
Kojto 93:e188a91d3eaa 47
Kojto 93:e188a91d3eaa 48 /* Includes ------------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 49 #include "stm32f4xx_hal_def.h"
Kojto 93:e188a91d3eaa 50
Kojto 93:e188a91d3eaa 51 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 93:e188a91d3eaa 52 * @{
Kojto 93:e188a91d3eaa 53 */
Kojto 93:e188a91d3eaa 54
Kojto 93:e188a91d3eaa 55 /** @addtogroup HASH
Kojto 93:e188a91d3eaa 56 * @{
Kojto 93:e188a91d3eaa 57 */
Kojto 93:e188a91d3eaa 58
Kojto 93:e188a91d3eaa 59 /* Exported types ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 60
Kojto 93:e188a91d3eaa 61 /**
Kojto 93:e188a91d3eaa 62 * @brief HASH Configuration Structure definition
Kojto 93:e188a91d3eaa 63 */
Kojto 93:e188a91d3eaa 64 typedef struct
Kojto 93:e188a91d3eaa 65 {
Kojto 93:e188a91d3eaa 66 uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string.
Kojto 93:e188a91d3eaa 67 This parameter can be a value of @ref HASH_Data_Type */
Kojto 93:e188a91d3eaa 68
Kojto 93:e188a91d3eaa 69 uint32_t KeySize; /*!< The key size is used only in HMAC operation */
Kojto 93:e188a91d3eaa 70
Kojto 93:e188a91d3eaa 71 uint8_t* pKey; /*!< The key is used only in HMAC operation */
Kojto 93:e188a91d3eaa 72 }HASH_InitTypeDef;
Kojto 93:e188a91d3eaa 73
Kojto 93:e188a91d3eaa 74 /**
Kojto 93:e188a91d3eaa 75 * @brief HAL State structures definition
Kojto 93:e188a91d3eaa 76 */
Kojto 93:e188a91d3eaa 77 typedef enum
Kojto 93:e188a91d3eaa 78 {
Kojto 93:e188a91d3eaa 79 HAL_HASH_STATE_RESET = 0x00, /*!< HASH not yet initialized or disabled */
Kojto 93:e188a91d3eaa 80 HAL_HASH_STATE_READY = 0x01, /*!< HASH initialized and ready for use */
Kojto 93:e188a91d3eaa 81 HAL_HASH_STATE_BUSY = 0x02, /*!< HASH internal process is ongoing */
Kojto 93:e188a91d3eaa 82 HAL_HASH_STATE_TIMEOUT = 0x03, /*!< HASH timeout state */
Kojto 93:e188a91d3eaa 83 HAL_HASH_STATE_ERROR = 0x04 /*!< HASH error state */
Kojto 93:e188a91d3eaa 84 }HAL_HASH_STATETypeDef;
Kojto 93:e188a91d3eaa 85
Kojto 93:e188a91d3eaa 86 /**
Kojto 93:e188a91d3eaa 87 * @brief HAL phase structures definition
Kojto 93:e188a91d3eaa 88 */
Kojto 93:e188a91d3eaa 89 typedef enum
Kojto 93:e188a91d3eaa 90 {
Kojto 93:e188a91d3eaa 91 HAL_HASH_PHASE_READY = 0x01, /*!< HASH peripheral is ready for initialization */
Kojto 93:e188a91d3eaa 92 HAL_HASH_PHASE_PROCESS = 0x02, /*!< HASH peripheral is in processing phase */
Kojto 93:e188a91d3eaa 93 }HAL_HASHPhaseTypeDef;
Kojto 93:e188a91d3eaa 94
Kojto 93:e188a91d3eaa 95 /**
Kojto 93:e188a91d3eaa 96 * @brief HASH Handle Structure definition
Kojto 93:e188a91d3eaa 97 */
Kojto 93:e188a91d3eaa 98 typedef struct
Kojto 93:e188a91d3eaa 99 {
Kojto 93:e188a91d3eaa 100 HASH_InitTypeDef Init; /*!< HASH required parameters */
Kojto 93:e188a91d3eaa 101
Kojto 93:e188a91d3eaa 102 uint8_t *pHashInBuffPtr; /*!< Pointer to input buffer */
Kojto 93:e188a91d3eaa 103
Kojto 93:e188a91d3eaa 104 uint8_t *pHashOutBuffPtr; /*!< Pointer to input buffer */
Kojto 93:e188a91d3eaa 105
Kojto 93:e188a91d3eaa 106 __IO uint32_t HashBuffSize; /*!< Size of buffer to be processed */
Kojto 93:e188a91d3eaa 107
Kojto 93:e188a91d3eaa 108 __IO uint32_t HashInCount; /*!< Counter of inputed data */
Kojto 93:e188a91d3eaa 109
Kojto 93:e188a91d3eaa 110 __IO uint32_t HashITCounter; /*!< Counter of issued interrupts */
Kojto 93:e188a91d3eaa 111
Kojto 93:e188a91d3eaa 112 HAL_StatusTypeDef Status; /*!< HASH peripheral status */
Kojto 93:e188a91d3eaa 113
Kojto 93:e188a91d3eaa 114 HAL_HASHPhaseTypeDef Phase; /*!< HASH peripheral phase */
Kojto 93:e188a91d3eaa 115
Kojto 93:e188a91d3eaa 116 DMA_HandleTypeDef *hdmain; /*!< HASH In DMA handle parameters */
Kojto 93:e188a91d3eaa 117
Kojto 93:e188a91d3eaa 118 HAL_LockTypeDef Lock; /*!< HASH locking object */
Kojto 93:e188a91d3eaa 119
Kojto 93:e188a91d3eaa 120 __IO HAL_HASH_STATETypeDef State; /*!< HASH peripheral state */
Kojto 93:e188a91d3eaa 121 } HASH_HandleTypeDef;
Kojto 93:e188a91d3eaa 122
Kojto 93:e188a91d3eaa 123 /* Exported constants --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 124
Kojto 93:e188a91d3eaa 125 /** @defgroup HASH_Exported_Constants
Kojto 93:e188a91d3eaa 126 * @{
Kojto 93:e188a91d3eaa 127 */
Kojto 93:e188a91d3eaa 128
Kojto 93:e188a91d3eaa 129 /** @defgroup HASH_Algo_Selection
Kojto 93:e188a91d3eaa 130 * @{
Kojto 93:e188a91d3eaa 131 */
Kojto 93:e188a91d3eaa 132 #define HASH_AlgoSelection_SHA1 ((uint32_t)0x0000) /*!< HASH function is SHA1 */
Kojto 93:e188a91d3eaa 133 #define HASH_AlgoSelection_SHA224 HASH_CR_ALGO_1 /*!< HASH function is SHA224 */
Kojto 93:e188a91d3eaa 134 #define HASH_AlgoSelection_SHA256 HASH_CR_ALGO /*!< HASH function is SHA256 */
Kojto 93:e188a91d3eaa 135 #define HASH_AlgoSelection_MD5 HASH_CR_ALGO_0 /*!< HASH function is MD5 */
Kojto 93:e188a91d3eaa 136
Kojto 93:e188a91d3eaa 137 #define IS_HASH_ALGOSELECTION(ALGOSELECTION) (((ALGOSELECTION) == HASH_AlgoSelection_SHA1) || \
Kojto 93:e188a91d3eaa 138 ((ALGOSELECTION) == HASH_AlgoSelection_SHA224) || \
Kojto 93:e188a91d3eaa 139 ((ALGOSELECTION) == HASH_AlgoSelection_SHA256) || \
Kojto 93:e188a91d3eaa 140 ((ALGOSELECTION) == HASH_AlgoSelection_MD5))
Kojto 93:e188a91d3eaa 141 /**
Kojto 93:e188a91d3eaa 142 * @}
Kojto 93:e188a91d3eaa 143 */
Kojto 93:e188a91d3eaa 144
Kojto 93:e188a91d3eaa 145 /** @defgroup HASH_Algorithm_Mode
Kojto 93:e188a91d3eaa 146 * @{
Kojto 93:e188a91d3eaa 147 */
Kojto 93:e188a91d3eaa 148 #define HASH_AlgoMode_HASH ((uint32_t)0x00000000) /*!< Algorithm is HASH */
Kojto 93:e188a91d3eaa 149 #define HASH_AlgoMode_HMAC HASH_CR_MODE /*!< Algorithm is HMAC */
Kojto 93:e188a91d3eaa 150
Kojto 93:e188a91d3eaa 151 #define IS_HASH_ALGOMODE(ALGOMODE) (((ALGOMODE) == HASH_AlgoMode_HASH) || \
Kojto 93:e188a91d3eaa 152 ((ALGOMODE) == HASH_AlgoMode_HMAC))
Kojto 93:e188a91d3eaa 153 /**
Kojto 93:e188a91d3eaa 154 * @}
Kojto 93:e188a91d3eaa 155 */
Kojto 93:e188a91d3eaa 156
Kojto 93:e188a91d3eaa 157 /** @defgroup HASH_Data_Type
Kojto 93:e188a91d3eaa 158 * @{
Kojto 93:e188a91d3eaa 159 */
Kojto 93:e188a91d3eaa 160 #define HASH_DATATYPE_32B ((uint32_t)0x0000) /*!< 32-bit data. No swapping */
Kojto 93:e188a91d3eaa 161 #define HASH_DATATYPE_16B HASH_CR_DATATYPE_0 /*!< 16-bit data. Each half word is swapped */
Kojto 93:e188a91d3eaa 162 #define HASH_DATATYPE_8B HASH_CR_DATATYPE_1 /*!< 8-bit data. All bytes are swapped */
Kojto 93:e188a91d3eaa 163 #define HASH_DATATYPE_1B HASH_CR_DATATYPE /*!< 1-bit data. In the word all bits are swapped */
Kojto 93:e188a91d3eaa 164
Kojto 93:e188a91d3eaa 165 #define IS_HASH_DATATYPE(DATATYPE) (((DATATYPE) == HASH_DATATYPE_32B)|| \
Kojto 93:e188a91d3eaa 166 ((DATATYPE) == HASH_DATATYPE_16B)|| \
Kojto 93:e188a91d3eaa 167 ((DATATYPE) == HASH_DATATYPE_8B) || \
Kojto 93:e188a91d3eaa 168 ((DATATYPE) == HASH_DATATYPE_1B))
Kojto 93:e188a91d3eaa 169 /**
Kojto 93:e188a91d3eaa 170 * @}
Kojto 93:e188a91d3eaa 171 */
Kojto 93:e188a91d3eaa 172
Kojto 93:e188a91d3eaa 173 /** @defgroup HASH_HMAC_Long_key_only_for_HMAC_mode
Kojto 93:e188a91d3eaa 174 * @{
Kojto 93:e188a91d3eaa 175 */
Kojto 93:e188a91d3eaa 176 #define HASH_HMACKeyType_ShortKey ((uint32_t)0x00000000) /*!< HMAC Key is <= 64 bytes */
Kojto 93:e188a91d3eaa 177 #define HASH_HMACKeyType_LongKey HASH_CR_LKEY /*!< HMAC Key is > 64 bytes */
Kojto 93:e188a91d3eaa 178
Kojto 93:e188a91d3eaa 179 #define IS_HASH_HMAC_KEYTYPE(KEYTYPE) (((KEYTYPE) == HASH_HMACKeyType_ShortKey) || \
Kojto 93:e188a91d3eaa 180 ((KEYTYPE) == HASH_HMACKeyType_LongKey))
Kojto 93:e188a91d3eaa 181 /**
Kojto 93:e188a91d3eaa 182 * @}
Kojto 93:e188a91d3eaa 183 */
Kojto 93:e188a91d3eaa 184
Kojto 93:e188a91d3eaa 185 /** @defgroup HASH_flags_definition
Kojto 93:e188a91d3eaa 186 * @{
Kojto 93:e188a91d3eaa 187 */
Kojto 93:e188a91d3eaa 188 #define HASH_FLAG_DINIS HASH_SR_DINIS /*!< 16 locations are free in the DIN : A new block can be entered into the input buffer */
Kojto 93:e188a91d3eaa 189 #define HASH_FLAG_DCIS HASH_SR_DCIS /*!< Digest calculation complete */
Kojto 93:e188a91d3eaa 190 #define HASH_FLAG_DMAS HASH_SR_DMAS /*!< DMA interface is enabled (DMAE=1) or a transfer is ongoing */
Kojto 93:e188a91d3eaa 191 #define HASH_FLAG_BUSY HASH_SR_BUSY /*!< The hash core is Busy : processing a block of data */
Kojto 93:e188a91d3eaa 192 #define HASH_FLAG_DINNE HASH_CR_DINNE /*!< DIN not empty : The input buffer contains at least one word of data */
Kojto 93:e188a91d3eaa 193 /**
Kojto 93:e188a91d3eaa 194 * @}
Kojto 93:e188a91d3eaa 195 */
Kojto 93:e188a91d3eaa 196
Kojto 93:e188a91d3eaa 197 /** @defgroup HASH_interrupts_definition
Kojto 93:e188a91d3eaa 198 * @{
Kojto 93:e188a91d3eaa 199 */
Kojto 93:e188a91d3eaa 200 #define HASH_IT_DINI HASH_IMR_DINIM /*!< A new block can be entered into the input buffer (DIN) */
Kojto 93:e188a91d3eaa 201 #define HASH_IT_DCI HASH_IMR_DCIM /*!< Digest calculation complete */
Kojto 93:e188a91d3eaa 202 /**
Kojto 93:e188a91d3eaa 203 * @}
Kojto 93:e188a91d3eaa 204 */
Kojto 93:e188a91d3eaa 205
Kojto 93:e188a91d3eaa 206 /**
Kojto 93:e188a91d3eaa 207 * @}
Kojto 93:e188a91d3eaa 208 */
Kojto 93:e188a91d3eaa 209
Kojto 93:e188a91d3eaa 210 /* Exported macro ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 211
Kojto 93:e188a91d3eaa 212 /** @brief Reset HASH handle state
Kojto 93:e188a91d3eaa 213 * @param __HANDLE__: specifies the HASH handle.
Kojto 93:e188a91d3eaa 214 * @retval None
Kojto 93:e188a91d3eaa 215 */
Kojto 93:e188a91d3eaa 216 #define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HASH_STATE_RESET)
Kojto 93:e188a91d3eaa 217
Kojto 93:e188a91d3eaa 218 /** @brief Check whether the specified HASH flag is set or not.
Kojto 93:e188a91d3eaa 219 * @param __FLAG__: specifies the flag to check.
Kojto 93:e188a91d3eaa 220 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 221 * @arg HASH_FLAG_DINIS: A new block can be entered into the input buffer.
Kojto 93:e188a91d3eaa 222 * @arg HASH_FLAG_DCIS: Digest calculation complete
Kojto 93:e188a91d3eaa 223 * @arg HASH_FLAG_DMAS: DMA interface is enabled (DMAE=1) or a transfer is ongoing
Kojto 93:e188a91d3eaa 224 * @arg HASH_FLAG_BUSY: The hash core is Busy : processing a block of data
Kojto 93:e188a91d3eaa 225 * @arg HASH_FLAG_DINNE: DIN not empty : The input buffer contains at least one word of data
Kojto 93:e188a91d3eaa 226 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 93:e188a91d3eaa 227 */
Kojto 93:e188a91d3eaa 228 #define __HAL_HASH_GET_FLAG(__FLAG__) ((HASH->SR & (__FLAG__)) == (__FLAG__))
Kojto 93:e188a91d3eaa 229
Kojto 93:e188a91d3eaa 230 /**
Kojto 93:e188a91d3eaa 231 * @brief Macros for HMAC finish.
Kojto 93:e188a91d3eaa 232 * @param None
Kojto 93:e188a91d3eaa 233 * @retval None
Kojto 93:e188a91d3eaa 234 */
Kojto 93:e188a91d3eaa 235 #define HAL_HMAC_MD5_Finish HAL_HASH_MD5_Finish
Kojto 93:e188a91d3eaa 236 #define HAL_HMAC_SHA1_Finish HAL_HASH_SHA1_Finish
Kojto 93:e188a91d3eaa 237 #define HAL_HMAC_SHA224_Finish HAL_HASH_SHA224_Finish
Kojto 93:e188a91d3eaa 238 #define HAL_HMAC_SHA256_Finish HAL_HASH_SHA256_Finish
Kojto 93:e188a91d3eaa 239
Kojto 93:e188a91d3eaa 240 /**
Kojto 93:e188a91d3eaa 241 * @brief Enable the multiple DMA mode.
Kojto 93:e188a91d3eaa 242 * This feature is available only in STM32F429x and STM32F439x devices.
Kojto 93:e188a91d3eaa 243 * @param None
Kojto 93:e188a91d3eaa 244 * @retval None
Kojto 93:e188a91d3eaa 245 */
Kojto 93:e188a91d3eaa 246 #define __HAL_HASH_SET_MDMAT() HASH->CR |= HASH_CR_MDMAT
Kojto 93:e188a91d3eaa 247
Kojto 93:e188a91d3eaa 248 /**
Kojto 93:e188a91d3eaa 249 * @brief Disable the multiple DMA mode.
Kojto 93:e188a91d3eaa 250 * @param None
Kojto 93:e188a91d3eaa 251 * @retval None
Kojto 93:e188a91d3eaa 252 */
Kojto 93:e188a91d3eaa 253 #define __HAL_HASH_RESET_MDMAT() HASH->CR &= (uint32_t)(~HASH_CR_MDMAT)
Kojto 93:e188a91d3eaa 254
Kojto 93:e188a91d3eaa 255 /**
Kojto 93:e188a91d3eaa 256 * @brief Start the digest computation
Kojto 93:e188a91d3eaa 257 * @param None
Kojto 93:e188a91d3eaa 258 * @retval None
Kojto 93:e188a91d3eaa 259 */
Kojto 93:e188a91d3eaa 260 #define __HAL_HASH_START_DIGEST() HASH->STR |= HASH_STR_DCAL
Kojto 93:e188a91d3eaa 261
Kojto 93:e188a91d3eaa 262 /**
Kojto 93:e188a91d3eaa 263 * @brief Set the number of valid bits in last word written in Data register
Kojto 93:e188a91d3eaa 264 * @param SIZE: size in byte of last data written in Data register.
Kojto 93:e188a91d3eaa 265 * @retval None
Kojto 93:e188a91d3eaa 266 */
Kojto 93:e188a91d3eaa 267 #define __HAL_HASH_SET_NBVALIDBITS(SIZE) do{HASH->STR &= ~(HASH_STR_NBW);\
Kojto 93:e188a91d3eaa 268 HASH->STR |= 8 * ((SIZE) % 4);\
Kojto 93:e188a91d3eaa 269 }while(0)
Kojto 93:e188a91d3eaa 270
Kojto 93:e188a91d3eaa 271 /* Include HASH HAL Extension module */
Kojto 93:e188a91d3eaa 272 #include "stm32f4xx_hal_hash_ex.h"
Kojto 93:e188a91d3eaa 273
Kojto 93:e188a91d3eaa 274 /* Exported functions --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 275
Kojto 93:e188a91d3eaa 276 /* Initialization and de-initialization functions **********************************/
Kojto 93:e188a91d3eaa 277 HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 278 HAL_StatusTypeDef HAL_HASH_DeInit(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 279
Kojto 93:e188a91d3eaa 280 /* HASH processing using polling *********************************************/
Kojto 93:e188a91d3eaa 281 HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 93:e188a91d3eaa 282 HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 93:e188a91d3eaa 283 HAL_StatusTypeDef HAL_HASH_MD5_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 93:e188a91d3eaa 284 HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 93:e188a91d3eaa 285
Kojto 93:e188a91d3eaa 286 /* HASH-MAC processing using polling *****************************************/
Kojto 93:e188a91d3eaa 287 HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 93:e188a91d3eaa 288 HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 93:e188a91d3eaa 289
Kojto 93:e188a91d3eaa 290 /* HASH processing using interrupt *******************************************/
Kojto 93:e188a91d3eaa 291 HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 93:e188a91d3eaa 292 HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 93:e188a91d3eaa 293
Kojto 93:e188a91d3eaa 294 /* HASH processing using DMA *************************************************/
Kojto 93:e188a91d3eaa 295 HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 93:e188a91d3eaa 296 HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 93:e188a91d3eaa 297 HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 93:e188a91d3eaa 298 HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 93:e188a91d3eaa 299
Kojto 93:e188a91d3eaa 300 /* HASH-HMAC processing using DMA ********************************************/
Kojto 93:e188a91d3eaa 301 HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 93:e188a91d3eaa 302 HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 93:e188a91d3eaa 303
Kojto 93:e188a91d3eaa 304 /* Processing functions ******************************************************/
Kojto 93:e188a91d3eaa 305 void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 306
Kojto 93:e188a91d3eaa 307 /* Peripheral State functions ************************************************/
Kojto 93:e188a91d3eaa 308 HAL_HASH_STATETypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 309 void HAL_HASH_MspInit(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 310 void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 311 void HAL_HASH_InCpltCallback(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 312 void HAL_HASH_DgstCpltCallback(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 313 void HAL_HASH_ErrorCallback(HASH_HandleTypeDef *hhash);
Kojto 93:e188a91d3eaa 314
Kojto 93:e188a91d3eaa 315 #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */
Kojto 93:e188a91d3eaa 316 /**
Kojto 93:e188a91d3eaa 317 * @}
Kojto 93:e188a91d3eaa 318 */
Kojto 93:e188a91d3eaa 319
Kojto 93:e188a91d3eaa 320 /**
Kojto 93:e188a91d3eaa 321 * @}
Kojto 93:e188a91d3eaa 322 */
Kojto 93:e188a91d3eaa 323
Kojto 93:e188a91d3eaa 324 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 325 }
Kojto 93:e188a91d3eaa 326 #endif
Kojto 93:e188a91d3eaa 327
Kojto 93:e188a91d3eaa 328
Kojto 93:e188a91d3eaa 329 #endif /* __STM32F4xx_HAL_HASH_H */
Kojto 93:e188a91d3eaa 330
Kojto 93:e188a91d3eaa 331 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/