STM32F439xx HAL User Manual
Data Structures | Defines | Enumerations | Functions
stm32f4xx_hal_cryp.h File Reference

Header file of CRYP HAL module. More...

#include "stm32f4xx_hal_def.h"
#include "stm32f4xx_hal_cryp_ex.h"

Go to the source code of this file.

Data Structures

struct  CRYP_InitTypeDef
struct  CRYP_HandleTypeDef

Defines

#define CRYP_KEYSIZE_128B   0x00000000U
#define CRYP_KEYSIZE_192B   CRYP_CR_KEYSIZE_0
#define CRYP_KEYSIZE_256B   CRYP_CR_KEYSIZE_1
#define CRYP_DATATYPE_32B   0x00000000U
#define CRYP_DATATYPE_16B   CRYP_CR_DATATYPE_0
#define CRYP_DATATYPE_8B   CRYP_CR_DATATYPE_1
#define CRYP_DATATYPE_1B   CRYP_CR_DATATYPE
#define CRYP_CR_ALGOMODE_DIRECTION   0x0008003CU
#define CRYP_CR_ALGOMODE_TDES_ECB_ENCRYPT   0x00000000U
#define CRYP_CR_ALGOMODE_TDES_ECB_DECRYPT   0x00000004U
#define CRYP_CR_ALGOMODE_TDES_CBC_ENCRYPT   0x00000008U
#define CRYP_CR_ALGOMODE_TDES_CBC_DECRYPT   0x0000000CU
#define CRYP_CR_ALGOMODE_DES_ECB_ENCRYPT   0x00000010U
#define CRYP_CR_ALGOMODE_DES_ECB_DECRYPT   0x00000014U
#define CRYP_CR_ALGOMODE_DES_CBC_ENCRYPT   0x00000018U
#define CRYP_CR_ALGOMODE_DES_CBC_DECRYPT   0x0000001CU
#define CRYP_CR_ALGOMODE_AES_ECB_ENCRYPT   0x00000020U
#define CRYP_CR_ALGOMODE_AES_ECB_DECRYPT   0x00000024U
#define CRYP_CR_ALGOMODE_AES_CBC_ENCRYPT   0x00000028U
#define CRYP_CR_ALGOMODE_AES_CBC_DECRYPT   0x0000002CU
#define CRYP_CR_ALGOMODE_AES_CTR_ENCRYPT   0x00000030U
#define CRYP_CR_ALGOMODE_AES_CTR_DECRYPT   0x00000034U
#define CRYP_IT_INI   ((uint32_t)CRYP_IMSCR_INIM)
#define CRYP_IT_OUTI   ((uint32_t)CRYP_IMSCR_OUTIM)
#define CRYP_FLAG_BUSY   0x00000010U
#define CRYP_FLAG_IFEM   0x00000001U
#define CRYP_FLAG_IFNF   0x00000002U
#define CRYP_FLAG_OFNE   0x00000004U
#define CRYP_FLAG_OFFU   0x00000008U
#define CRYP_FLAG_OUTRIS   0x01000002U
#define CRYP_FLAG_INRIS   0x01000001U
#define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->State = HAL_CRYP_STATE_RESET)
 Reset CRYP handle state.
#define __HAL_CRYP_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR |= CRYP_CR_CRYPEN)
 Enable/Disable the CRYP peripheral.
#define __HAL_CRYP_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR &= ~CRYP_CR_CRYPEN)
#define __HAL_CRYP_FIFO_FLUSH(__HANDLE__)   ((__HANDLE__)->Instance->CR |= CRYP_CR_FFLUSH)
 Flush the data FIFO.
#define __HAL_CRYP_SET_MODE(__HANDLE__, MODE)   ((__HANDLE__)->Instance->CR |= (uint32_t)(MODE))
 Set the algorithm mode: AES-ECB, AES-CBC, AES-CTR, DES-ECB, DES-CBC.
#define __HAL_CRYP_GET_FLAG(__HANDLE__, __FLAG__)
 Check whether the specified CRYP flag is set or not.
#define __HAL_CRYP_GET_IT(__HANDLE__, __INTERRUPT__)   (((__HANDLE__)->Instance->MISR & (__INTERRUPT__)) == (__INTERRUPT__))
 Check whether the specified CRYP interrupt is set or not.
#define __HAL_CRYP_ENABLE_IT(__HANDLE__, __INTERRUPT__)   (((__HANDLE__)->Instance->IMSCR) |= (__INTERRUPT__))
 Enable the CRYP interrupt.
#define __HAL_CRYP_DISABLE_IT(__HANDLE__, __INTERRUPT__)   (((__HANDLE__)->Instance->IMSCR) &= ~(__INTERRUPT__))
 Disable the CRYP interrupt.
#define CRYP_FLAG_MASK   0x0000001FU
#define IS_CRYP_KEYSIZE(__KEYSIZE__)
#define IS_CRYP_DATATYPE(__DATATYPE__)

Enumerations

enum  HAL_CRYP_STATETypeDef {
  HAL_CRYP_STATE_RESET = 0x00U, HAL_CRYP_STATE_READY = 0x01U, HAL_CRYP_STATE_BUSY = 0x02U, HAL_CRYP_STATE_TIMEOUT = 0x03U,
  HAL_CRYP_STATE_ERROR = 0x04U
}
enum  HAL_PhaseTypeDef { HAL_CRYP_PHASE_READY = 0x01U, HAL_CRYP_PHASE_PROCESS = 0x02U, HAL_CRYP_PHASE_FINAL = 0x03U }

Functions

HAL_StatusTypeDef HAL_CRYP_Init (CRYP_HandleTypeDef *hcryp)
 Initializes the CRYP according to the specified parameters in the CRYP_InitTypeDef and creates the associated handle.
HAL_StatusTypeDef HAL_CRYP_DeInit (CRYP_HandleTypeDef *hcryp)
 DeInitializes the CRYP peripheral.
__weak void HAL_CRYP_MspInit (CRYP_HandleTypeDef *hcryp)
 Initializes the CRYP MSP.
__weak void HAL_CRYP_MspDeInit (CRYP_HandleTypeDef *hcryp)
 DeInitializes CRYP MSP.
HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES ECB encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES ECB decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES CBC encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES ECB decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES CTR encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in AES CTR decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES ECB encryption mode using Interrupt.
HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES CBC encryption mode using Interrupt.
HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES CTR encryption mode using Interrupt.
HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES ECB decryption mode using Interrupt.
HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES CTR decryption mode using Interrupt.
HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES CBC decryption mode using IT.
HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES ECB encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES ECB decryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES CBC encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES CBC encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in AES CTR encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in AES CTR decryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in DES ECB encryption mode.
HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in DES CBC encryption mode.
HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in DES ECB decryption mode.
HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in DES ECB decryption mode.
HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in DES ECB encryption mode using IT.
HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in DES ECB decryption mode using IT.
HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in DES CBC encryption mode using interrupt.
HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in DES ECB decryption mode using interrupt.
HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in DES ECB encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in DES ECB decryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in DES CBC encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in DES ECB decryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in TDES ECB encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout)
 Initializes the CRYP peripheral in TDES CBC encryption mode then encrypt pPlainData.
HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in TDES ECB decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout)
 Initializes the CRYP peripheral in TDES CBC decryption mode then decrypted pCypherData.
HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in TDES ECB encryption mode using interrupt.
HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in TDES ECB decryption mode.
HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in TDES CBC encryption mode.
HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_IT (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in TDES CBC decryption mode.
HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in TDES ECB encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in TDES ECB decryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData)
 Initializes the CRYP peripheral in TDES CBC encryption mode using DMA.
HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_DMA (CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData)
 Initializes the CRYP peripheral in TDES CBC decryption mode using DMA.
__weak void HAL_CRYP_InCpltCallback (CRYP_HandleTypeDef *hcryp)
 Input FIFO transfer completed callbacks.
__weak void HAL_CRYP_OutCpltCallback (CRYP_HandleTypeDef *hcryp)
 Output FIFO transfer completed callbacks.
__weak void HAL_CRYP_ErrorCallback (CRYP_HandleTypeDef *hcryp)
 CRYP error callbacks.
void HAL_CRYP_IRQHandler (CRYP_HandleTypeDef *hcryp)
 This function handles CRYP interrupt request.
HAL_CRYP_STATETypeDef HAL_CRYP_GetState (CRYP_HandleTypeDef *hcryp)
 Returns the CRYP state.

Detailed Description

Header file of CRYP HAL module.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32f4xx_hal_cryp.h.