1 /** 2 ****************************************************************************** 3 * @file stm32h7xx_hal_cryp.h 4 * @author MCD Application Team 5 * @brief Header file of CRYP HAL module. 6 ****************************************************************************** 7 * @attention 8 * 9 * Copyright (c) 2017 STMicroelectronics. 10 * All rights reserved. 11 * 12 * This software is licensed under terms that can be found in the LICENSE file 13 * in the root directory of this software component. 14 * If no LICENSE file comes with this software, it is provided AS-IS. 15 * 16 ****************************************************************************** 17 */ 18 19 /* Define to prevent recursive inclusion -------------------------------------*/ 20 #ifndef STM32H7xx_HAL_CRYP_H 21 #define STM32H7xx_HAL_CRYP_H 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 28 /* Includes ------------------------------------------------------------------*/ 29 #include "stm32h7xx_hal_def.h" 30 31 /** @addtogroup STM32H7xx_HAL_Driver 32 * @{ 33 */ 34 #if defined (CRYP) 35 /** @addtogroup CRYP 36 * @{ 37 */ 38 39 /* Exported types ------------------------------------------------------------*/ 40 /** @defgroup CRYP_Exported_Types CRYP Exported Types 41 * @{ 42 */ 43 44 /** 45 * @brief CRYP Init Structure definition 46 */ 47 48 typedef struct 49 { 50 uint32_t DataType; /*!< no swap(32-bit data), halfword swap(16-bit data), byte swap(8-bit data) 51 or bit swap(1-bit data).this parameter can be a value of @ref CRYP_Data_Type */ 52 uint32_t KeySize; /*!< Used only in AES mode : 128, 192 or 256 bit key length in CRYP1. 53 This parameter can be a value of @ref CRYP_Key_Size */ 54 uint32_t *pKey; /*!< The key used for encryption/decryption */ 55 uint32_t *pInitVect; /*!< The initialization vector used also as initialization 56 counter in CTR mode */ 57 uint32_t Algorithm; /*!< DES/ TDES Algorithm ECB/CBC 58 AES Algorithm ECB/CBC/CTR/GCM or CCM 59 This parameter can be a value of @ref CRYP_Algorithm_Mode */ 60 uint32_t *Header; /*!< used only in AES GCM and CCM Algorithm for authentication, 61 GCM : also known as Additional Authentication Data 62 CCM : named B1 composed of the associated data length and Associated Data. */ 63 uint32_t HeaderSize; /*!< The size of header buffer */ 64 uint32_t *B0; /*!< B0 is first authentication block used only in AES CCM mode */ 65 uint32_t DataWidthUnit; /*!< Payload data Width Unit, this parameter can be value of @ref CRYP_Data_Width_Unit*/ 66 uint32_t HeaderWidthUnit; /*!< Header Width Unit, this parameter can be value of @ref CRYP_Header_Width_Unit*/ 67 uint32_t KeyIVConfigSkip; /*!< CRYP peripheral Key and IV configuration skip, to configure Key and Initialization 68 Vector only once and to skip configuration for consecutive processing. 69 This parameter can be a value of @ref CRYP_Configuration_Skip */ 70 71 } CRYP_ConfigTypeDef; 72 73 74 /** 75 * @brief CRYP State Structure definition 76 */ 77 78 typedef enum 79 { 80 HAL_CRYP_STATE_RESET = 0x00U, /*!< CRYP not yet initialized or disabled */ 81 HAL_CRYP_STATE_READY = 0x01U, /*!< CRYP initialized and ready for use */ 82 HAL_CRYP_STATE_BUSY = 0x02U /*!< CRYP BUSY, internal processing is ongoing */ 83 } HAL_CRYP_STATETypeDef; 84 85 86 /** 87 * @brief CRYP handle Structure definition 88 */ 89 90 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 91 typedef struct __CRYP_HandleTypeDef 92 #else 93 typedef struct 94 #endif /* (USE_HAL_CRYP_REGISTER_CALLBACKS) */ 95 { 96 97 CRYP_TypeDef *Instance; /*!< CRYP registers base address */ 98 99 CRYP_ConfigTypeDef Init; /*!< CRYP required parameters */ 100 101 uint32_t *pCrypInBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ 102 103 uint32_t *pCrypOutBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ 104 105 __IO uint16_t CrypHeaderCount; /*!< Counter of header data */ 106 107 __IO uint16_t CrypInCount; /*!< Counter of input data */ 108 109 __IO uint16_t CrypOutCount; /*!< Counter of output data */ 110 111 uint16_t Size; /*!< length of input data in word or in byte, according to DataWidthUnit */ 112 113 uint32_t Phase; /*!< CRYP peripheral phase */ 114 115 DMA_HandleTypeDef *hdmain; /*!< CRYP In DMA handle parameters */ 116 117 DMA_HandleTypeDef *hdmaout; /*!< CRYP Out DMA handle parameters */ 118 119 HAL_LockTypeDef Lock; /*!< CRYP locking object */ 120 121 __IO HAL_CRYP_STATETypeDef State; /*!< CRYP peripheral state */ 122 123 __IO uint32_t ErrorCode; /*!< CRYP peripheral error code */ 124 125 uint32_t Version; /*!< CRYP1 IP version*/ 126 127 uint32_t KeyIVConfig; /*!< CRYP peripheral Key and IV configuration flag, used when 128 configuration can be skipped */ 129 130 uint32_t SizesSum; /*!< Sum of successive payloads lengths (in bytes), stored 131 for a single signature computation after several 132 messages processing */ 133 134 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 135 void (*InCpltCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Input FIFO transfer completed callback */ 136 void (*OutCpltCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Output FIFO transfer completed callback */ 137 void (*ErrorCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Error callback */ 138 139 void (* MspInitCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Msp Init callback */ 140 void (* MspDeInitCallback)(struct __CRYP_HandleTypeDef *hcryp); /*!< CRYP Msp DeInit callback */ 141 142 #endif /* (USE_HAL_CRYP_REGISTER_CALLBACKS) */ 143 144 } CRYP_HandleTypeDef; 145 146 147 /** 148 * @} 149 */ 150 151 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 152 /** @defgroup HAL_CRYP_Callback_ID_enumeration_definition HAL CRYP Callback ID enumeration definition 153 * @brief HAL CRYP Callback ID enumeration definition 154 * @{ 155 */ 156 typedef enum 157 { 158 HAL_CRYP_INPUT_COMPLETE_CB_ID = 0x01U, /*!< CRYP Input FIFO transfer completed callback ID */ 159 HAL_CRYP_OUTPUT_COMPLETE_CB_ID = 0x02U, /*!< CRYP Output FIFO transfer completed callback ID */ 160 HAL_CRYP_ERROR_CB_ID = 0x03U, /*!< CRYP Error callback ID */ 161 162 HAL_CRYP_MSPINIT_CB_ID = 0x04U, /*!< CRYP MspInit callback ID */ 163 HAL_CRYP_MSPDEINIT_CB_ID = 0x05U /*!< CRYP MspDeInit callback ID */ 164 165 } HAL_CRYP_CallbackIDTypeDef; 166 /** 167 * @} 168 */ 169 170 /** @defgroup HAL_CRYP_Callback_pointer_definition HAL CRYP Callback pointer definition 171 * @brief HAL CRYP Callback pointer definition 172 * @{ 173 */ 174 175 typedef void (*pCRYP_CallbackTypeDef)(CRYP_HandleTypeDef *hcryp); /*!< pointer to a common CRYP callback function */ 176 177 /** 178 * @} 179 */ 180 181 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 182 183 /* Exported constants --------------------------------------------------------*/ 184 /** @defgroup CRYP_Exported_Constants CRYP Exported Constants 185 * @{ 186 */ 187 188 /** @defgroup CRYP_Error_Definition CRYP Error Definition 189 * @{ 190 */ 191 #define HAL_CRYP_ERROR_NONE 0x00000000U /*!< No error */ 192 #define HAL_CRYP_ERROR_WRITE 0x00000001U /*!< Write error */ 193 #define HAL_CRYP_ERROR_READ 0x00000002U /*!< Read error */ 194 #define HAL_CRYP_ERROR_DMA 0x00000004U /*!< DMA error */ 195 #define HAL_CRYP_ERROR_BUSY 0x00000008U /*!< Busy flag error */ 196 #define HAL_CRYP_ERROR_TIMEOUT 0x00000010U /*!< Timeout error */ 197 #define HAL_CRYP_ERROR_NOT_SUPPORTED 0x00000020U /*!< Not supported mode */ 198 #define HAL_CRYP_ERROR_AUTH_TAG_SEQUENCE 0x00000040U /*!< Sequence are not respected only for GCM or CCM */ 199 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 200 #define HAL_CRYP_ERROR_INVALID_CALLBACK ((uint32_t)0x00000080U) /*!< Invalid Callback error */ 201 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 202 203 /** 204 * @} 205 */ 206 207 208 /** @defgroup CRYP_Data_Width_Unit CRYP Data Width Unit 209 * @{ 210 */ 211 212 #define CRYP_DATAWIDTHUNIT_WORD 0x00000000U /*!< By default, size unit is word */ 213 #define CRYP_DATAWIDTHUNIT_BYTE 0x00000001U /*!< Size unit is byte, but all input will be loaded in HW CRYPT IP by block of 4 words */ 214 215 /** 216 * @} 217 */ 218 219 /** @defgroup CRYP_Header_Width_Unit CRYP Header Width Unit 220 * @{ 221 */ 222 223 #define CRYP_HEADERWIDTHUNIT_WORD 0x00000000U /*!< By default, header size unit is word */ 224 #define CRYP_HEADERWIDTHUNIT_BYTE 0x00000001U /*!< Size unit is byte, but all input will be loaded in HW CRYPT IP by block of 4 words */ 225 226 /** 227 * @} 228 */ 229 230 /** @defgroup CRYP_Algorithm_Mode CRYP Algorithm Mode 231 * @{ 232 */ 233 234 #define CRYP_DES_ECB CRYP_CR_ALGOMODE_DES_ECB 235 #define CRYP_DES_CBC CRYP_CR_ALGOMODE_DES_CBC 236 #define CRYP_TDES_ECB CRYP_CR_ALGOMODE_TDES_ECB 237 #define CRYP_TDES_CBC CRYP_CR_ALGOMODE_TDES_CBC 238 #define CRYP_AES_ECB CRYP_CR_ALGOMODE_AES_ECB 239 #define CRYP_AES_CBC CRYP_CR_ALGOMODE_AES_CBC 240 #define CRYP_AES_CTR CRYP_CR_ALGOMODE_AES_CTR 241 #define CRYP_AES_GCM CRYP_CR_ALGOMODE_AES_GCM 242 #define CRYP_AES_CCM CRYP_CR_ALGOMODE_AES_CCM 243 244 /** 245 * @} 246 */ 247 248 /** @defgroup CRYP_Key_Size CRYP Key Size 249 * @{ 250 */ 251 252 #define CRYP_KEYSIZE_128B 0x00000000U 253 #define CRYP_KEYSIZE_192B CRYP_CR_KEYSIZE_0 254 #define CRYP_KEYSIZE_256B CRYP_CR_KEYSIZE_1 255 256 /** 257 * @} 258 */ 259 260 /** @defgroup CRYP_Data_Type CRYP Data Type 261 * @{ 262 */ 263 264 #define CRYP_NO_SWAP 0x00000000U 265 #define CRYP_HALFWORD_SWAP CRYP_CR_DATATYPE_0 266 #define CRYP_BYTE_SWAP CRYP_CR_DATATYPE_1 267 #define CRYP_BIT_SWAP CRYP_CR_DATATYPE 268 269 /** 270 * @} 271 */ 272 273 /** @defgroup CRYP_Interrupt CRYP Interrupt 274 * @{ 275 */ 276 277 #define CRYP_IT_INI CRYP_IMSCR_INIM /*!< Input FIFO Interrupt */ 278 #define CRYP_IT_OUTI CRYP_IMSCR_OUTIM /*!< Output FIFO Interrupt */ 279 280 /** 281 * @} 282 */ 283 284 /** @defgroup CRYP_Flags CRYP Flags 285 * @{ 286 */ 287 288 /* Flags in the SR register */ 289 #define CRYP_FLAG_IFEM CRYP_SR_IFEM /*!< Input FIFO is empty */ 290 #define CRYP_FLAG_IFNF CRYP_SR_IFNF /*!< Input FIFO is not Full */ 291 #define CRYP_FLAG_OFNE CRYP_SR_OFNE /*!< Output FIFO is not empty */ 292 #define CRYP_FLAG_OFFU CRYP_SR_OFFU /*!< Output FIFO is Full */ 293 #define CRYP_FLAG_BUSY CRYP_SR_BUSY /*!< The CRYP core is currently processing a block of data 294 or a key preparation (for AES decryption). */ 295 /* Flags in the RISR register */ 296 #define CRYP_FLAG_OUTRIS 0x01000002U /*!< Output FIFO service raw interrupt status */ 297 #define CRYP_FLAG_INRIS 0x01000001U /*!< Input FIFO service raw interrupt status*/ 298 299 /** 300 * @} 301 */ 302 303 /** @defgroup CRYP_Configuration_Skip CRYP Key and IV Configuration Skip Mode 304 * @{ 305 */ 306 307 #define CRYP_KEYIVCONFIG_ALWAYS 0x00000000U /*!< Peripheral Key and IV configuration to do systematically */ 308 #define CRYP_KEYIVCONFIG_ONCE 0x00000001U /*!< Peripheral Key and IV configuration to do only once */ 309 310 /** 311 * @} 312 */ 313 314 /** 315 * @} 316 */ 317 318 /* Exported macros -----------------------------------------------------------*/ 319 /** @defgroup CRYP_Exported_Macros CRYP Exported Macros 320 * @{ 321 */ 322 323 /** @brief Reset CRYP handle state 324 * @param __HANDLE__ specifies the CRYP handle. 325 * @retval None 326 */ 327 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 328 #define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__) do{\ 329 (__HANDLE__)->State = HAL_CRYP_STATE_RESET;\ 330 (__HANDLE__)->MspInitCallback = NULL;\ 331 (__HANDLE__)->MspDeInitCallback = NULL;\ 332 }while(0) 333 #else 334 #define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__) ( (__HANDLE__)->State = HAL_CRYP_STATE_RESET) 335 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 336 337 /** 338 * @brief Enable/Disable the CRYP peripheral. 339 * @param __HANDLE__: specifies the CRYP handle. 340 * @retval None 341 */ 342 343 #define __HAL_CRYP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRYP_CR_CRYPEN) 344 #define __HAL_CRYP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~CRYP_CR_CRYPEN) 345 346 /** @brief Check whether the specified CRYP status flag is set or not. 347 * @param __FLAG__: specifies the flag to check. 348 * This parameter can be one of the following values for CRYP: 349 * @arg CRYP_FLAG_BUSY: The CRYP core is currently processing a block of data 350 * or a key preparation (for AES decryption). 351 * @arg CRYP_FLAG_IFEM: Input FIFO is empty 352 * @arg CRYP_FLAG_IFNF: Input FIFO is not full 353 * @arg CRYP_FLAG_INRIS: Input FIFO service raw interrupt is pending 354 * @arg CRYP_FLAG_OFNE: Output FIFO is not empty 355 * @arg CRYP_FLAG_OFFU: Output FIFO is full 356 * @arg CRYP_FLAG_OUTRIS: Input FIFO service raw interrupt is pending 357 * @retval The state of __FLAG__ (TRUE or FALSE). 358 */ 359 #define CRYP_FLAG_MASK 0x0000001FU 360 361 #define __HAL_CRYP_GET_FLAG(__HANDLE__, __FLAG__)\ 362 ((((uint8_t)((__FLAG__) >> 24)) == 0x01U)?((((__HANDLE__)->Instance->RISR) &\ 363 ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK)): \ 364 ((((__HANDLE__)->Instance->RISR) &\ 365 ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK))) 366 367 /** @brief Check whether the specified CRYP interrupt is set or not. 368 * @param __HANDLE__: specifies the CRYP handle. 369 * @param __INTERRUPT__: specifies the interrupt to check. 370 * This parameter can be one of the following values for CRYP: 371 * @arg CRYP_IT_INI: Input FIFO service masked interrupt status 372 * @arg CRYP_IT_OUTI: Output FIFO service masked interrupt status 373 * @retval The state of __INTERRUPT__ (TRUE or FALSE). 374 */ 375 376 #define __HAL_CRYP_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->MISR &\ 377 (__INTERRUPT__)) == (__INTERRUPT__)) 378 379 /** 380 * @brief Enable the CRYP interrupt. 381 * @param __HANDLE__: specifies the CRYP handle. 382 * @param __INTERRUPT__: CRYP Interrupt. 383 * This parameter can be one of the following values for CRYP: 384 * @ CRYP_IT_INI : Input FIFO service interrupt mask. 385 * @ CRYP_IT_OUTI : Output FIFO service interrupt mask.CRYP interrupt. 386 * @retval None 387 */ 388 389 #define __HAL_CRYP_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) |= (__INTERRUPT__)) 390 391 /** 392 * @brief Disable the CRYP interrupt. 393 * @param __HANDLE__: specifies the CRYP handle. 394 * @param __INTERRUPT__: CRYP Interrupt. 395 * This parameter can be one of the following values for CRYP: 396 * @ CRYP_IT_INI : Input FIFO service interrupt mask. 397 * @ CRYP_IT_OUTI : Output FIFO service interrupt mask.CRYP interrupt. 398 * @retval None 399 */ 400 401 #define __HAL_CRYP_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) &= ~(__INTERRUPT__)) 402 403 /** 404 * @} 405 */ 406 407 /* Include CRYP HAL Extended module */ 408 #include "stm32h7xx_hal_cryp_ex.h" 409 410 /* Exported functions --------------------------------------------------------*/ 411 /** @defgroup CRYP_Exported_Functions CRYP Exported Functions 412 * @{ 413 */ 414 415 /** @addtogroup CRYP_Exported_Functions_Group1 416 * @{ 417 */ 418 HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp); 419 HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp); 420 void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); 421 void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); 422 HAL_StatusTypeDef HAL_CRYP_SetConfig(CRYP_HandleTypeDef *hcryp, CRYP_ConfigTypeDef *pConf); 423 HAL_StatusTypeDef HAL_CRYP_GetConfig(CRYP_HandleTypeDef *hcryp, CRYP_ConfigTypeDef *pConf); 424 #if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) 425 HAL_StatusTypeDef HAL_CRYP_RegisterCallback(CRYP_HandleTypeDef *hcryp, HAL_CRYP_CallbackIDTypeDef CallbackID, 426 pCRYP_CallbackTypeDef pCallback); 427 HAL_StatusTypeDef HAL_CRYP_UnRegisterCallback(CRYP_HandleTypeDef *hcryp, HAL_CRYP_CallbackIDTypeDef CallbackID); 428 #endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ 429 /** 430 * @} 431 */ 432 433 /** @addtogroup CRYP_Exported_Functions_Group2 434 * @{ 435 */ 436 437 /* encryption/decryption ***********************************/ 438 HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output, 439 uint32_t Timeout); 440 HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output, 441 uint32_t Timeout); 442 HAL_StatusTypeDef HAL_CRYP_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 443 HAL_StatusTypeDef HAL_CRYP_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 444 HAL_StatusTypeDef HAL_CRYP_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 445 HAL_StatusTypeDef HAL_CRYP_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Input, uint16_t Size, uint32_t *Output); 446 447 /** 448 * @} 449 */ 450 451 452 /** @addtogroup CRYP_Exported_Functions_Group3 453 * @{ 454 */ 455 /* Interrupt Handler functions **********************************************/ 456 void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp); 457 HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp); 458 void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); 459 void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); 460 void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); 461 uint32_t HAL_CRYP_GetError(CRYP_HandleTypeDef *hcryp); 462 463 /** 464 * @} 465 */ 466 467 /** 468 * @} 469 */ 470 471 /* Private macros --------------------------------------------------------*/ 472 /** @defgroup CRYP_Private_Macros CRYP Private Macros 473 * @{ 474 */ 475 476 /** @defgroup CRYP_IS_CRYP_Definitions CRYP Private macros to check input parameters 477 * @{ 478 */ 479 480 #define IS_CRYP_ALGORITHM(ALGORITHM) (((ALGORITHM) == CRYP_DES_ECB) || \ 481 ((ALGORITHM) == CRYP_DES_CBC) || \ 482 ((ALGORITHM) == CRYP_TDES_ECB) || \ 483 ((ALGORITHM) == CRYP_TDES_CBC) || \ 484 ((ALGORITHM) == CRYP_AES_ECB) || \ 485 ((ALGORITHM) == CRYP_AES_CBC) || \ 486 ((ALGORITHM) == CRYP_AES_CTR) || \ 487 ((ALGORITHM) == CRYP_AES_GCM) || \ 488 ((ALGORITHM) == CRYP_AES_CCM)) 489 490 #define IS_CRYP_KEYSIZE(KEYSIZE)(((KEYSIZE) == CRYP_KEYSIZE_128B) || \ 491 ((KEYSIZE) == CRYP_KEYSIZE_192B) || \ 492 ((KEYSIZE) == CRYP_KEYSIZE_256B)) 493 494 #define IS_CRYP_DATATYPE(DATATYPE)(((DATATYPE) == CRYP_NO_SWAP) || \ 495 ((DATATYPE) == CRYP_HALFWORD_SWAP) || \ 496 ((DATATYPE) == CRYP_BYTE_SWAP) || \ 497 ((DATATYPE) == CRYP_BIT_SWAP)) 498 499 #define IS_CRYP_INIT(CONFIG)(((CONFIG) == CRYP_KEYIVCONFIG_ALWAYS) || \ 500 ((CONFIG) == CRYP_KEYIVCONFIG_ONCE)) 501 502 /** 503 * @} 504 */ 505 506 /** 507 * @} 508 */ 509 510 511 /* Private constants ---------------------------------------------------------*/ 512 /** @defgroup CRYP_Private_Constants CRYP Private Constants 513 * @{ 514 */ 515 516 /** 517 * @} 518 */ 519 /* Private defines -----------------------------------------------------------*/ 520 /** @defgroup CRYP_Private_Defines CRYP Private Defines 521 * @{ 522 */ 523 524 /** 525 * @} 526 */ 527 528 /* Private variables ---------------------------------------------------------*/ 529 /** @defgroup CRYP_Private_Variables CRYP Private Variables 530 * @{ 531 */ 532 533 /** 534 * @} 535 */ 536 /* Private functions prototypes ----------------------------------------------*/ 537 /** @defgroup CRYP_Private_Functions_Prototypes CRYP Private Functions Prototypes 538 * @{ 539 */ 540 541 /** 542 * @} 543 */ 544 545 /* Private functions ---------------------------------------------------------*/ 546 /** @defgroup CRYP_Private_Functions CRYP Private Functions 547 * @{ 548 */ 549 550 /** 551 * @} 552 */ 553 554 555 /** 556 * @} 557 */ 558 559 560 #endif /* CRYP */ 561 /** 562 * @} 563 */ 564 565 #ifdef __cplusplus 566 } 567 #endif 568 569 #endif /* STM32H7xx_HAL_CRYP_H */ 570 571