![]() |
|
|||
File indexing completed on 2025-05-11 08:23:35
0001 /** 0002 ****************************************************************************** 0003 * @file stm32h7xx_hal_cryp.h 0004 * @author MCD Application Team 0005 * @brief Header file of CRYP HAL module. 0006 ****************************************************************************** 0007 * @attention 0008 * 0009 * Copyright (c) 2017 STMicroelectronics. 0010 * All rights reserved. 0011 * 0012 * This software is licensed under terms that can be found in the LICENSE file 0013 * in the root directory of this software component. 0014 * If no LICENSE file comes with this software, it is provided AS-IS. 0015 * 0016 ****************************************************************************** 0017 */ 0018 0019 /* Define to prevent recursive inclusion -------------------------------------*/ 0020 #ifndef STM32H7xx_HAL_CRYP_H 0021 #define STM32H7xx_HAL_CRYP_H 0022 0023 #ifdef __cplusplus 0024 extern "C" { 0025 #endif 0026 0027 0028 /* Includes ------------------------------------------------------------------*/ 0029 #include "stm32h7xx_hal_def.h" 0030 0031 /** @addtogroup STM32H7xx_HAL_Driver 0032 * @{ 0033 */ 0034 #if defined (CRYP) 0035 /** @addtogroup CRYP 0036 * @{ 0037 */ 0038 0039 /* Exported types ------------------------------------------------------------*/ 0040 /** @defgroup CRYP_Exported_Types CRYP Exported Types 0041 * @ingroup RTEMSBSPsARMSTM32H7 0042 * @{ 0043 */ 0044 0045 /** 0046 * @brief CRYP Init Structure definition 0047 */ 0048 0049 typedef struct 0050 { 0051 uint32_t DataType; /*!< no swap(32-bit data), halfword swap(16-bit data), byte swap(8-bit data) 0052 or bit swap(1-bit data).this parameter can be a value of @ref CRYP_Data_Type */ 0053 uint32_t KeySize; /*!< Used only in AES mode : 128, 192 or 256 bit key length in CRYP1. 0054 This parameter can be a value of @ref CRYP_Key_Size */ 0055 uint32_t *pKey; /*!< The key used for encryption/decryption */ 0056 uint32_t *pInitVect; /*!< The initialization vector used also as initialization 0057 counter in CTR mode */ 0058 uint32_t Algorithm; /*!< DES/ TDES Algorithm ECB/CBC 0059 AES Algorithm ECB/CBC/CTR/GCM or CCM 0060 This parameter can be a value of @ref CRYP_Algorithm_Mode */ 0061 uint32_t *Header; /*!< used only in AES GCM and CCM Algorithm for authentication, 0062 GCM : also known as Additional Authentication Data 0063 CCM : named B1 composed of the associated data length and Associated Data. */ 0064 uint32_t HeaderSize; /*!< The size of header buffer */ 0065 uint32_t *B0; /*!< B0 is first authentication block used only in AES CCM mode */ 0066 uint32_t DataWidthUnit; /*!< Payload data Width Unit, this parameter can be value of @ref CRYP_Data_Width_Unit*/ 0067 uint32_t HeaderWidthUnit; /*!< Header Width Unit, this parameter can be value of @ref CRYP_Header_Width_Unit*/ 0068 uint32_t KeyIVConfigSkip; /*!< CRYP peripheral Key and IV configuration skip, to configure Key and Initialization 0069 Vector only once and to skip configuration for consecutive processing. 0070 This parameter can be a value of @ref CRYP_Configuration_Skip */ 0071 0072 } CRYP_ConfigTypeDef; 0073 0074 0075 /** 0076 * @brief CRYP State Structure definition 0077 */ 0078 0079 typedef enum 0080 { 0081 HAL_CRYP_STATE_RESET = 0x00U, /*!< CRYP not yet initialized or disabled */ 0082 HAL_CRYP_STATE_READY = 0x01U, /*!< CRYP initialized and ready for use */ 0083 HAL_CRYP_STATE_BUSY = 0x02U /*!< CRYP BUSY, internal processing is ongoing */ 0084 } HAL_CRYP_STATETypeDef; 0085 0086 0087 /** 0088 * @brief CRYP handle Structure definition 0089 */ 0090 0091 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 0092 typedef struct __CRYP_HandleTypeDef 0093 #else 0094 typedef struct 0095 #endif /* (USE_HAL_CRYP_REGISTER_CALLBACKS) */ 0096 { 0097 0098 CRYP_TypeDef *Instance; /*!< CRYP registers base address */ 0099 0100 CRYP_ConfigTypeDef Init; /*!< CRYP required parameters */ 0101 0102 uint32_t *pCrypInBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ 0103 0104 uint32_t *pCrypOutBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ 0105 0106 __IO uint16_t CrypHeaderCount; /*!< Counter of header data */ 0107 0108 __IO uint16_t CrypInCount; /*!< Counter of input data */ 0109 0110 __IO uint16_t CrypOutCount; /*!< Counter of output data */ 0111 0112 uint16_t Size; /*!< length of input data in word or in byte, according to DataWidthUnit */ 0113 0114 uint32_t Phase; /*!< CRYP peripheral phase */ 0115 0116 DMA_HandleTypeDef *hdmain; /*!< CRYP In DMA handle parameters */ 0117 0118 DMA_HandleTypeDef *hdmaout; /*!< CRYP Out DMA handle parameters */ 0119 0120 HAL_LockTypeDef Lock; /*!< CRYP locking object */ 0121 0122 __IO HAL_CRYP_STATETypeDef State; /*!< CRYP peripheral state */ 0123 0124 __IO uint32_t ErrorCode; /*!< CRYP peripheral error code */ 0125 0126 uint32_t Version; /*!< CRYP1 IP version*/ 0127 0128 uint32_t KeyIVConfig; /*!< CRYP peripheral Key and IV configuration flag, used when 0129 configuration can be skipped */ 0130 0131 uint32_t SizesSum; /*!< Sum of successive payloads lengths (in bytes), stored 0132 for a single signature computation after several 0133 messages processing */ 0134 0135 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 0136 void (*InCpltCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Input FIFO transfer completed callback */ 0137 void (*OutCpltCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Output FIFO transfer completed callback */ 0138 void (*ErrorCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Error callback */ 0139 0140 void (* MspInitCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Msp Init callback */ 0141 void (* MspDeInitCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Msp DeInit callback */ 0142 0143 #endif /* (USE_HAL_CRYP_REGISTER_CALLBACKS) */ 0144 0145 } CRYP_HandleTypeDef; 0146 0147 0148 /** 0149 * @} 0150 */ 0151 0152 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 0153 /** @defgroup HAL_CRYP_Callback_ID_enumeration_definition HAL CRYP Callback ID enumeration definition 0154 * @ingroup RTEMSBSPsARMSTM32H7 0155 * @brief HAL CRYP Callback ID enumeration definition 0156 * @{ 0157 */ 0158 typedef enum 0159 { 0160 HAL_CRYP_INPUT_COMPLETE_CB_ID = 0x01U, /*!< CRYP Input FIFO transfer completed callback ID */ 0161 HAL_CRYP_OUTPUT_COMPLETE_CB_ID = 0x02U, /*!< CRYP Output FIFO transfer completed callback ID */ 0162 HAL_CRYP_ERROR_CB_ID = 0x03U, /*!< CRYP Error callback ID */ 0163 0164 HAL_CRYP_MSPINIT_CB_ID = 0x04U, /*!< CRYP MspInit callback ID */ 0165 HAL_CRYP_MSPDEINIT_CB_ID = 0x05U /*!< CRYP MspDeInit callback ID */ 0166 0167 } HAL_CRYP_CallbackIDTypeDef; 0168 /** 0169 * @} 0170 */ 0171 0172 /** @defgroup HAL_CRYP_Callback_pointer_definition HAL CRYP Callback pointer definition 0173 * @ingroup RTEMSBSPsARMSTM32H7 0174 * @brief HAL CRYP Callback pointer definition 0175 * @{ 0176 */ 0177 0178 typedef void (*pCRYP_CallbackTypeDef)(CRYP_HandleTypeDef *hcryp); /*!< pointer to a common CRYP callback function */ 0179 0180 /** 0181 * @} 0182 */ 0183 0184 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 0185 0186 /* Exported constants --------------------------------------------------------*/ 0187 /** @defgroup CRYP_Exported_Constants CRYP Exported Constants 0188 * @ingroup RTEMSBSPsARMSTM32H7 0189 * @{ 0190 */ 0191 0192 /** @defgroup CRYP_Error_Definition CRYP Error Definition 0193 * @ingroup RTEMSBSPsARMSTM32H7 0194 * @{ 0195 */ 0196 #define HAL_CRYP_ERROR_NONE 0x00000000U /*!< No error */ 0197 #define HAL_CRYP_ERROR_WRITE 0x00000001U /*!< Write error */ 0198 #define HAL_CRYP_ERROR_READ 0x00000002U /*!< Read error */ 0199 #define HAL_CRYP_ERROR_DMA 0x00000004U /*!< DMA error */ 0200 #define HAL_CRYP_ERROR_BUSY 0x00000008U /*!< Busy flag error */ 0201 #define HAL_CRYP_ERROR_TIMEOUT 0x00000010U /*!< Timeout error */ 0202 #define HAL_CRYP_ERROR_NOT_SUPPORTED 0x00000020U /*!< Not supported mode */ 0203 #define HAL_CRYP_ERROR_AUTH_TAG_SEQUENCE 0x00000040U /*!< Sequence are not respected only for GCM or CCM */ 0204 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 0205 #define HAL_CRYP_ERROR_INVALID_CALLBACK ((uint32_t)0x00000080U) /*!< Invalid Callback error */ 0206 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 0207 0208 /** 0209 * @} 0210 */ 0211 0212 0213 /** @defgroup CRYP_Data_Width_Unit CRYP Data Width Unit 0214 * @ingroup RTEMSBSPsARMSTM32H7 0215 * @{ 0216 */ 0217 0218 #define CRYP_DATAWIDTHUNIT_WORD 0x00000000U /*!< By default, size unit is word */ 0219 #define CRYP_DATAWIDTHUNIT_BYTE 0x00000001U /*!< Size unit is byte, but all input will be loaded in HW CRYPT IP by block of 4 words */ 0220 0221 /** 0222 * @} 0223 */ 0224 0225 /** @defgroup CRYP_Header_Width_Unit CRYP Header Width Unit 0226 * @ingroup RTEMSBSPsARMSTM32H7 0227 * @{ 0228 */ 0229 0230 #define CRYP_HEADERWIDTHUNIT_WORD 0x00000000U /*!< By default, header size unit is word */ 0231 #define CRYP_HEADERWIDTHUNIT_BYTE 0x00000001U /*!< Size unit is byte, but all input will be loaded in HW CRYPT IP by block of 4 words */ 0232 0233 /** 0234 * @} 0235 */ 0236 0237 /** @defgroup CRYP_Algorithm_Mode CRYP Algorithm Mode 0238 * @ingroup RTEMSBSPsARMSTM32H7 0239 * @{ 0240 */ 0241 0242 #define CRYP_DES_ECB CRYP_CR_ALGOMODE_DES_ECB 0243 #define CRYP_DES_CBC CRYP_CR_ALGOMODE_DES_CBC 0244 #define CRYP_TDES_ECB CRYP_CR_ALGOMODE_TDES_ECB 0245 #define CRYP_TDES_CBC CRYP_CR_ALGOMODE_TDES_CBC 0246 #define CRYP_AES_ECB CRYP_CR_ALGOMODE_AES_ECB 0247 #define CRYP_AES_CBC CRYP_CR_ALGOMODE_AES_CBC 0248 #define CRYP_AES_CTR CRYP_CR_ALGOMODE_AES_CTR 0249 #define CRYP_AES_GCM CRYP_CR_ALGOMODE_AES_GCM 0250 #define CRYP_AES_CCM CRYP_CR_ALGOMODE_AES_CCM 0251 0252 /** 0253 * @} 0254 */ 0255 0256 /** @defgroup CRYP_Key_Size CRYP Key Size 0257 * @ingroup RTEMSBSPsARMSTM32H7 0258 * @{ 0259 */ 0260 0261 #define CRYP_KEYSIZE_128B 0x00000000U 0262 #define CRYP_KEYSIZE_192B CRYP_CR_KEYSIZE_0 0263 #define CRYP_KEYSIZE_256B CRYP_CR_KEYSIZE_1 0264 0265 /** 0266 * @} 0267 */ 0268 0269 /** @defgroup CRYP_Data_Type CRYP Data Type 0270 * @ingroup RTEMSBSPsARMSTM32H7 0271 * @{ 0272 */ 0273 0274 #define CRYP_NO_SWAP 0x00000000U 0275 #define CRYP_HALFWORD_SWAP CRYP_CR_DATATYPE_0 0276 #define CRYP_BYTE_SWAP CRYP_CR_DATATYPE_1 0277 #define CRYP_BIT_SWAP CRYP_CR_DATATYPE 0278 0279 /** 0280 * @} 0281 */ 0282 0283 /** @defgroup CRYP_Interrupt CRYP Interrupt 0284 * @ingroup RTEMSBSPsARMSTM32H7 0285 * @{ 0286 */ 0287 0288 #define CRYP_IT_INI CRYP_IMSCR_INIM /*!< Input FIFO Interrupt */ 0289 #define CRYP_IT_OUTI CRYP_IMSCR_OUTIM /*!< Output FIFO Interrupt */ 0290 0291 /** 0292 * @} 0293 */ 0294 0295 /** @defgroup CRYP_Flags CRYP Flags 0296 * @ingroup RTEMSBSPsARMSTM32H7 0297 * @{ 0298 */ 0299 0300 /* Flags in the SR register */ 0301 #define CRYP_FLAG_IFEM CRYP_SR_IFEM /*!< Input FIFO is empty */ 0302 #define CRYP_FLAG_IFNF CRYP_SR_IFNF /*!< Input FIFO is not Full */ 0303 #define CRYP_FLAG_OFNE CRYP_SR_OFNE /*!< Output FIFO is not empty */ 0304 #define CRYP_FLAG_OFFU CRYP_SR_OFFU /*!< Output FIFO is Full */ 0305 #define CRYP_FLAG_BUSY CRYP_SR_BUSY /*!< The CRYP core is currently processing a block of data 0306 or a key preparation (for AES decryption). */ 0307 /* Flags in the RISR register */ 0308 #define CRYP_FLAG_OUTRIS 0x01000002U /*!< Output FIFO service raw interrupt status */ 0309 #define CRYP_FLAG_INRIS 0x01000001U /*!< Input FIFO service raw interrupt status*/ 0310 0311 /** 0312 * @} 0313 */ 0314 0315 /** @defgroup CRYP_Configuration_Skip CRYP Key and IV Configuration Skip Mode 0316 * @ingroup RTEMSBSPsARMSTM32H7 0317 * @{ 0318 */ 0319 0320 #define CRYP_KEYIVCONFIG_ALWAYS 0x00000000U /*!< Peripheral Key and IV configuration to do systematically */ 0321 #define CRYP_KEYIVCONFIG_ONCE 0x00000001U /*!< Peripheral Key and IV configuration to do only once */ 0322 0323 /** 0324 * @} 0325 */ 0326 0327 /** 0328 * @} 0329 */ 0330 0331 /* Exported macros -----------------------------------------------------------*/ 0332 /** @defgroup CRYP_Exported_Macros CRYP Exported Macros 0333 * @ingroup RTEMSBSPsARMSTM32H7 0334 * @{ 0335 */ 0336 0337 /** @brief Reset CRYP handle state 0338 * @param __HANDLE__ specifies the CRYP handle. 0339 * @retval None 0340 */ 0341 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 0342 #define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__) do{\ 0343 (__HANDLE__)->State = HAL_CRYP_STATE_RESET;\ 0344 (__HANDLE__)->MspInitCallback = NULL;\ 0345 (__HANDLE__)->MspDeInitCallback = NULL;\ 0346 }while(0) 0347 #else 0348 #define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__) ( (__HANDLE__)->State = HAL_CRYP_STATE_RESET) 0349 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 0350 0351 /** 0352 * @brief Enable/Disable the CRYP peripheral. 0353 * @param __HANDLE__: specifies the CRYP handle. 0354 * @retval None 0355 */ 0356 0357 #define __HAL_CRYP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRYP_CR_CRYPEN) 0358 #define __HAL_CRYP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~CRYP_CR_CRYPEN) 0359 0360 /** @brief Check whether the specified CRYP status flag is set or not. 0361 * @param __FLAG__: specifies the flag to check. 0362 * This parameter can be one of the following values for CRYP: 0363 * @arg CRYP_FLAG_BUSY: The CRYP core is currently processing a block of data 0364 * or a key preparation (for AES decryption). 0365 * @arg CRYP_FLAG_IFEM: Input FIFO is empty 0366 * @arg CRYP_FLAG_IFNF: Input FIFO is not full 0367 * @arg CRYP_FLAG_INRIS: Input FIFO service raw interrupt is pending 0368 * @arg CRYP_FLAG_OFNE: Output FIFO is not empty 0369 * @arg CRYP_FLAG_OFFU: Output FIFO is full 0370 * @arg CRYP_FLAG_OUTRIS: Input FIFO service raw interrupt is pending 0371 * @retval The state of __FLAG__ (TRUE or FALSE). 0372 */ 0373 #define CRYP_FLAG_MASK 0x0000001FU 0374 0375 #define __HAL_CRYP_GET_FLAG(__HANDLE__, __FLAG__)\ 0376 ((((uint8_t)((__FLAG__) >> 24)) == 0x01U)?((((__HANDLE__)->Instance->RISR) &\ 0377 ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK)): \ 0378 ((((__HANDLE__)->Instance->RISR) &\ 0379 ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK))) 0380 0381 /** @brief Check whether the specified CRYP interrupt is set or not. 0382 * @param __HANDLE__: specifies the CRYP handle. 0383 * @param __INTERRUPT__: specifies the interrupt to check. 0384 * This parameter can be one of the following values for CRYP: 0385 * @arg CRYP_IT_INI: Input FIFO service masked interrupt status 0386 * @arg CRYP_IT_OUTI: Output FIFO service masked interrupt status 0387 * @retval The state of __INTERRUPT__ (TRUE or FALSE). 0388 */ 0389 0390 #define __HAL_CRYP_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->MISR &\ 0391 (__INTERRUPT__)) == (__INTERRUPT__)) 0392 0393 /** 0394 * @brief Enable the CRYP interrupt. 0395 * @param __HANDLE__: specifies the CRYP handle. 0396 * @param __INTERRUPT__: CRYP Interrupt. 0397 * This parameter can be one of the following values for CRYP: 0398 * @ CRYP_IT_INI : Input FIFO service interrupt mask. 0399 * @ CRYP_IT_OUTI : Output FIFO service interrupt mask.CRYP interrupt. 0400 * @retval None 0401 */ 0402 0403 #define __HAL_CRYP_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) |= (__INTERRUPT__)) 0404 0405 /** 0406 * @brief Disable the CRYP interrupt. 0407 * @param __HANDLE__: specifies the CRYP handle. 0408 * @param __INTERRUPT__: CRYP Interrupt. 0409 * This parameter can be one of the following values for CRYP: 0410 * @ CRYP_IT_INI : Input FIFO service interrupt mask. 0411 * @ CRYP_IT_OUTI : Output FIFO service interrupt mask.CRYP interrupt. 0412 * @retval None 0413 */ 0414 0415 #define __HAL_CRYP_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) &= ~(__INTERRUPT__)) 0416 0417 /** 0418 * @} 0419 */ 0420 0421 /* Include CRYP HAL Extended module */ 0422 #include "stm32h7xx_hal_cryp_ex.h" 0423 0424 /* Exported functions --------------------------------------------------------*/ 0425 /** @defgroup CRYP_Exported_Functions CRYP Exported Functions 0426 * @ingroup RTEMSBSPsARMSTM32H7 0427 * @{ 0428 */ 0429 0430 /** @addtogroup CRYP_Exported_Functions_Group1 0431 * @{ 0432 */ 0433 HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp); 0434 HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp); 0435 void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); 0436 void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); 0437 HAL_StatusTypeDef HAL_CRYP_SetConfig(CRYP_HandleTypeDef *hcryp, CRYP_ConfigTypeDef *pConf); 0438 HAL_StatusTypeDef HAL_CRYP_GetConfig(CRYP_HandleTypeDef *hcryp, CRYP_ConfigTypeDef *pConf); 0439 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 0440 HAL_StatusTypeDef HAL_CRYP_RegisterCallback(CRYP_HandleTypeDef *hcryp, HAL_CRYP_CallbackIDTypeDef CallbackID, 0441 pCRYP_CallbackTypeDef pCallback); 0442 HAL_StatusTypeDef HAL_CRYP_UnRegisterCallback(CRYP_HandleTypeDef *hcryp, HAL_CRYP_CallbackIDTypeDef CallbackID); 0443 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 0444 /** 0445 * @} 0446 */ 0447 0448 /** @addtogroup CRYP_Exported_Functions_Group2 0449 * @{ 0450 */ 0451 0452 /* encryption/decryption ***********************************/ 0453 HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output, 0454 uint32_t Timeout); 0455 HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output, 0456 uint32_t Timeout); 0457 HAL_StatusTypeDef HAL_CRYP_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 0458 HAL_StatusTypeDef HAL_CRYP_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 0459 HAL_StatusTypeDef HAL_CRYP_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 0460 HAL_StatusTypeDef HAL_CRYP_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 0461 0462 /** 0463 * @} 0464 */ 0465 0466 0467 /** @addtogroup CRYP_Exported_Functions_Group3 0468 * @{ 0469 */ 0470 /* Interrupt Handler functions **********************************************/ 0471 void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp); 0472 HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp); 0473 void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); 0474 void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); 0475 void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); 0476 uint32_t HAL_CRYP_GetError(CRYP_HandleTypeDef *hcryp); 0477 0478 /** 0479 * @} 0480 */ 0481 0482 /** 0483 * @} 0484 */ 0485 0486 /* Private macros --------------------------------------------------------*/ 0487 /** @defgroup CRYP_Private_Macros CRYP Private Macros 0488 * @ingroup RTEMSBSPsARMSTM32H7 0489 * @{ 0490 */ 0491 0492 /** @defgroup CRYP_IS_CRYP_Definitions CRYP Private macros to check input parameters 0493 * @ingroup RTEMSBSPsARMSTM32H7 0494 * @{ 0495 */ 0496 0497 #define IS_CRYP_ALGORITHM(ALGORITHM) (((ALGORITHM) == CRYP_DES_ECB) || \ 0498 ((ALGORITHM) == CRYP_DES_CBC) || \ 0499 ((ALGORITHM) == CRYP_TDES_ECB) || \ 0500 ((ALGORITHM) == CRYP_TDES_CBC) || \ 0501 ((ALGORITHM) == CRYP_AES_ECB) || \ 0502 ((ALGORITHM) == CRYP_AES_CBC) || \ 0503 ((ALGORITHM) == CRYP_AES_CTR) || \ 0504 ((ALGORITHM) == CRYP_AES_GCM) || \ 0505 ((ALGORITHM) == CRYP_AES_CCM)) 0506 0507 #define IS_CRYP_KEYSIZE(KEYSIZE)(((KEYSIZE) == CRYP_KEYSIZE_128B) || \ 0508 ((KEYSIZE) == CRYP_KEYSIZE_192B) || \ 0509 ((KEYSIZE) == CRYP_KEYSIZE_256B)) 0510 0511 #define IS_CRYP_DATATYPE(DATATYPE)(((DATATYPE) == CRYP_NO_SWAP) || \ 0512 ((DATATYPE) == CRYP_HALFWORD_SWAP) || \ 0513 ((DATATYPE) == CRYP_BYTE_SWAP) || \ 0514 ((DATATYPE) == CRYP_BIT_SWAP)) 0515 0516 #define IS_CRYP_INIT(CONFIG)(((CONFIG) == CRYP_KEYIVCONFIG_ALWAYS) || \ 0517 ((CONFIG) == CRYP_KEYIVCONFIG_ONCE)) 0518 0519 /** 0520 * @} 0521 */ 0522 0523 /** 0524 * @} 0525 */ 0526 0527 0528 /* Private constants ---------------------------------------------------------*/ 0529 /** @defgroup CRYP_Private_Constants CRYP Private Constants 0530 * @ingroup RTEMSBSPsARMSTM32H7 0531 * @{ 0532 */ 0533 0534 /** 0535 * @} 0536 */ 0537 /* Private defines -----------------------------------------------------------*/ 0538 /** @defgroup CRYP_Private_Defines CRYP Private Defines 0539 * @ingroup RTEMSBSPsARMSTM32H7 0540 * @{ 0541 */ 0542 0543 /** 0544 * @} 0545 */ 0546 0547 /* Private variables ---------------------------------------------------------*/ 0548 /** @defgroup CRYP_Private_Variables CRYP Private Variables 0549 * @ingroup RTEMSBSPsARMSTM32H7 0550 * @{ 0551 */ 0552 0553 /** 0554 * @} 0555 */ 0556 /* Private functions prototypes ----------------------------------------------*/ 0557 /** @defgroup CRYP_Private_Functions_Prototypes CRYP Private Functions Prototypes 0558 * @ingroup RTEMSBSPsARMSTM32H7 0559 * @{ 0560 */ 0561 0562 /** 0563 * @} 0564 */ 0565 0566 /* Private functions ---------------------------------------------------------*/ 0567 /** @defgroup CRYP_Private_Functions CRYP Private Functions 0568 * @ingroup RTEMSBSPsARMSTM32H7 0569 * @{ 0570 */ 0571 0572 /** 0573 * @} 0574 */ 0575 0576 0577 /** 0578 * @} 0579 */ 0580 0581 0582 #endif /* CRYP */ 0583 /** 0584 * @} 0585 */ 0586 0587 #ifdef __cplusplus 0588 } 0589 #endif 0590 0591 #endif /* STM32H7xx_HAL_CRYP_H */ 0592
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |