The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Mon Jan 16 12:05:23 2017 +0000
Revision:
134:ad3be0349dc5
Parent:
128:9bcdf88f62b0
Child:
145:64910690c574
Release 134 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions https://github.com/ARMmbed/mbed-os/pull/3488
3492: Fix #3463 CAN read() return value https://github.com/ARMmbed/mbed-os/pull/3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly https://github.com/ARMmbed/mbed-os/pull/3503
3504: [LPC15xx] CAN implementation improvements https://github.com/ARMmbed/mbed-os/pull/3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral https://github.com/ARMmbed/mbed-os/pull/3539
3540: STM: SPI: Initialize Rx in spi_master_write https://github.com/ARMmbed/mbed-os/pull/3540
3438: K64F: Add support for SERIAL ASYNCH API https://github.com/ARMmbed/mbed-os/pull/3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set https://github.com/ARMmbed/mbed-os/pull/3519
3544: STM32L4 deepsleep improvement https://github.com/ARMmbed/mbed-os/pull/3544
3546: NUCLEO-F412ZG - Add CAN peripheral https://github.com/ARMmbed/mbed-os/pull/3546
3551: Fix I2C driver for RZ/A1H https://github.com/ARMmbed/mbed-os/pull/3551
3558: K64F UART Asynch API: Fix synchronization issue https://github.com/ARMmbed/mbed-os/pull/3558
3563: LPC4088 - Fix vector checksum https://github.com/ARMmbed/mbed-os/pull/3563
3567: Dev stm32 F0 v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3567
3577: Fixes linking errors when building with debug profile https://github.com/ARMmbed/mbed-os/pull/3577

Who changed what in which revision?

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