meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed May 13 08:08:21 2015 +0200
Revision:
99:dbbf35b96557
Parent:
92:4fc01daae5a5
Child:
106:ba1f97679dad
Release 99 of the mbed library

Changes:
- new targets - MAXWSNENV, DISCO_L053C8
- STM32F4xx - ST Cube driver
- KSDK mcu - SPI timing fix
- Nordic - update to softdevice s130

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 92:4fc01daae5a5 1 /**
bogdanm 92:4fc01daae5a5 2 ******************************************************************************
bogdanm 92:4fc01daae5a5 3 * @file stm32f4xx_hal_hash.h
bogdanm 92:4fc01daae5a5 4 * @author MCD Application Team
Kojto 99:dbbf35b96557 5 * @version V1.3.0
Kojto 99:dbbf35b96557 6 * @date 09-March-2015
bogdanm 92:4fc01daae5a5 7 * @brief Header file of HASH HAL module.
bogdanm 92:4fc01daae5a5 8 ******************************************************************************
bogdanm 92:4fc01daae5a5 9 * @attention
bogdanm 92:4fc01daae5a5 10 *
Kojto 99:dbbf35b96557 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 92:4fc01daae5a5 12 *
bogdanm 92:4fc01daae5a5 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 92:4fc01daae5a5 14 * are permitted provided that the following conditions are met:
bogdanm 92:4fc01daae5a5 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 92:4fc01daae5a5 16 * this list of conditions and the following disclaimer.
bogdanm 92:4fc01daae5a5 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 92:4fc01daae5a5 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 92:4fc01daae5a5 19 * and/or other materials provided with the distribution.
bogdanm 92:4fc01daae5a5 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 92:4fc01daae5a5 21 * may be used to endorse or promote products derived from this software
bogdanm 92:4fc01daae5a5 22 * without specific prior written permission.
bogdanm 92:4fc01daae5a5 23 *
bogdanm 92:4fc01daae5a5 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 92:4fc01daae5a5 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 92:4fc01daae5a5 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 92:4fc01daae5a5 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 92:4fc01daae5a5 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 92:4fc01daae5a5 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 92:4fc01daae5a5 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 92:4fc01daae5a5 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 92:4fc01daae5a5 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 92:4fc01daae5a5 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 92:4fc01daae5a5 34 *
bogdanm 92:4fc01daae5a5 35 ******************************************************************************
bogdanm 92:4fc01daae5a5 36 */
bogdanm 92:4fc01daae5a5 37
bogdanm 92:4fc01daae5a5 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 92:4fc01daae5a5 39 #ifndef __STM32F4xx_HAL_HASH_H
bogdanm 92:4fc01daae5a5 40 #define __STM32F4xx_HAL_HASH_H
bogdanm 92:4fc01daae5a5 41
bogdanm 92:4fc01daae5a5 42 #ifdef __cplusplus
bogdanm 92:4fc01daae5a5 43 extern "C" {
bogdanm 92:4fc01daae5a5 44 #endif
bogdanm 92:4fc01daae5a5 45
bogdanm 92:4fc01daae5a5 46 #if defined(STM32F415xx) || defined(STM32F417xx) || defined(STM32F437xx) || defined(STM32F439xx)
bogdanm 92:4fc01daae5a5 47
bogdanm 92:4fc01daae5a5 48 /* Includes ------------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 49 #include "stm32f4xx_hal_def.h"
bogdanm 92:4fc01daae5a5 50
bogdanm 92:4fc01daae5a5 51 /** @addtogroup STM32F4xx_HAL_Driver
bogdanm 92:4fc01daae5a5 52 * @{
bogdanm 92:4fc01daae5a5 53 */
bogdanm 92:4fc01daae5a5 54
Kojto 99:dbbf35b96557 55 /** @addtogroup HASH
Kojto 99:dbbf35b96557 56 * @brief HASH HAL module driver
Kojto 99:dbbf35b96557 57 * @{
bogdanm 92:4fc01daae5a5 58 */
bogdanm 92:4fc01daae5a5 59
bogdanm 92:4fc01daae5a5 60 /* Exported types ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 61 /** @defgroup HASH_Exported_Types HASH Exported Types
Kojto 99:dbbf35b96557 62 * @{
Kojto 99:dbbf35b96557 63 */
bogdanm 92:4fc01daae5a5 64
Kojto 99:dbbf35b96557 65 /** @defgroup HASH_Exported_Types_Group1 HASH Configuration Structure definition
Kojto 99:dbbf35b96557 66 * @{
bogdanm 92:4fc01daae5a5 67 */
Kojto 99:dbbf35b96557 68
bogdanm 92:4fc01daae5a5 69 typedef struct
bogdanm 92:4fc01daae5a5 70 {
bogdanm 92:4fc01daae5a5 71 uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string.
Kojto 99:dbbf35b96557 72 This parameter can be a value of @ref HASH DataType */
bogdanm 92:4fc01daae5a5 73
bogdanm 92:4fc01daae5a5 74 uint32_t KeySize; /*!< The key size is used only in HMAC operation */
bogdanm 92:4fc01daae5a5 75
bogdanm 92:4fc01daae5a5 76 uint8_t* pKey; /*!< The key is used only in HMAC operation */
bogdanm 92:4fc01daae5a5 77 }HASH_InitTypeDef;
bogdanm 92:4fc01daae5a5 78
bogdanm 92:4fc01daae5a5 79 /**
Kojto 99:dbbf35b96557 80 * @}
Kojto 99:dbbf35b96557 81 */
Kojto 99:dbbf35b96557 82
Kojto 99:dbbf35b96557 83 /** @defgroup HASH_Exported_Types_Group2 HASH State structures definition
Kojto 99:dbbf35b96557 84 * @{
Kojto 99:dbbf35b96557 85 */
Kojto 99:dbbf35b96557 86
bogdanm 92:4fc01daae5a5 87 typedef enum
bogdanm 92:4fc01daae5a5 88 {
bogdanm 92:4fc01daae5a5 89 HAL_HASH_STATE_RESET = 0x00, /*!< HASH not yet initialized or disabled */
bogdanm 92:4fc01daae5a5 90 HAL_HASH_STATE_READY = 0x01, /*!< HASH initialized and ready for use */
bogdanm 92:4fc01daae5a5 91 HAL_HASH_STATE_BUSY = 0x02, /*!< HASH internal process is ongoing */
bogdanm 92:4fc01daae5a5 92 HAL_HASH_STATE_TIMEOUT = 0x03, /*!< HASH timeout state */
bogdanm 92:4fc01daae5a5 93 HAL_HASH_STATE_ERROR = 0x04 /*!< HASH error state */
bogdanm 92:4fc01daae5a5 94 }HAL_HASH_STATETypeDef;
bogdanm 92:4fc01daae5a5 95
bogdanm 92:4fc01daae5a5 96 /**
Kojto 99:dbbf35b96557 97 * @}
bogdanm 92:4fc01daae5a5 98 */
Kojto 99:dbbf35b96557 99
Kojto 99:dbbf35b96557 100 /** @defgroup HASH_Exported_Types_Group3 HASH phase structures definition
Kojto 99:dbbf35b96557 101 * @{
Kojto 99:dbbf35b96557 102 */
Kojto 99:dbbf35b96557 103
bogdanm 92:4fc01daae5a5 104 typedef enum
bogdanm 92:4fc01daae5a5 105 {
bogdanm 92:4fc01daae5a5 106 HAL_HASH_PHASE_READY = 0x01, /*!< HASH peripheral is ready for initialization */
bogdanm 92:4fc01daae5a5 107 HAL_HASH_PHASE_PROCESS = 0x02, /*!< HASH peripheral is in processing phase */
bogdanm 92:4fc01daae5a5 108 }HAL_HASHPhaseTypeDef;
bogdanm 92:4fc01daae5a5 109
bogdanm 92:4fc01daae5a5 110 /**
Kojto 99:dbbf35b96557 111 * @}
bogdanm 92:4fc01daae5a5 112 */
Kojto 99:dbbf35b96557 113
Kojto 99:dbbf35b96557 114 /** @defgroup HASH_Exported_Types_Group4 HASH Handle structures definition
Kojto 99:dbbf35b96557 115 * @{
Kojto 99:dbbf35b96557 116 */
Kojto 99:dbbf35b96557 117
bogdanm 92:4fc01daae5a5 118 typedef struct
bogdanm 92:4fc01daae5a5 119 {
bogdanm 92:4fc01daae5a5 120 HASH_InitTypeDef Init; /*!< HASH required parameters */
bogdanm 92:4fc01daae5a5 121
bogdanm 92:4fc01daae5a5 122 uint8_t *pHashInBuffPtr; /*!< Pointer to input buffer */
bogdanm 92:4fc01daae5a5 123
bogdanm 92:4fc01daae5a5 124 uint8_t *pHashOutBuffPtr; /*!< Pointer to input buffer */
bogdanm 92:4fc01daae5a5 125
bogdanm 92:4fc01daae5a5 126 __IO uint32_t HashBuffSize; /*!< Size of buffer to be processed */
bogdanm 92:4fc01daae5a5 127
bogdanm 92:4fc01daae5a5 128 __IO uint32_t HashInCount; /*!< Counter of inputed data */
bogdanm 92:4fc01daae5a5 129
bogdanm 92:4fc01daae5a5 130 __IO uint32_t HashITCounter; /*!< Counter of issued interrupts */
bogdanm 92:4fc01daae5a5 131
bogdanm 92:4fc01daae5a5 132 HAL_StatusTypeDef Status; /*!< HASH peripheral status */
bogdanm 92:4fc01daae5a5 133
bogdanm 92:4fc01daae5a5 134 HAL_HASHPhaseTypeDef Phase; /*!< HASH peripheral phase */
bogdanm 92:4fc01daae5a5 135
bogdanm 92:4fc01daae5a5 136 DMA_HandleTypeDef *hdmain; /*!< HASH In DMA handle parameters */
bogdanm 92:4fc01daae5a5 137
bogdanm 92:4fc01daae5a5 138 HAL_LockTypeDef Lock; /*!< HASH locking object */
bogdanm 92:4fc01daae5a5 139
bogdanm 92:4fc01daae5a5 140 __IO HAL_HASH_STATETypeDef State; /*!< HASH peripheral state */
bogdanm 92:4fc01daae5a5 141 } HASH_HandleTypeDef;
bogdanm 92:4fc01daae5a5 142
Kojto 99:dbbf35b96557 143 /**
Kojto 99:dbbf35b96557 144 * @}
Kojto 99:dbbf35b96557 145 */
Kojto 99:dbbf35b96557 146
bogdanm 92:4fc01daae5a5 147
Kojto 99:dbbf35b96557 148 /**
Kojto 99:dbbf35b96557 149 * @}
Kojto 99:dbbf35b96557 150 */
Kojto 99:dbbf35b96557 151
Kojto 99:dbbf35b96557 152 /* Exported constants --------------------------------------------------------*/
Kojto 99:dbbf35b96557 153 /** @defgroup HASH_Exported_Constants HASH Exported Constants
bogdanm 92:4fc01daae5a5 154 * @{
bogdanm 92:4fc01daae5a5 155 */
bogdanm 92:4fc01daae5a5 156
Kojto 99:dbbf35b96557 157 /** @defgroup HASH_Exported_Constants_Group1 HASH Algorithm Selection
bogdanm 92:4fc01daae5a5 158 * @{
bogdanm 92:4fc01daae5a5 159 */
Kojto 99:dbbf35b96557 160 #define HASH_ALGOSELECTION_SHA1 ((uint32_t)0x0000) /*!< HASH function is SHA1 */
Kojto 99:dbbf35b96557 161 #define HASH_ALGOSELECTION_SHA224 HASH_CR_ALGO_1 /*!< HASH function is SHA224 */
Kojto 99:dbbf35b96557 162 #define HASH_ALGOSELECTION_SHA256 HASH_CR_ALGO /*!< HASH function is SHA256 */
Kojto 99:dbbf35b96557 163 #define HASH_ALGOSELECTION_MD5 HASH_CR_ALGO_0 /*!< HASH function is MD5 */
bogdanm 92:4fc01daae5a5 164 /**
bogdanm 92:4fc01daae5a5 165 * @}
bogdanm 92:4fc01daae5a5 166 */
bogdanm 92:4fc01daae5a5 167
Kojto 99:dbbf35b96557 168 /** @defgroup HASH_Exported_Constants_Group2 HASH Algorithm Mode
bogdanm 92:4fc01daae5a5 169 * @{
Kojto 99:dbbf35b96557 170 */
Kojto 99:dbbf35b96557 171 #define HASH_ALGOMODE_HASH ((uint32_t)0x00000000) /*!< Algorithm is HASH */
Kojto 99:dbbf35b96557 172 #define HASH_ALGOMODE_HMAC HASH_CR_MODE /*!< Algorithm is HMAC */
bogdanm 92:4fc01daae5a5 173 /**
bogdanm 92:4fc01daae5a5 174 * @}
bogdanm 92:4fc01daae5a5 175 */
bogdanm 92:4fc01daae5a5 176
Kojto 99:dbbf35b96557 177 /** @defgroup HASH_Exported_Constants_Group3 HASH DataType
bogdanm 92:4fc01daae5a5 178 * @{
bogdanm 92:4fc01daae5a5 179 */
bogdanm 92:4fc01daae5a5 180 #define HASH_DATATYPE_32B ((uint32_t)0x0000) /*!< 32-bit data. No swapping */
bogdanm 92:4fc01daae5a5 181 #define HASH_DATATYPE_16B HASH_CR_DATATYPE_0 /*!< 16-bit data. Each half word is swapped */
bogdanm 92:4fc01daae5a5 182 #define HASH_DATATYPE_8B HASH_CR_DATATYPE_1 /*!< 8-bit data. All bytes are swapped */
bogdanm 92:4fc01daae5a5 183 #define HASH_DATATYPE_1B HASH_CR_DATATYPE /*!< 1-bit data. In the word all bits are swapped */
bogdanm 92:4fc01daae5a5 184 /**
bogdanm 92:4fc01daae5a5 185 * @}
bogdanm 92:4fc01daae5a5 186 */
bogdanm 92:4fc01daae5a5 187
Kojto 99:dbbf35b96557 188 /** @defgroup HASH_Exported_Constants_Group4 HASH HMAC Long key
Kojto 99:dbbf35b96557 189 * @brief HASH HMAC Long key used only for HMAC mode
bogdanm 92:4fc01daae5a5 190 * @{
Kojto 99:dbbf35b96557 191 */
Kojto 99:dbbf35b96557 192 #define HASH_HMAC_KEYTYPE_SHORTKEY ((uint32_t)0x00000000) /*!< HMAC Key is <= 64 bytes */
Kojto 99:dbbf35b96557 193 #define HASH_HMAC_KEYTYPE_LONGKEY HASH_CR_LKEY /*!< HMAC Key is > 64 bytes */
bogdanm 92:4fc01daae5a5 194 /**
bogdanm 92:4fc01daae5a5 195 * @}
bogdanm 92:4fc01daae5a5 196 */
bogdanm 92:4fc01daae5a5 197
Kojto 99:dbbf35b96557 198 /** @defgroup HASH_Exported_Constants_Group5 HASH Flags definition
bogdanm 92:4fc01daae5a5 199 * @{
bogdanm 92:4fc01daae5a5 200 */
bogdanm 92:4fc01daae5a5 201 #define HASH_FLAG_DINIS HASH_SR_DINIS /*!< 16 locations are free in the DIN : A new block can be entered into the input buffer */
bogdanm 92:4fc01daae5a5 202 #define HASH_FLAG_DCIS HASH_SR_DCIS /*!< Digest calculation complete */
bogdanm 92:4fc01daae5a5 203 #define HASH_FLAG_DMAS HASH_SR_DMAS /*!< DMA interface is enabled (DMAE=1) or a transfer is ongoing */
bogdanm 92:4fc01daae5a5 204 #define HASH_FLAG_BUSY HASH_SR_BUSY /*!< The hash core is Busy : processing a block of data */
bogdanm 92:4fc01daae5a5 205 #define HASH_FLAG_DINNE HASH_CR_DINNE /*!< DIN not empty : The input buffer contains at least one word of data */
bogdanm 92:4fc01daae5a5 206 /**
bogdanm 92:4fc01daae5a5 207 * @}
bogdanm 92:4fc01daae5a5 208 */
bogdanm 92:4fc01daae5a5 209
Kojto 99:dbbf35b96557 210 /** @defgroup HASH_Exported_Constants_Group6 HASH Interrupts definition
bogdanm 92:4fc01daae5a5 211 * @{
Kojto 99:dbbf35b96557 212 */
bogdanm 92:4fc01daae5a5 213 #define HASH_IT_DINI HASH_IMR_DINIM /*!< A new block can be entered into the input buffer (DIN) */
bogdanm 92:4fc01daae5a5 214 #define HASH_IT_DCI HASH_IMR_DCIM /*!< Digest calculation complete */
bogdanm 92:4fc01daae5a5 215 /**
bogdanm 92:4fc01daae5a5 216 * @}
bogdanm 92:4fc01daae5a5 217 */
bogdanm 92:4fc01daae5a5 218
bogdanm 92:4fc01daae5a5 219 /**
bogdanm 92:4fc01daae5a5 220 * @}
bogdanm 92:4fc01daae5a5 221 */
bogdanm 92:4fc01daae5a5 222
bogdanm 92:4fc01daae5a5 223 /* Exported macro ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 224 /** @defgroup HASH_Exported_Macros HASH Exported Macros
Kojto 99:dbbf35b96557 225 * @{
Kojto 99:dbbf35b96557 226 */
Kojto 99:dbbf35b96557 227
bogdanm 92:4fc01daae5a5 228 /** @brief Reset HASH handle state
bogdanm 92:4fc01daae5a5 229 * @param __HANDLE__: specifies the HASH handle.
bogdanm 92:4fc01daae5a5 230 * @retval None
bogdanm 92:4fc01daae5a5 231 */
bogdanm 92:4fc01daae5a5 232 #define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HASH_STATE_RESET)
bogdanm 92:4fc01daae5a5 233
bogdanm 92:4fc01daae5a5 234 /** @brief Check whether the specified HASH flag is set or not.
bogdanm 92:4fc01daae5a5 235 * @param __FLAG__: specifies the flag to check.
bogdanm 92:4fc01daae5a5 236 * This parameter can be one of the following values:
bogdanm 92:4fc01daae5a5 237 * @arg HASH_FLAG_DINIS: A new block can be entered into the input buffer.
bogdanm 92:4fc01daae5a5 238 * @arg HASH_FLAG_DCIS: Digest calculation complete
bogdanm 92:4fc01daae5a5 239 * @arg HASH_FLAG_DMAS: DMA interface is enabled (DMAE=1) or a transfer is ongoing
bogdanm 92:4fc01daae5a5 240 * @arg HASH_FLAG_BUSY: The hash core is Busy : processing a block of data
bogdanm 92:4fc01daae5a5 241 * @arg HASH_FLAG_DINNE: DIN not empty : The input buffer contains at least one word of data
bogdanm 92:4fc01daae5a5 242 * @retval The new state of __FLAG__ (TRUE or FALSE).
bogdanm 92:4fc01daae5a5 243 */
bogdanm 92:4fc01daae5a5 244 #define __HAL_HASH_GET_FLAG(__FLAG__) ((HASH->SR & (__FLAG__)) == (__FLAG__))
bogdanm 92:4fc01daae5a5 245
bogdanm 92:4fc01daae5a5 246 /**
bogdanm 92:4fc01daae5a5 247 * @brief Enable the multiple DMA mode.
bogdanm 92:4fc01daae5a5 248 * This feature is available only in STM32F429x and STM32F439x devices.
bogdanm 92:4fc01daae5a5 249 * @retval None
bogdanm 92:4fc01daae5a5 250 */
bogdanm 92:4fc01daae5a5 251 #define __HAL_HASH_SET_MDMAT() HASH->CR |= HASH_CR_MDMAT
bogdanm 92:4fc01daae5a5 252
bogdanm 92:4fc01daae5a5 253 /**
bogdanm 92:4fc01daae5a5 254 * @brief Disable the multiple DMA mode.
bogdanm 92:4fc01daae5a5 255 * @retval None
bogdanm 92:4fc01daae5a5 256 */
bogdanm 92:4fc01daae5a5 257 #define __HAL_HASH_RESET_MDMAT() HASH->CR &= (uint32_t)(~HASH_CR_MDMAT)
bogdanm 92:4fc01daae5a5 258
bogdanm 92:4fc01daae5a5 259 /**
bogdanm 92:4fc01daae5a5 260 * @brief Start the digest computation
bogdanm 92:4fc01daae5a5 261 * @retval None
bogdanm 92:4fc01daae5a5 262 */
bogdanm 92:4fc01daae5a5 263 #define __HAL_HASH_START_DIGEST() HASH->STR |= HASH_STR_DCAL
bogdanm 92:4fc01daae5a5 264
bogdanm 92:4fc01daae5a5 265 /**
bogdanm 92:4fc01daae5a5 266 * @brief Set the number of valid bits in last word written in Data register
bogdanm 92:4fc01daae5a5 267 * @param SIZE: size in byte of last data written in Data register.
bogdanm 92:4fc01daae5a5 268 * @retval None
bogdanm 92:4fc01daae5a5 269 */
bogdanm 92:4fc01daae5a5 270 #define __HAL_HASH_SET_NBVALIDBITS(SIZE) do{HASH->STR &= ~(HASH_STR_NBW);\
bogdanm 92:4fc01daae5a5 271 HASH->STR |= 8 * ((SIZE) % 4);\
bogdanm 92:4fc01daae5a5 272 }while(0)
bogdanm 92:4fc01daae5a5 273
Kojto 99:dbbf35b96557 274 /**
Kojto 99:dbbf35b96557 275 * @}
Kojto 99:dbbf35b96557 276 */
Kojto 99:dbbf35b96557 277
bogdanm 92:4fc01daae5a5 278 /* Include HASH HAL Extension module */
bogdanm 92:4fc01daae5a5 279 #include "stm32f4xx_hal_hash_ex.h"
bogdanm 92:4fc01daae5a5 280 /* Exported functions --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 281
Kojto 99:dbbf35b96557 282 /** @defgroup HASH_Exported_Functions HASH Exported Functions
Kojto 99:dbbf35b96557 283 * @{
Kojto 99:dbbf35b96557 284 */
Kojto 99:dbbf35b96557 285
Kojto 99:dbbf35b96557 286 /** @addtogroup HASH_Exported_Functions_Group1
Kojto 99:dbbf35b96557 287 * @{
Kojto 99:dbbf35b96557 288 */
bogdanm 92:4fc01daae5a5 289 HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash);
bogdanm 92:4fc01daae5a5 290 HAL_StatusTypeDef HAL_HASH_DeInit(HASH_HandleTypeDef *hhash);
Kojto 99:dbbf35b96557 291 /**
Kojto 99:dbbf35b96557 292 * @}
Kojto 99:dbbf35b96557 293 */
bogdanm 92:4fc01daae5a5 294
Kojto 99:dbbf35b96557 295 /** @addtogroup HASH_Exported_Functions_Group2
Kojto 99:dbbf35b96557 296 * @{
Kojto 99:dbbf35b96557 297 */
bogdanm 92:4fc01daae5a5 298 HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
bogdanm 92:4fc01daae5a5 299 HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
bogdanm 92:4fc01daae5a5 300 HAL_StatusTypeDef HAL_HASH_MD5_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
bogdanm 92:4fc01daae5a5 301 HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 99:dbbf35b96557 302 /**
Kojto 99:dbbf35b96557 303 * @}
Kojto 99:dbbf35b96557 304 */
Kojto 99:dbbf35b96557 305
Kojto 99:dbbf35b96557 306 /** @addtogroup HASH_Exported_Functions_Group3
Kojto 99:dbbf35b96557 307 * @{
Kojto 99:dbbf35b96557 308 */
bogdanm 92:4fc01daae5a5 309 HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
bogdanm 92:4fc01daae5a5 310 HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 99:dbbf35b96557 311 /**
Kojto 99:dbbf35b96557 312 * @}
Kojto 99:dbbf35b96557 313 */
bogdanm 92:4fc01daae5a5 314
Kojto 99:dbbf35b96557 315 /** @addtogroup HASH_Exported_Functions_Group4
Kojto 99:dbbf35b96557 316 * @{
Kojto 99:dbbf35b96557 317 */
bogdanm 92:4fc01daae5a5 318 HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
bogdanm 92:4fc01daae5a5 319 HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 99:dbbf35b96557 320 /**
Kojto 99:dbbf35b96557 321 * @}
Kojto 99:dbbf35b96557 322 */
bogdanm 92:4fc01daae5a5 323
Kojto 99:dbbf35b96557 324 /** @addtogroup HASH_Exported_Functions_Group5
Kojto 99:dbbf35b96557 325 * @{
Kojto 99:dbbf35b96557 326 */
bogdanm 92:4fc01daae5a5 327 HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
bogdanm 92:4fc01daae5a5 328 HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
bogdanm 92:4fc01daae5a5 329 HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
bogdanm 92:4fc01daae5a5 330 HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 99:dbbf35b96557 331 /**
Kojto 99:dbbf35b96557 332 * @}
Kojto 99:dbbf35b96557 333 */
bogdanm 92:4fc01daae5a5 334
Kojto 99:dbbf35b96557 335 /** @addtogroup HASH_Exported_Functions_Group6
Kojto 99:dbbf35b96557 336 * @{
Kojto 99:dbbf35b96557 337 */
bogdanm 92:4fc01daae5a5 338 HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
bogdanm 92:4fc01daae5a5 339 HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 99:dbbf35b96557 340 /**
Kojto 99:dbbf35b96557 341 * @}
Kojto 99:dbbf35b96557 342 */
bogdanm 92:4fc01daae5a5 343
Kojto 99:dbbf35b96557 344 /** @addtogroup HASH_Exported_Functions_Group7
Kojto 99:dbbf35b96557 345 * @{
Kojto 99:dbbf35b96557 346 */
bogdanm 92:4fc01daae5a5 347 void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash);
Kojto 99:dbbf35b96557 348 /**
Kojto 99:dbbf35b96557 349 * @}
Kojto 99:dbbf35b96557 350 */
bogdanm 92:4fc01daae5a5 351
Kojto 99:dbbf35b96557 352 /** @addtogroup HASH_Exported_Functions_Group8
Kojto 99:dbbf35b96557 353 * @{
Kojto 99:dbbf35b96557 354 */
bogdanm 92:4fc01daae5a5 355 HAL_HASH_STATETypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash);
bogdanm 92:4fc01daae5a5 356 void HAL_HASH_MspInit(HASH_HandleTypeDef *hhash);
bogdanm 92:4fc01daae5a5 357 void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash);
bogdanm 92:4fc01daae5a5 358 void HAL_HASH_InCpltCallback(HASH_HandleTypeDef *hhash);
bogdanm 92:4fc01daae5a5 359 void HAL_HASH_DgstCpltCallback(HASH_HandleTypeDef *hhash);
bogdanm 92:4fc01daae5a5 360 void HAL_HASH_ErrorCallback(HASH_HandleTypeDef *hhash);
Kojto 99:dbbf35b96557 361 /**
Kojto 99:dbbf35b96557 362 * @}
Kojto 99:dbbf35b96557 363 */
Kojto 99:dbbf35b96557 364
Kojto 99:dbbf35b96557 365 /**
Kojto 99:dbbf35b96557 366 * @}
Kojto 99:dbbf35b96557 367 */
Kojto 99:dbbf35b96557 368
Kojto 99:dbbf35b96557 369 /* Private types -------------------------------------------------------------*/
Kojto 99:dbbf35b96557 370 /** @defgroup HASH_Private_Types HASH Private Types
Kojto 99:dbbf35b96557 371 * @{
Kojto 99:dbbf35b96557 372 */
bogdanm 92:4fc01daae5a5 373
Kojto 99:dbbf35b96557 374 /**
Kojto 99:dbbf35b96557 375 * @}
Kojto 99:dbbf35b96557 376 */
Kojto 99:dbbf35b96557 377
Kojto 99:dbbf35b96557 378 /* Private variables ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 379 /** @defgroup HASH_Private_Variables HASH Private Variables
Kojto 99:dbbf35b96557 380 * @{
Kojto 99:dbbf35b96557 381 */
Kojto 99:dbbf35b96557 382
Kojto 99:dbbf35b96557 383 /**
Kojto 99:dbbf35b96557 384 * @}
Kojto 99:dbbf35b96557 385 */
Kojto 99:dbbf35b96557 386
Kojto 99:dbbf35b96557 387 /* Private constants ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 388 /** @defgroup HASH_Private_Constants HASH Private Constants
Kojto 99:dbbf35b96557 389 * @{
Kojto 99:dbbf35b96557 390 */
Kojto 99:dbbf35b96557 391
Kojto 99:dbbf35b96557 392 /**
Kojto 99:dbbf35b96557 393 * @}
Kojto 99:dbbf35b96557 394 */
Kojto 99:dbbf35b96557 395
Kojto 99:dbbf35b96557 396 /* Private macros ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 397 /** @defgroup HASH_Private_Macros HASH Private Macros
Kojto 99:dbbf35b96557 398 * @{
Kojto 99:dbbf35b96557 399 */
Kojto 99:dbbf35b96557 400 #define IS_HASH_ALGOSELECTION(__ALGOSELECTION__) (((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA1) || \
Kojto 99:dbbf35b96557 401 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA224) || \
Kojto 99:dbbf35b96557 402 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA256) || \
Kojto 99:dbbf35b96557 403 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_MD5))
Kojto 99:dbbf35b96557 404
Kojto 99:dbbf35b96557 405
Kojto 99:dbbf35b96557 406 #define IS_HASH_ALGOMODE(__ALGOMODE__) (((__ALGOMODE__) == HASH_ALGOMODE_HASH) || \
Kojto 99:dbbf35b96557 407 ((__ALGOMODE__) == HASH_ALGOMODE_HMAC))
Kojto 99:dbbf35b96557 408
Kojto 99:dbbf35b96557 409
Kojto 99:dbbf35b96557 410 #define IS_HASH_DATATYPE(__DATATYPE__) (((__DATATYPE__) == HASH_DATATYPE_32B)|| \
Kojto 99:dbbf35b96557 411 ((__DATATYPE__) == HASH_DATATYPE_16B)|| \
Kojto 99:dbbf35b96557 412 ((__DATATYPE__) == HASH_DATATYPE_8B) || \
Kojto 99:dbbf35b96557 413 ((__DATATYPE__) == HASH_DATATYPE_1B))
Kojto 99:dbbf35b96557 414
Kojto 99:dbbf35b96557 415
Kojto 99:dbbf35b96557 416 #define IS_HASH_HMAC_KEYTYPE(__KEYTYPE__) (((__KEYTYPE__) == HASH_HMAC_KEYTYPE_SHORTKEY) || \
Kojto 99:dbbf35b96557 417 ((__KEYTYPE__) == HASH_HMAC_KEYTYPE_LONGKEY))
Kojto 99:dbbf35b96557 418
Kojto 99:dbbf35b96557 419 /**
Kojto 99:dbbf35b96557 420 * @}
Kojto 99:dbbf35b96557 421 */
Kojto 99:dbbf35b96557 422
Kojto 99:dbbf35b96557 423 /* Private functions ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 424 /** @defgroup HASH_Private_Functions HASH Private Functions
Kojto 99:dbbf35b96557 425 * @{
Kojto 99:dbbf35b96557 426 */
Kojto 99:dbbf35b96557 427
Kojto 99:dbbf35b96557 428 /**
Kojto 99:dbbf35b96557 429 * @}
Kojto 99:dbbf35b96557 430 */
Kojto 99:dbbf35b96557 431
bogdanm 92:4fc01daae5a5 432 #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */
bogdanm 92:4fc01daae5a5 433 /**
bogdanm 92:4fc01daae5a5 434 * @}
bogdanm 92:4fc01daae5a5 435 */
bogdanm 92:4fc01daae5a5 436
bogdanm 92:4fc01daae5a5 437 /**
bogdanm 92:4fc01daae5a5 438 * @}
bogdanm 92:4fc01daae5a5 439 */
bogdanm 92:4fc01daae5a5 440
bogdanm 92:4fc01daae5a5 441 #ifdef __cplusplus
bogdanm 92:4fc01daae5a5 442 }
bogdanm 92:4fc01daae5a5 443 #endif
bogdanm 92:4fc01daae5a5 444
bogdanm 92:4fc01daae5a5 445
bogdanm 92:4fc01daae5a5 446 #endif /* __STM32F4xx_HAL_HASH_H */
bogdanm 92:4fc01daae5a5 447
bogdanm 92:4fc01daae5a5 448 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/