Mouse code for the MacroRat
mbed-dev/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_cryp.h@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /** |
sahilmgandhi | 18:6a4db94011d3 | 2 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 3 | * @file stm32f2xx_hal_cryp.h |
sahilmgandhi | 18:6a4db94011d3 | 4 | * @author MCD Application Team |
sahilmgandhi | 18:6a4db94011d3 | 5 | * @version V1.1.3 |
sahilmgandhi | 18:6a4db94011d3 | 6 | * @date 29-June-2016 |
sahilmgandhi | 18:6a4db94011d3 | 7 | * @brief Header file of CRYP HAL module. |
sahilmgandhi | 18:6a4db94011d3 | 8 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 9 | * @attention |
sahilmgandhi | 18:6a4db94011d3 | 10 | * |
sahilmgandhi | 18:6a4db94011d3 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
sahilmgandhi | 18:6a4db94011d3 | 12 | * |
sahilmgandhi | 18:6a4db94011d3 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
sahilmgandhi | 18:6a4db94011d3 | 14 | * are permitted provided that the following conditions are met: |
sahilmgandhi | 18:6a4db94011d3 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 16 | * this list of conditions and the following disclaimer. |
sahilmgandhi | 18:6a4db94011d3 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 18 | * this list of conditions and the following disclaimer in the documentation |
sahilmgandhi | 18:6a4db94011d3 | 19 | * and/or other materials provided with the distribution. |
sahilmgandhi | 18:6a4db94011d3 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
sahilmgandhi | 18:6a4db94011d3 | 21 | * may be used to endorse or promote products derived from this software |
sahilmgandhi | 18:6a4db94011d3 | 22 | * without specific prior written permission. |
sahilmgandhi | 18:6a4db94011d3 | 23 | * |
sahilmgandhi | 18:6a4db94011d3 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
sahilmgandhi | 18:6a4db94011d3 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
sahilmgandhi | 18:6a4db94011d3 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
sahilmgandhi | 18:6a4db94011d3 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
sahilmgandhi | 18:6a4db94011d3 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
sahilmgandhi | 18:6a4db94011d3 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
sahilmgandhi | 18:6a4db94011d3 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
sahilmgandhi | 18:6a4db94011d3 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
sahilmgandhi | 18:6a4db94011d3 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
sahilmgandhi | 18:6a4db94011d3 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
sahilmgandhi | 18:6a4db94011d3 | 34 | * |
sahilmgandhi | 18:6a4db94011d3 | 35 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 36 | */ |
sahilmgandhi | 18:6a4db94011d3 | 37 | |
sahilmgandhi | 18:6a4db94011d3 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 39 | #ifndef __STM32F2xx_HAL_CRYP_H |
sahilmgandhi | 18:6a4db94011d3 | 40 | #define __STM32F2xx_HAL_CRYP_H |
sahilmgandhi | 18:6a4db94011d3 | 41 | |
sahilmgandhi | 18:6a4db94011d3 | 42 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 43 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 44 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 45 | |
sahilmgandhi | 18:6a4db94011d3 | 46 | #if defined(STM32F215xx) || defined(STM32F217xx) |
sahilmgandhi | 18:6a4db94011d3 | 47 | /* Includes ------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 48 | #include "stm32f2xx_hal_def.h" |
sahilmgandhi | 18:6a4db94011d3 | 49 | |
sahilmgandhi | 18:6a4db94011d3 | 50 | /** @addtogroup STM32F2xx_HAL_Driver |
sahilmgandhi | 18:6a4db94011d3 | 51 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 52 | */ |
sahilmgandhi | 18:6a4db94011d3 | 53 | |
sahilmgandhi | 18:6a4db94011d3 | 54 | /** @addtogroup CRYP |
sahilmgandhi | 18:6a4db94011d3 | 55 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 56 | */ |
sahilmgandhi | 18:6a4db94011d3 | 57 | |
sahilmgandhi | 18:6a4db94011d3 | 58 | /* Exported types ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 59 | |
sahilmgandhi | 18:6a4db94011d3 | 60 | /** @defgroup CRYP_Exported_Types CRYP Exported Types |
sahilmgandhi | 18:6a4db94011d3 | 61 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 62 | */ |
sahilmgandhi | 18:6a4db94011d3 | 63 | |
sahilmgandhi | 18:6a4db94011d3 | 64 | /** @defgroup CRYP_Exported_Types_Group1 CRYP Configuration Structure definition |
sahilmgandhi | 18:6a4db94011d3 | 65 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 66 | */ |
sahilmgandhi | 18:6a4db94011d3 | 67 | |
sahilmgandhi | 18:6a4db94011d3 | 68 | typedef struct |
sahilmgandhi | 18:6a4db94011d3 | 69 | { |
sahilmgandhi | 18:6a4db94011d3 | 70 | uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string. |
sahilmgandhi | 18:6a4db94011d3 | 71 | This parameter can be a value of @ref CRYP_Data_Type */ |
sahilmgandhi | 18:6a4db94011d3 | 72 | |
sahilmgandhi | 18:6a4db94011d3 | 73 | uint32_t KeySize; /*!< Used only in AES mode only : 128, 192 or 256 bit key length. |
sahilmgandhi | 18:6a4db94011d3 | 74 | This parameter can be a value of @ref CRYP_Key_Size */ |
sahilmgandhi | 18:6a4db94011d3 | 75 | |
sahilmgandhi | 18:6a4db94011d3 | 76 | uint8_t* pKey; /*!< The key used for encryption/decryption */ |
sahilmgandhi | 18:6a4db94011d3 | 77 | |
sahilmgandhi | 18:6a4db94011d3 | 78 | uint8_t* pInitVect; /*!< The initialization vector used also as initialization |
sahilmgandhi | 18:6a4db94011d3 | 79 | counter in CTR mode */ |
sahilmgandhi | 18:6a4db94011d3 | 80 | |
sahilmgandhi | 18:6a4db94011d3 | 81 | uint8_t IVSize; /*!< The size of initialization vector. |
sahilmgandhi | 18:6a4db94011d3 | 82 | This parameter (called nonce size in CCM) is used only |
sahilmgandhi | 18:6a4db94011d3 | 83 | in AES-128/192/256 encryption/decryption CCM mode */ |
sahilmgandhi | 18:6a4db94011d3 | 84 | |
sahilmgandhi | 18:6a4db94011d3 | 85 | uint8_t TagSize; /*!< The size of returned authentication TAG. |
sahilmgandhi | 18:6a4db94011d3 | 86 | This parameter is used only in AES-128/192/256 |
sahilmgandhi | 18:6a4db94011d3 | 87 | encryption/decryption CCM mode */ |
sahilmgandhi | 18:6a4db94011d3 | 88 | |
sahilmgandhi | 18:6a4db94011d3 | 89 | uint8_t* Header; /*!< The header used in GCM and CCM modes */ |
sahilmgandhi | 18:6a4db94011d3 | 90 | |
sahilmgandhi | 18:6a4db94011d3 | 91 | uint32_t HeaderSize; /*!< The size of header buffer in bytes */ |
sahilmgandhi | 18:6a4db94011d3 | 92 | |
sahilmgandhi | 18:6a4db94011d3 | 93 | uint8_t* pScratch; /*!< Scratch buffer used to append the header. It's size must be equal to header size + 21 bytes. |
sahilmgandhi | 18:6a4db94011d3 | 94 | This parameter is used only in AES-128/192/256 encryption/decryption CCM mode */ |
sahilmgandhi | 18:6a4db94011d3 | 95 | }CRYP_InitTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 96 | |
sahilmgandhi | 18:6a4db94011d3 | 97 | /** |
sahilmgandhi | 18:6a4db94011d3 | 98 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 99 | */ |
sahilmgandhi | 18:6a4db94011d3 | 100 | |
sahilmgandhi | 18:6a4db94011d3 | 101 | /** @defgroup CRYP_Exported_Types_Group2 CRYP State structures definition |
sahilmgandhi | 18:6a4db94011d3 | 102 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 103 | */ |
sahilmgandhi | 18:6a4db94011d3 | 104 | |
sahilmgandhi | 18:6a4db94011d3 | 105 | |
sahilmgandhi | 18:6a4db94011d3 | 106 | typedef enum |
sahilmgandhi | 18:6a4db94011d3 | 107 | { |
sahilmgandhi | 18:6a4db94011d3 | 108 | HAL_CRYP_STATE_RESET = 0x00U, /*!< CRYP not yet initialized or disabled */ |
sahilmgandhi | 18:6a4db94011d3 | 109 | HAL_CRYP_STATE_READY = 0x01U, /*!< CRYP initialized and ready for use */ |
sahilmgandhi | 18:6a4db94011d3 | 110 | HAL_CRYP_STATE_BUSY = 0x02U, /*!< CRYP internal processing is ongoing */ |
sahilmgandhi | 18:6a4db94011d3 | 111 | HAL_CRYP_STATE_TIMEOUT = 0x03U, /*!< CRYP timeout state */ |
sahilmgandhi | 18:6a4db94011d3 | 112 | HAL_CRYP_STATE_ERROR = 0x04U /*!< CRYP error state */ |
sahilmgandhi | 18:6a4db94011d3 | 113 | }HAL_CRYP_STATETypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 114 | |
sahilmgandhi | 18:6a4db94011d3 | 115 | /** |
sahilmgandhi | 18:6a4db94011d3 | 116 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 117 | */ |
sahilmgandhi | 18:6a4db94011d3 | 118 | |
sahilmgandhi | 18:6a4db94011d3 | 119 | /** @defgroup CRYP_Exported_Types_Group3 CRYP phase structures definition |
sahilmgandhi | 18:6a4db94011d3 | 120 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 121 | */ |
sahilmgandhi | 18:6a4db94011d3 | 122 | |
sahilmgandhi | 18:6a4db94011d3 | 123 | |
sahilmgandhi | 18:6a4db94011d3 | 124 | typedef enum |
sahilmgandhi | 18:6a4db94011d3 | 125 | { |
sahilmgandhi | 18:6a4db94011d3 | 126 | HAL_CRYP_PHASE_READY = 0x01U, /*!< CRYP peripheral is ready for initialization. */ |
sahilmgandhi | 18:6a4db94011d3 | 127 | HAL_CRYP_PHASE_PROCESS = 0x02U, /*!< CRYP peripheral is in processing phase */ |
sahilmgandhi | 18:6a4db94011d3 | 128 | HAL_CRYP_PHASE_FINAL = 0x03U /*!< CRYP peripheral is in final phase |
sahilmgandhi | 18:6a4db94011d3 | 129 | This is relevant only with CCM and GCM modes */ |
sahilmgandhi | 18:6a4db94011d3 | 130 | }HAL_PhaseTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 131 | |
sahilmgandhi | 18:6a4db94011d3 | 132 | /** |
sahilmgandhi | 18:6a4db94011d3 | 133 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 134 | */ |
sahilmgandhi | 18:6a4db94011d3 | 135 | |
sahilmgandhi | 18:6a4db94011d3 | 136 | /** @defgroup CRYP_Exported_Types_Group4 CRYP handle Structure definition |
sahilmgandhi | 18:6a4db94011d3 | 137 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 138 | */ |
sahilmgandhi | 18:6a4db94011d3 | 139 | |
sahilmgandhi | 18:6a4db94011d3 | 140 | typedef struct |
sahilmgandhi | 18:6a4db94011d3 | 141 | { |
sahilmgandhi | 18:6a4db94011d3 | 142 | CRYP_TypeDef *Instance; /*!< CRYP registers base address */ |
sahilmgandhi | 18:6a4db94011d3 | 143 | |
sahilmgandhi | 18:6a4db94011d3 | 144 | CRYP_InitTypeDef Init; /*!< CRYP required parameters */ |
sahilmgandhi | 18:6a4db94011d3 | 145 | |
sahilmgandhi | 18:6a4db94011d3 | 146 | uint8_t *pCrypInBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ |
sahilmgandhi | 18:6a4db94011d3 | 147 | |
sahilmgandhi | 18:6a4db94011d3 | 148 | uint8_t *pCrypOutBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ |
sahilmgandhi | 18:6a4db94011d3 | 149 | |
sahilmgandhi | 18:6a4db94011d3 | 150 | __IO uint16_t CrypInCount; /*!< Counter of inputed data */ |
sahilmgandhi | 18:6a4db94011d3 | 151 | |
sahilmgandhi | 18:6a4db94011d3 | 152 | __IO uint16_t CrypOutCount; /*!< Counter of output data */ |
sahilmgandhi | 18:6a4db94011d3 | 153 | |
sahilmgandhi | 18:6a4db94011d3 | 154 | HAL_StatusTypeDef Status; /*!< CRYP peripheral status */ |
sahilmgandhi | 18:6a4db94011d3 | 155 | |
sahilmgandhi | 18:6a4db94011d3 | 156 | HAL_PhaseTypeDef Phase; /*!< CRYP peripheral phase */ |
sahilmgandhi | 18:6a4db94011d3 | 157 | |
sahilmgandhi | 18:6a4db94011d3 | 158 | DMA_HandleTypeDef *hdmain; /*!< CRYP In DMA handle parameters */ |
sahilmgandhi | 18:6a4db94011d3 | 159 | |
sahilmgandhi | 18:6a4db94011d3 | 160 | DMA_HandleTypeDef *hdmaout; /*!< CRYP Out DMA handle parameters */ |
sahilmgandhi | 18:6a4db94011d3 | 161 | |
sahilmgandhi | 18:6a4db94011d3 | 162 | HAL_LockTypeDef Lock; /*!< CRYP locking object */ |
sahilmgandhi | 18:6a4db94011d3 | 163 | |
sahilmgandhi | 18:6a4db94011d3 | 164 | __IO HAL_CRYP_STATETypeDef State; /*!< CRYP peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 165 | }CRYP_HandleTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 166 | |
sahilmgandhi | 18:6a4db94011d3 | 167 | /** |
sahilmgandhi | 18:6a4db94011d3 | 168 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 169 | */ |
sahilmgandhi | 18:6a4db94011d3 | 170 | |
sahilmgandhi | 18:6a4db94011d3 | 171 | /** |
sahilmgandhi | 18:6a4db94011d3 | 172 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 173 | */ |
sahilmgandhi | 18:6a4db94011d3 | 174 | |
sahilmgandhi | 18:6a4db94011d3 | 175 | /* Exported constants --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 176 | /** @defgroup CRYP_Exported_Constants CRYP Exported Constants |
sahilmgandhi | 18:6a4db94011d3 | 177 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 178 | */ |
sahilmgandhi | 18:6a4db94011d3 | 179 | |
sahilmgandhi | 18:6a4db94011d3 | 180 | /** @defgroup CRYP_Key_Size CRYP Key Size |
sahilmgandhi | 18:6a4db94011d3 | 181 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 182 | */ |
sahilmgandhi | 18:6a4db94011d3 | 183 | #define CRYP_KEYSIZE_128B ((uint32_t)0x00000000U) |
sahilmgandhi | 18:6a4db94011d3 | 184 | #define CRYP_KEYSIZE_192B CRYP_CR_KEYSIZE_0 |
sahilmgandhi | 18:6a4db94011d3 | 185 | #define CRYP_KEYSIZE_256B CRYP_CR_KEYSIZE_1 |
sahilmgandhi | 18:6a4db94011d3 | 186 | /** |
sahilmgandhi | 18:6a4db94011d3 | 187 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 188 | */ |
sahilmgandhi | 18:6a4db94011d3 | 189 | |
sahilmgandhi | 18:6a4db94011d3 | 190 | /** @defgroup CRYP_Data_Type CRYP Data Type |
sahilmgandhi | 18:6a4db94011d3 | 191 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 192 | */ |
sahilmgandhi | 18:6a4db94011d3 | 193 | #define CRYP_DATATYPE_32B ((uint32_t)0x00000000U) |
sahilmgandhi | 18:6a4db94011d3 | 194 | #define CRYP_DATATYPE_16B CRYP_CR_DATATYPE_0 |
sahilmgandhi | 18:6a4db94011d3 | 195 | #define CRYP_DATATYPE_8B CRYP_CR_DATATYPE_1 |
sahilmgandhi | 18:6a4db94011d3 | 196 | #define CRYP_DATATYPE_1B CRYP_CR_DATATYPE |
sahilmgandhi | 18:6a4db94011d3 | 197 | /** |
sahilmgandhi | 18:6a4db94011d3 | 198 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 199 | */ |
sahilmgandhi | 18:6a4db94011d3 | 200 | |
sahilmgandhi | 18:6a4db94011d3 | 201 | /** @defgroup CRYP_Exported_Constants_Group3 CRYP CRYP_AlgoModeDirection |
sahilmgandhi | 18:6a4db94011d3 | 202 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 203 | */ |
sahilmgandhi | 18:6a4db94011d3 | 204 | #define CRYP_CR_ALGOMODE_DIRECTION ((uint32_t)0x0008003CU) |
sahilmgandhi | 18:6a4db94011d3 | 205 | #define CRYP_CR_ALGOMODE_TDES_ECB_ENCRYPT ((uint32_t)0x00000000U) |
sahilmgandhi | 18:6a4db94011d3 | 206 | #define CRYP_CR_ALGOMODE_TDES_ECB_DECRYPT ((uint32_t)0x00000004U) |
sahilmgandhi | 18:6a4db94011d3 | 207 | #define CRYP_CR_ALGOMODE_TDES_CBC_ENCRYPT ((uint32_t)0x00000008U) |
sahilmgandhi | 18:6a4db94011d3 | 208 | #define CRYP_CR_ALGOMODE_TDES_CBC_DECRYPT ((uint32_t)0x0000000CU) |
sahilmgandhi | 18:6a4db94011d3 | 209 | #define CRYP_CR_ALGOMODE_DES_ECB_ENCRYPT ((uint32_t)0x00000010U) |
sahilmgandhi | 18:6a4db94011d3 | 210 | #define CRYP_CR_ALGOMODE_DES_ECB_DECRYPT ((uint32_t)0x00000014U) |
sahilmgandhi | 18:6a4db94011d3 | 211 | #define CRYP_CR_ALGOMODE_DES_CBC_ENCRYPT ((uint32_t)0x00000018U) |
sahilmgandhi | 18:6a4db94011d3 | 212 | #define CRYP_CR_ALGOMODE_DES_CBC_DECRYPT ((uint32_t)0x0000001CU) |
sahilmgandhi | 18:6a4db94011d3 | 213 | #define CRYP_CR_ALGOMODE_AES_ECB_ENCRYPT ((uint32_t)0x00000020U) |
sahilmgandhi | 18:6a4db94011d3 | 214 | #define CRYP_CR_ALGOMODE_AES_ECB_DECRYPT ((uint32_t)0x00000024U) |
sahilmgandhi | 18:6a4db94011d3 | 215 | #define CRYP_CR_ALGOMODE_AES_CBC_ENCRYPT ((uint32_t)0x00000028U) |
sahilmgandhi | 18:6a4db94011d3 | 216 | #define CRYP_CR_ALGOMODE_AES_CBC_DECRYPT ((uint32_t)0x0000002CU) |
sahilmgandhi | 18:6a4db94011d3 | 217 | #define CRYP_CR_ALGOMODE_AES_CTR_ENCRYPT ((uint32_t)0x00000030U) |
sahilmgandhi | 18:6a4db94011d3 | 218 | #define CRYP_CR_ALGOMODE_AES_CTR_DECRYPT ((uint32_t)0x00000034U) |
sahilmgandhi | 18:6a4db94011d3 | 219 | /** |
sahilmgandhi | 18:6a4db94011d3 | 220 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 221 | */ |
sahilmgandhi | 18:6a4db94011d3 | 222 | |
sahilmgandhi | 18:6a4db94011d3 | 223 | /** @defgroup CRYP_Exported_Constants_Group4 CRYP CRYP_Interrupt |
sahilmgandhi | 18:6a4db94011d3 | 224 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 225 | */ |
sahilmgandhi | 18:6a4db94011d3 | 226 | #define CRYP_IT_INI ((uint32_t)CRYP_IMSCR_INIM) /*!< Input FIFO Interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 227 | #define CRYP_IT_OUTI ((uint32_t)CRYP_IMSCR_OUTIM) /*!< Output FIFO Interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 228 | /** |
sahilmgandhi | 18:6a4db94011d3 | 229 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 230 | */ |
sahilmgandhi | 18:6a4db94011d3 | 231 | |
sahilmgandhi | 18:6a4db94011d3 | 232 | /** @defgroup CRYP_Exported_Constants_Group5 CRYP CRYP_Flags |
sahilmgandhi | 18:6a4db94011d3 | 233 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 234 | */ |
sahilmgandhi | 18:6a4db94011d3 | 235 | #define CRYP_FLAG_BUSY ((uint32_t)0x00000010U) /*!< The CRYP core is currently |
sahilmgandhi | 18:6a4db94011d3 | 236 | processing a block of data |
sahilmgandhi | 18:6a4db94011d3 | 237 | or a key preparation (for |
sahilmgandhi | 18:6a4db94011d3 | 238 | AES decryption). */ |
sahilmgandhi | 18:6a4db94011d3 | 239 | #define CRYP_FLAG_IFEM ((uint32_t)0x00000001U) /*!< Input FIFO is empty */ |
sahilmgandhi | 18:6a4db94011d3 | 240 | #define CRYP_FLAG_IFNF ((uint32_t)0x00000002U) /*!< Input FIFO is not Full */ |
sahilmgandhi | 18:6a4db94011d3 | 241 | #define CRYP_FLAG_OFNE ((uint32_t)0x00000004U) /*!< Output FIFO is not empty */ |
sahilmgandhi | 18:6a4db94011d3 | 242 | #define CRYP_FLAG_OFFU ((uint32_t)0x00000008U) /*!< Output FIFO is Full */ |
sahilmgandhi | 18:6a4db94011d3 | 243 | #define CRYP_FLAG_OUTRIS ((uint32_t)0x01000002U) /*!< Output FIFO service raw |
sahilmgandhi | 18:6a4db94011d3 | 244 | interrupt status */ |
sahilmgandhi | 18:6a4db94011d3 | 245 | #define CRYP_FLAG_INRIS ((uint32_t)0x01000001U) /*!< Input FIFO service raw |
sahilmgandhi | 18:6a4db94011d3 | 246 | interrupt status */ |
sahilmgandhi | 18:6a4db94011d3 | 247 | /** |
sahilmgandhi | 18:6a4db94011d3 | 248 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 249 | */ |
sahilmgandhi | 18:6a4db94011d3 | 250 | |
sahilmgandhi | 18:6a4db94011d3 | 251 | /** |
sahilmgandhi | 18:6a4db94011d3 | 252 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 253 | */ |
sahilmgandhi | 18:6a4db94011d3 | 254 | |
sahilmgandhi | 18:6a4db94011d3 | 255 | /* Exported macro ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 256 | /** @defgroup CRYP_Exported_Macros CRYP Exported Macros |
sahilmgandhi | 18:6a4db94011d3 | 257 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 258 | */ |
sahilmgandhi | 18:6a4db94011d3 | 259 | |
sahilmgandhi | 18:6a4db94011d3 | 260 | /** @brief Reset CRYP handle state |
sahilmgandhi | 18:6a4db94011d3 | 261 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 262 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 263 | */ |
sahilmgandhi | 18:6a4db94011d3 | 264 | #define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRYP_STATE_RESET) |
sahilmgandhi | 18:6a4db94011d3 | 265 | |
sahilmgandhi | 18:6a4db94011d3 | 266 | /** |
sahilmgandhi | 18:6a4db94011d3 | 267 | * @brief Enable/Disable the CRYP peripheral. |
sahilmgandhi | 18:6a4db94011d3 | 268 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 269 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 270 | */ |
sahilmgandhi | 18:6a4db94011d3 | 271 | #define __HAL_CRYP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRYP_CR_CRYPEN) |
sahilmgandhi | 18:6a4db94011d3 | 272 | #define __HAL_CRYP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~CRYP_CR_CRYPEN) |
sahilmgandhi | 18:6a4db94011d3 | 273 | |
sahilmgandhi | 18:6a4db94011d3 | 274 | /** |
sahilmgandhi | 18:6a4db94011d3 | 275 | * @brief Flush the data FIFO. |
sahilmgandhi | 18:6a4db94011d3 | 276 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 277 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 278 | */ |
sahilmgandhi | 18:6a4db94011d3 | 279 | #define __HAL_CRYP_FIFO_FLUSH(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRYP_CR_FFLUSH) |
sahilmgandhi | 18:6a4db94011d3 | 280 | |
sahilmgandhi | 18:6a4db94011d3 | 281 | /** |
sahilmgandhi | 18:6a4db94011d3 | 282 | * @brief Set the algorithm mode: AES-ECB, AES-CBC, AES-CTR, DES-ECB, DES-CBC. |
sahilmgandhi | 18:6a4db94011d3 | 283 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 284 | * @param MODE: The algorithm mode. |
sahilmgandhi | 18:6a4db94011d3 | 285 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 286 | */ |
sahilmgandhi | 18:6a4db94011d3 | 287 | #define __HAL_CRYP_SET_MODE(__HANDLE__, MODE) ((__HANDLE__)->Instance->CR |= (uint32_t)(MODE)) |
sahilmgandhi | 18:6a4db94011d3 | 288 | |
sahilmgandhi | 18:6a4db94011d3 | 289 | /** @brief Check whether the specified CRYP flag is set or not. |
sahilmgandhi | 18:6a4db94011d3 | 290 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 291 | * @param __FLAG__: specifies the flag to check. |
sahilmgandhi | 18:6a4db94011d3 | 292 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 293 | * @arg CRYP_FLAG_BUSY: The CRYP core is currently processing a block of data |
sahilmgandhi | 18:6a4db94011d3 | 294 | * or a key preparation (for AES decryption). |
sahilmgandhi | 18:6a4db94011d3 | 295 | * @arg CRYP_FLAG_IFEM: Input FIFO is empty |
sahilmgandhi | 18:6a4db94011d3 | 296 | * @arg CRYP_FLAG_IFNF: Input FIFO is not full |
sahilmgandhi | 18:6a4db94011d3 | 297 | * @arg CRYP_FLAG_INRIS: Input FIFO service raw interrupt is pending |
sahilmgandhi | 18:6a4db94011d3 | 298 | * @arg CRYP_FLAG_OFNE: Output FIFO is not empty |
sahilmgandhi | 18:6a4db94011d3 | 299 | * @arg CRYP_FLAG_OFFU: Output FIFO is full |
sahilmgandhi | 18:6a4db94011d3 | 300 | * @arg CRYP_FLAG_OUTRIS: Input FIFO service raw interrupt is pending |
sahilmgandhi | 18:6a4db94011d3 | 301 | * @retval The new state of __FLAG__ (TRUE or FALSE). |
sahilmgandhi | 18:6a4db94011d3 | 302 | */ |
sahilmgandhi | 18:6a4db94011d3 | 303 | |
sahilmgandhi | 18:6a4db94011d3 | 304 | #define __HAL_CRYP_GET_FLAG(__HANDLE__, __FLAG__) ((((uint8_t)((__FLAG__) >> 24U)) == 0x01U)?((((__HANDLE__)->Instance->RISR) & ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK)): \ |
sahilmgandhi | 18:6a4db94011d3 | 305 | ((((__HANDLE__)->Instance->RISR) & ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK))) |
sahilmgandhi | 18:6a4db94011d3 | 306 | |
sahilmgandhi | 18:6a4db94011d3 | 307 | /** @brief Check whether the specified CRYP interrupt is set or not. |
sahilmgandhi | 18:6a4db94011d3 | 308 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 309 | * @param __INTERRUPT__: specifies the interrupt to check. |
sahilmgandhi | 18:6a4db94011d3 | 310 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 311 | * @arg CRYP_IT_INRIS: Input FIFO service raw interrupt is pending |
sahilmgandhi | 18:6a4db94011d3 | 312 | * @arg CRYP_IT_OUTRIS: Output FIFO service raw interrupt is pending |
sahilmgandhi | 18:6a4db94011d3 | 313 | * @retval The new state of __INTERRUPT__ (TRUE or FALSE). |
sahilmgandhi | 18:6a4db94011d3 | 314 | */ |
sahilmgandhi | 18:6a4db94011d3 | 315 | #define __HAL_CRYP_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->MISR & (__INTERRUPT__)) == (__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 316 | |
sahilmgandhi | 18:6a4db94011d3 | 317 | /** |
sahilmgandhi | 18:6a4db94011d3 | 318 | * @brief Enable the CRYP interrupt. |
sahilmgandhi | 18:6a4db94011d3 | 319 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 320 | * @param __INTERRUPT__: CRYP Interrupt. |
sahilmgandhi | 18:6a4db94011d3 | 321 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 322 | */ |
sahilmgandhi | 18:6a4db94011d3 | 323 | #define __HAL_CRYP_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) |= (__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 324 | |
sahilmgandhi | 18:6a4db94011d3 | 325 | /** |
sahilmgandhi | 18:6a4db94011d3 | 326 | * @brief Disable the CRYP interrupt. |
sahilmgandhi | 18:6a4db94011d3 | 327 | * @param __HANDLE__: specifies the CRYP handle. |
sahilmgandhi | 18:6a4db94011d3 | 328 | * @param __INTERRUPT__: CRYP interrupt. |
sahilmgandhi | 18:6a4db94011d3 | 329 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 330 | */ |
sahilmgandhi | 18:6a4db94011d3 | 331 | #define __HAL_CRYP_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) &= ~(__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 332 | |
sahilmgandhi | 18:6a4db94011d3 | 333 | /** |
sahilmgandhi | 18:6a4db94011d3 | 334 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 335 | */ |
sahilmgandhi | 18:6a4db94011d3 | 336 | |
sahilmgandhi | 18:6a4db94011d3 | 337 | |
sahilmgandhi | 18:6a4db94011d3 | 338 | |
sahilmgandhi | 18:6a4db94011d3 | 339 | |
sahilmgandhi | 18:6a4db94011d3 | 340 | /* Exported functions --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 341 | /** @defgroup CRYP_Exported_Functions CRYP Exported Functions |
sahilmgandhi | 18:6a4db94011d3 | 342 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 343 | */ |
sahilmgandhi | 18:6a4db94011d3 | 344 | |
sahilmgandhi | 18:6a4db94011d3 | 345 | /** @addtogroup CRYP_Exported_Functions_Group1 |
sahilmgandhi | 18:6a4db94011d3 | 346 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 347 | */ |
sahilmgandhi | 18:6a4db94011d3 | 348 | HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 349 | HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 350 | void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 351 | void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 352 | /** |
sahilmgandhi | 18:6a4db94011d3 | 353 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 354 | */ |
sahilmgandhi | 18:6a4db94011d3 | 355 | |
sahilmgandhi | 18:6a4db94011d3 | 356 | /** @addtogroup CRYP_Exported_Functions_Group2 |
sahilmgandhi | 18:6a4db94011d3 | 357 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 358 | */ |
sahilmgandhi | 18:6a4db94011d3 | 359 | /* AES encryption/decryption using polling ***********************************/ |
sahilmgandhi | 18:6a4db94011d3 | 360 | HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 361 | HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 362 | HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 363 | HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 364 | HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 365 | HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 366 | |
sahilmgandhi | 18:6a4db94011d3 | 367 | /* AES encryption/decryption using interrupt *********************************/ |
sahilmgandhi | 18:6a4db94011d3 | 368 | HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 369 | HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 370 | HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 371 | HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 372 | HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 373 | HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 374 | |
sahilmgandhi | 18:6a4db94011d3 | 375 | /* AES encryption/decryption using DMA ***************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 376 | HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 377 | HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 378 | HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 379 | HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 380 | HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 381 | HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 382 | /** |
sahilmgandhi | 18:6a4db94011d3 | 383 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 384 | */ |
sahilmgandhi | 18:6a4db94011d3 | 385 | |
sahilmgandhi | 18:6a4db94011d3 | 386 | /** @addtogroup CRYP_Exported_Functions_Group3 |
sahilmgandhi | 18:6a4db94011d3 | 387 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 388 | */ |
sahilmgandhi | 18:6a4db94011d3 | 389 | /* DES encryption/decryption using polling ***********************************/ |
sahilmgandhi | 18:6a4db94011d3 | 390 | HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 391 | HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 392 | HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 393 | HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 394 | |
sahilmgandhi | 18:6a4db94011d3 | 395 | /* DES encryption/decryption using interrupt *********************************/ |
sahilmgandhi | 18:6a4db94011d3 | 396 | HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 397 | HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 398 | HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 399 | HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 400 | |
sahilmgandhi | 18:6a4db94011d3 | 401 | /* DES encryption/decryption using DMA ***************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 402 | HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 403 | HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 404 | HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 405 | HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 406 | /** |
sahilmgandhi | 18:6a4db94011d3 | 407 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 408 | */ |
sahilmgandhi | 18:6a4db94011d3 | 409 | |
sahilmgandhi | 18:6a4db94011d3 | 410 | /** @addtogroup CRYP_Exported_Functions_Group4 |
sahilmgandhi | 18:6a4db94011d3 | 411 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 412 | */ |
sahilmgandhi | 18:6a4db94011d3 | 413 | /* TDES encryption/decryption using polling **********************************/ |
sahilmgandhi | 18:6a4db94011d3 | 414 | HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 415 | HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 416 | HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 417 | HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); |
sahilmgandhi | 18:6a4db94011d3 | 418 | |
sahilmgandhi | 18:6a4db94011d3 | 419 | /* TDES encryption/decryption using interrupt ********************************/ |
sahilmgandhi | 18:6a4db94011d3 | 420 | HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 421 | HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 422 | HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 423 | HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 424 | |
sahilmgandhi | 18:6a4db94011d3 | 425 | /* TDES encryption/decryption using DMA **************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 426 | HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 427 | HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 428 | HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); |
sahilmgandhi | 18:6a4db94011d3 | 429 | HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); |
sahilmgandhi | 18:6a4db94011d3 | 430 | /** |
sahilmgandhi | 18:6a4db94011d3 | 431 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 432 | */ |
sahilmgandhi | 18:6a4db94011d3 | 433 | |
sahilmgandhi | 18:6a4db94011d3 | 434 | /** @addtogroup CRYP_Exported_Functions_Group5 |
sahilmgandhi | 18:6a4db94011d3 | 435 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 436 | */ |
sahilmgandhi | 18:6a4db94011d3 | 437 | void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 438 | void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 439 | void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 440 | /** |
sahilmgandhi | 18:6a4db94011d3 | 441 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 442 | */ |
sahilmgandhi | 18:6a4db94011d3 | 443 | |
sahilmgandhi | 18:6a4db94011d3 | 444 | /** @addtogroup CRYP_Exported_Functions_Group6 |
sahilmgandhi | 18:6a4db94011d3 | 445 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 446 | */ |
sahilmgandhi | 18:6a4db94011d3 | 447 | void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 448 | /** |
sahilmgandhi | 18:6a4db94011d3 | 449 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 450 | */ |
sahilmgandhi | 18:6a4db94011d3 | 451 | |
sahilmgandhi | 18:6a4db94011d3 | 452 | /** @addtogroup CRYP_Exported_Functions_Group7 |
sahilmgandhi | 18:6a4db94011d3 | 453 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 454 | */ |
sahilmgandhi | 18:6a4db94011d3 | 455 | HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp); |
sahilmgandhi | 18:6a4db94011d3 | 456 | /** |
sahilmgandhi | 18:6a4db94011d3 | 457 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 458 | */ |
sahilmgandhi | 18:6a4db94011d3 | 459 | |
sahilmgandhi | 18:6a4db94011d3 | 460 | /** |
sahilmgandhi | 18:6a4db94011d3 | 461 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 462 | */ |
sahilmgandhi | 18:6a4db94011d3 | 463 | |
sahilmgandhi | 18:6a4db94011d3 | 464 | /* Private types -------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 465 | /** @defgroup CRYP_Private_Types CRYP Private Types |
sahilmgandhi | 18:6a4db94011d3 | 466 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 467 | */ |
sahilmgandhi | 18:6a4db94011d3 | 468 | |
sahilmgandhi | 18:6a4db94011d3 | 469 | /** |
sahilmgandhi | 18:6a4db94011d3 | 470 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 471 | */ |
sahilmgandhi | 18:6a4db94011d3 | 472 | |
sahilmgandhi | 18:6a4db94011d3 | 473 | /* Private variables ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 474 | /** @defgroup CRYP_Private_Variables CRYP Private Variables |
sahilmgandhi | 18:6a4db94011d3 | 475 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 476 | */ |
sahilmgandhi | 18:6a4db94011d3 | 477 | |
sahilmgandhi | 18:6a4db94011d3 | 478 | /** |
sahilmgandhi | 18:6a4db94011d3 | 479 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 480 | */ |
sahilmgandhi | 18:6a4db94011d3 | 481 | |
sahilmgandhi | 18:6a4db94011d3 | 482 | /* Private constants ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 483 | /** @defgroup CRYP_Private_Constants CRYP Private Constants |
sahilmgandhi | 18:6a4db94011d3 | 484 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 485 | */ |
sahilmgandhi | 18:6a4db94011d3 | 486 | #define CRYP_FLAG_MASK ((uint32_t)0x0000001FU) |
sahilmgandhi | 18:6a4db94011d3 | 487 | /** |
sahilmgandhi | 18:6a4db94011d3 | 488 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 489 | */ |
sahilmgandhi | 18:6a4db94011d3 | 490 | |
sahilmgandhi | 18:6a4db94011d3 | 491 | /* Private macros ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 492 | /** @defgroup CRYP_Private_Macros CRYP Private Macros |
sahilmgandhi | 18:6a4db94011d3 | 493 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 494 | */ |
sahilmgandhi | 18:6a4db94011d3 | 495 | |
sahilmgandhi | 18:6a4db94011d3 | 496 | #define IS_CRYP_KEYSIZE(__KEYSIZE__) (((__KEYSIZE__) == CRYP_KEYSIZE_128B) || \ |
sahilmgandhi | 18:6a4db94011d3 | 497 | ((__KEYSIZE__) == CRYP_KEYSIZE_192B) || \ |
sahilmgandhi | 18:6a4db94011d3 | 498 | ((__KEYSIZE__) == CRYP_KEYSIZE_256B)) |
sahilmgandhi | 18:6a4db94011d3 | 499 | |
sahilmgandhi | 18:6a4db94011d3 | 500 | |
sahilmgandhi | 18:6a4db94011d3 | 501 | #define IS_CRYP_DATATYPE(__DATATYPE__) (((__DATATYPE__) == CRYP_DATATYPE_32B) || \ |
sahilmgandhi | 18:6a4db94011d3 | 502 | ((__DATATYPE__) == CRYP_DATATYPE_16B) || \ |
sahilmgandhi | 18:6a4db94011d3 | 503 | ((__DATATYPE__) == CRYP_DATATYPE_8B) || \ |
sahilmgandhi | 18:6a4db94011d3 | 504 | ((__DATATYPE__) == CRYP_DATATYPE_1B)) |
sahilmgandhi | 18:6a4db94011d3 | 505 | |
sahilmgandhi | 18:6a4db94011d3 | 506 | |
sahilmgandhi | 18:6a4db94011d3 | 507 | /** |
sahilmgandhi | 18:6a4db94011d3 | 508 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 509 | */ |
sahilmgandhi | 18:6a4db94011d3 | 510 | |
sahilmgandhi | 18:6a4db94011d3 | 511 | /* Private functions ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 512 | /** @defgroup CRYP_Private_Functions CRYP Private Functions |
sahilmgandhi | 18:6a4db94011d3 | 513 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 514 | */ |
sahilmgandhi | 18:6a4db94011d3 | 515 | |
sahilmgandhi | 18:6a4db94011d3 | 516 | /** |
sahilmgandhi | 18:6a4db94011d3 | 517 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 518 | */ |
sahilmgandhi | 18:6a4db94011d3 | 519 | |
sahilmgandhi | 18:6a4db94011d3 | 520 | #endif /* STM32F215xx || STM32F217xx */ |
sahilmgandhi | 18:6a4db94011d3 | 521 | |
sahilmgandhi | 18:6a4db94011d3 | 522 | /** |
sahilmgandhi | 18:6a4db94011d3 | 523 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 524 | */ |
sahilmgandhi | 18:6a4db94011d3 | 525 | |
sahilmgandhi | 18:6a4db94011d3 | 526 | /** |
sahilmgandhi | 18:6a4db94011d3 | 527 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 528 | */ |
sahilmgandhi | 18:6a4db94011d3 | 529 | |
sahilmgandhi | 18:6a4db94011d3 | 530 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 531 | } |
sahilmgandhi | 18:6a4db94011d3 | 532 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 533 | |
sahilmgandhi | 18:6a4db94011d3 | 534 | #endif /* __STM32F2xx_HAL_CRYP_H */ |
sahilmgandhi | 18:6a4db94011d3 | 535 | |
sahilmgandhi | 18:6a4db94011d3 | 536 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |