/**
******************************************************************************
* @file stm32f4xx_hal_cryp_ex.c
* @author MCD Application Team
* @brief Extended CRYP HAL module driver
* This file provides firmware functions to manage the following
* functionalities of CRYP extension peripheral:
* + Extended AES processing functions
*
@verbatim
==============================================================================
##### How to use this driver #####
==============================================================================
[..]
The CRYP Extension HAL driver can be used as follows:
(#)Initialize the CRYP low level resources by implementing the HAL_CRYP_MspInit():
(##) Enable the CRYP interface clock using __HAL_RCC_CRYP_CLK_ENABLE()
(##) In case of using interrupts (e.g. HAL_CRYPEx_AESGCM_Encrypt_IT())
(+++) Configure the CRYP interrupt priority using HAL_NVIC_SetPriority()
(+++) Enable the CRYP IRQ handler using HAL_NVIC_EnableIRQ()
(+++) In CRYP IRQ handler, call HAL_CRYP_IRQHandler()
(##) In case of using DMA to control data transfer (e.g. HAL_AES_ECB_Encrypt_DMA())
(+++) Enable the DMAx interface clock using __DMAx_CLK_ENABLE()
(+++) Configure and enable two DMA streams one for managing data transfer from
memory to peripheral (input stream) and another stream for managing data
transfer from peripheral to memory (output stream)
(+++) Associate the initialized DMA handle to the CRYP DMA handle
using __HAL_LINKDMA()
(+++) Configure the priority and enable the NVIC for the transfer complete
interrupt on the two DMA Streams. The output stream should have higher
priority than the input stream HAL_NVIC_SetPriority() and HAL_NVIC_EnableIRQ()
(#)Initialize the CRYP HAL using HAL_CRYP_Init(). This function configures mainly:
(##) The data type: 1-bit, 8-bit, 16-bit and 32-bit
(##) The key size: 128, 192 and 256. This parameter is relevant only for AES
(##) The encryption/decryption key. Its size depends on the algorithm
used for encryption/decryption
(##) The initialization vector (counter). It is not used ECB mode.
(#)Three processing (encryption/decryption) functions are available:
(##) Polling mode: encryption and decryption APIs are blocking functions
i.e. they process the data and wait till the processing is finished
e.g. HAL_CRYPEx_AESGCM_Encrypt()
(##) Interrupt mode: encryption and decryption APIs are not blocking functions
i.e. they process the data under interrupt
e.g. HAL_CRYPEx_AESGCM_Encrypt_IT()
(##) DMA mode: encryption and decryption APIs are not blocking functions
i.e. the data transfer is ensured by DMA
e.g. HAL_CRYPEx_AESGCM_Encrypt_DMA()
(#)When the processing function is called at first time after HAL_CRYP_Init()
the CRYP peripheral is initialized and processes the buffer in input.
At second call, the processing function performs an append of the already
processed buffer.
When a new data block is to be processed, call HAL_CRYP_Init() then the
processing function.
(#)In AES-GCM and AES-CCM modes are an authenticated encryption algorithms
which provide authentication messages.
HAL_AES_GCM_Finish() and HAL_AES_CCM_Finish() are used to provide those
authentication messages.
Call those functions after the processing ones (polling, interrupt or DMA).
e.g. in AES-CCM mode call HAL_CRYPEx_AESCCM_Encrypt() to encrypt the plain data
then call HAL_CRYPEx_AESCCM_Finish() to get the authentication message
-@- For CCM Encrypt/Decrypt API's, only DataType = 8-bit is supported by this version.
-@- The HAL_CRYPEx_AESGCM_xxxx() implementation is limited to 32bits inputs data length
(Plain/Cyphertext, Header) compared with GCM standards specifications (800-38D).
(#)Call HAL_CRYP_DeInit() to deinitialize the CRYP peripheral.
@endverbatim
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
/** @addtogroup STM32F4xx_HAL_Driver
* @{
*/
/** @defgroup CRYPEx CRYPEx
* @brief CRYP Extension HAL module driver.
* @{
*/
#ifdef HAL_CRYP_MODULE_ENABLED
#if defined(CRYP)
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/** @addtogroup CRYPEx_Private_define
* @{
*/
#define CRYPEx_TIMEOUT_VALUE 1U
/**
* @}
*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/** @defgroup CRYPEx_Private_Functions_prototypes CRYP Private Functions Prototypes
* @{
*/
static void CRYPEx_GCMCCM_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector);
static void CRYPEx_GCMCCM_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize);
static HAL_StatusTypeDef CRYPEx_GCMCCM_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t *Input, uint16_t Ilength, uint8_t *Output, uint32_t Timeout);
static HAL_StatusTypeDef CRYPEx_GCMCCM_SetHeaderPhase(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint32_t Timeout);
static void CRYPEx_GCMCCM_DMAInCplt(DMA_HandleTypeDef *hdma);
static void CRYPEx_GCMCCM_DMAOutCplt(DMA_HandleTypeDef *hdma);
static void CRYPEx_GCMCCM_DMAError(DMA_HandleTypeDef *hdma);
static void CRYPEx_GCMCCM_SetDMAConfig(CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr);
/**
* @}
*/
/* Private functions ---------------------------------------------------
没有合适的资源?快使用搜索试试~ 我知道了~
单片机STM32F411&TFTLCD
共588个文件
d:121个
h:117个
crf:115个
0 下载量 180 浏览量
2024-07-17
19:46:38
上传
评论
收藏 36.13MB ZIP 举报
温馨提示
单片机STM32F411&TFTLCD
资源推荐
资源详情
资源评论
收起资源包目录
单片机STM32F411&TFTLCD (588个子文件)
1 543B
LCD.axf 736KB
stm32f4xx_hal_cryp_ex.c 214KB
stm32f4xx_hal_tim.c 176KB
stm32f4xx_hal_fmpi2c.c 171KB
stm32f4xx_hal_i2c.c 170KB
stm32f4xx_hal_cryp.c 169KB
stm32f4xx_hal_rcc_ex.c 154KB
stm32f4xx_hal_dfsdm.c 133KB
stm32f4xx_hal_spi.c 101KB
stm32f4xx_hal_sd.c 95KB
stm32f4xx_hal_uart.c 86KB
stm32f4xx_hal_mmc.c 84KB
stm32f4xx_hal_qspi.c 81KB
stm32f4xx_hal_usart.c 78KB
stm32f4xx_hal_dsi.c 74KB
stm32f4xx_hal_eth.c 74KB
stm32f4xx_hal_irda.c 72KB
stm32f4xx_hal_sai.c 71KB
stm32f4xx_hal_smartcard.c 68KB
stm32f4xx_hal_tim_ex.c 67KB
stm32f4xx_hal_can.c 64KB
stm32f4xx_hal_adc.c 63KB
stm32f4xx_hal_ltdc.c 63KB
stm32f4xx_hal_nand.c 63KB
stm32f4xx_ll_fmc.c 61KB
stm32f4xx_hal_hash.c 60KB
stm32f4xx_hal_dma2d.c 59KB
stm32f4xx_hal_rtc_ex.c 58KB
stm32f4xx_hal_can.c 55KB
stm32f4xx_hal_rtc.c 54KB
stm32f4xx_ll_usb.c 54KB
stm32f4xx_hal_lptim.c 53KB
stm32f4xx_ll_rcc.c 53KB
stm32f4xx_hal_hash_ex.c 53KB
stm32f4xx_hal_flash_ex.c 52KB
stm32f4xx_hal_i2s.c 52KB
stm32f4xx_ll_sdmmc.c 50KB
stm32f4xx_ll_tim.c 46KB
stm32f4xx_ll_adc.c 44KB
stm32f4xx_hal_spdifrx.c 44KB
stm32f4xx_hal_adc_ex.c 43KB
stm32f4xx_hal_rcc.c 42KB
stm32f4xx_hal_i2s_ex.c 41KB
stm32f4xx_hal_dma.c 41KB
stm32f4xx_hal_pcd.c 38KB
stm32f4xx_ll_fsmc.c 38KB
stm32f4xx_hal_hcd.c 36KB
stm32f4xx_hal_nor.c 34KB
stm32f4xx_ll_utils.c 33KB
stm32f4xx_ll_rtc.c 33KB
stm32f4xx_hal_dac.c 33KB
stm32f4xx_hal_dcmi.c 29KB
system_stm32f4xx.c 28KB
system_stm32f4xx.c 28KB
stm32f4xx_hal_sdram.c 27KB
stm32f4xx_hal_flash.c 25KB
stm32f4xx_hal_pccard.c 25KB
stm32f4xx_hal_pwr_ex.c 25KB
stm32f4xx_ll_spi.c 25KB
stm32f4xx_ll_dma2d.c 24KB
stm32f4xx_hal_sram.c 23KB
stm32f4xx_hal_cec.c 23KB
stm32f4xx_hal_pwr.c 21KB
stm32f4xx_ll_usart.c 20KB
stm32f4xx_hal_gpio.c 20KB
stm32f4xx_hal_cortex.c 20KB
stm32f4xx_hal.c 20KB
stm32f4xx_ll_dma.c 19KB
stm32f4xx_hal_rng.c 17KB
stm32f4xx_hal_dac_ex.c 16KB
stm32f4xx_hal_wwdg.c 13KB
stm32f4xx_hal_timebase_rtc_alarm_template.c 12KB
stm32f4xx_ll_gpio.c 12KB
stm32f4xx_hal_sai_ex.c 12KB
stm32f4xx_ll_dac.c 12KB
stm32f4xx_hal_dma_ex.c 12KB
stm32f4xx_hal_timebase_rtc_wakeup_template.c 12KB
stm32f4xx_hal_pcd_ex.c 11KB
stm32f4xx_hal_crc.c 11KB
stm32f4xx_ll_i2c.c 10KB
stm32f4xx_hal_iwdg.c 10KB
W25Q16.c 9KB
stm32f4xx_hal_fmpi2c_ex.c 9KB
stm32f4xx_ll_exti.c 9KB
stm32f4xx_hal_dcmi_ex.c 8KB
stm32f4xx_ll_lptim.c 8KB
stm32f4xx_hal_flash_ramfunc.c 7KB
stm32f4xx_hal_ltdc_ex.c 7KB
stm32f4xx_hal_i2c_ex.c 7KB
stm32f4xx_hal_timebase_tim_template.c 6KB
delay.c 6KB
stm32f4xx_it.c 5KB
usart.c 5KB
tftlcd.c 5KB
stm32f4xx_hal_msp_template.c 4KB
stm32f4xx_hal_msp.c 4KB
stm32f4xx_ll_rng.c 4KB
stm32f4xx_ll_crc.c 4KB
stm32f4xx_ll_pwr.c 4KB
共 588 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
村长二甫弘
- 粉丝: 74
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Java语言的前后端分离投票系统设计源码
- 基于Python全栈技术的B2C在线教育商城天宫设计源码
- ubuntu20.04安装教程-ubuntu20.04安装指南:涵盖物理机和虚拟环境下的详细流程
- 基于Java注解的Emqx消息监听器设计源码及后台访问控制API
- 基于Java语言的dormitory-backend学生宿舍管理系统设计源码
- 基于Dart语言的Flutter框架设计源码镜像仓库
- 基于Python的senior-export-list高级清单项目导出工具设计源码
- (源码)基于Spring Boot的武理商城系统.zip
- 基于Python的py12306火车票抢票工具设计源码
- 基于Java语言的法大大混合云OP2.0 SDK设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功