/**
******************************************************************************
* @file stm32f7xx_hal_cryp_ex.c
* @author MCD Application Team
* @version V1.2.0
* @date 30-December-2016
* @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) 2016 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 "stm32f7xx_hal.h"
/** @addtogroup STM32F7xx_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 1
/**
* @}
*/
/* 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 ---------------------------------------------------------*/
/** @addtogroup CRYPEx_Private_Functions
* @{
*/
/**
* @brief DMA C
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ucosiii STM32F767 (309个子文件)
os_cpu_a.asm 13KB
cpu_a.asm 12KB
lib_mem_a.asm 11KB
ucosiii-f767.Debug.cspy.bat 1KB
ucosiii-f767.pbd.browse 0B
stm32f7xx_hal_cryp_ex.c 208KB
lib_str.c 196KB
stm32f7xx_hal_tim.c 174KB
stm32f7xx_hal_cryp.c 164KB
stm32f7xx_hal_i2c.c 155KB
stm32f7xx_hal_jpeg.c 119KB
lib_mem.c 116KB
cpu_core.c 115KB
stm32f7xx_hal_spi.c 114KB
os_task.c 108KB
stm32f7xx_hal_dfsdm.c 105KB
os_core.c 91KB
stm32f7xx_hal_smartcard.c 88KB
stm32f7xx_hal_sd.c 87KB
stm32f7xx_hal_tim_ex.c 85KB
stm32f7xx_hal_mmc.c 78KB
stm32f7xx_hal_irda.c 76KB
stm32f7xx_hal_qspi.c 75KB
stm32f7xx_hal_smbus.c 72KB
stm32f7xx_hal_eth.c 71KB
stm32f7xx_hal_rcc_ex.c 70KB
stm32f7xx_hal_dsi.c 70KB
stm32f7xx_hal_uart.c 69KB
stm32f7xx_hal_sai.c 67KB
stm32f7xx_hal_usart.c 62KB
stm32f7xx_hal_ltdc.c 61KB
stm32f7xx_hal_nand.c 61KB
stm32f7xx_hal_dma2d.c 61KB
stm32f7xx_hal_adc.c 60KB
stm32f7xx_hal_rtc_ex.c 58KB
stm32f7xx_hal_hash.c 58KB
os_flag.c 55KB
stm32f7xx_ll_tim.c 54KB
stm32f7xx_hal_rtc.c 53KB
stm32f7xx_hal_lptim.c 51KB
stm32f7xx_hal_hash_ex.c 51KB
stm32f7xx_hal_i2s.c 51KB
stm32f7xx_ll_usb.c 51KB
stm32f7xx_ll_sdmmc.c 49KB
os_tmr.c 47KB
stm32f7xx_ll_rcc.c 47KB
os_mutex.c 44KB
stm32f7xx_hal_can.c 43KB
stm32f7xx_ll_adc.c 42KB
stm32f7xx_hal_rcc.c 42KB
stm32f7xx_hal_flash_ex.c 41KB
stm32f7xx_hal_spdifrx.c 41KB
stm32f7xx_hal_dma.c 40KB
stm32f7xx_hal_adc_ex.c 40KB
stm32f7xx_ll_fmc.c 40KB
os_q.c 39KB
os_sem.c 38KB
stm32f7xx_hal_pcd.c 36KB
stm32f7xx_hal_hcd.c 35KB
os_cpu_c.c 34KB
os_cpu_c.c 34KB
stm32f7xx_ll_utils.c 34KB
stm32f7xx_hal_nor.c 32KB
stm32f7xx_ll_rtc.c 32KB
stm32f7xx_hal_dac.c 31KB
cpu_c.c 30KB
cpu_c.c 30KB
stm32f7xx_hal_dcmi.c 29KB
os_tick.c 27KB
stm32f7xx_ll_dma2d.c 27KB
stm32f7xx_hal_sdram.c 26KB
stm32f7xx_hal_flash.c 25KB
os_time.c 24KB
lib_ascii.c 23KB
stm32f7xx_ll_spi.c 22KB
stm32f7xx_hal_cec.c 22KB
stm32f7xx_hal_sram.c 22KB
stm32f7xx_hal_pwr.c 21KB
apollo.c 21KB
stm32f7xx_ll_dma.c 20KB
os_dbg.c 20KB
stm32f7xx_hal_pwr_ex.c 20KB
stm32f7xx_hal_cortex.c 20KB
os_stat.c 20KB
stm32f7xx_hal_gpio.c 19KB
stm32f7xx_hal_mdios.c 19KB
os_mon.c 19KB
stm32f7xx_ll_usart.c 18KB
stm32f7xx_hal_crc.c 17KB
stm32f7xx_hal.c 17KB
cpu_bsp.c 16KB
os_mem.c 16KB
stm32f7xx_hal_rng.c 16KB
stm32f7xx_hal_dac_ex.c 15KB
rgb.c 15KB
app_main.c 14KB
os_msg.c 14KB
stm32f7xx_hal_wwdg.c 13KB
stm32f7xx_hal_timebase_rtc_alarm_template.c 12KB
stm32f7xx_ll_gpio.c 12KB
共 309 条
- 1
- 2
- 3
- 4
资源评论
wanghos
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- NetOps-py通过sftp替换网络设备启动文件
- STM32单片机FPGA毕设电路原理论文报告任务驱动教学法在单片机课程教学中的应用
- STM32单片机FPGA毕设电路原理论文报告任务驱动法在单片机教学中的应用
- STM32单片机FPGA毕设电路原理论文报告人造金刚石压机智能化压力测控系统设计
- 以某列为依据匹配多项(Excel版)
- STM32单片机FPGA毕设电路原理论文报告人体短臂离心机实验台的显示控制系统
- STM32单片机FPGA毕设电路原理论文报告人工气候室监控系统的环境控制器研究
- STM32单片机FPGA毕设电路原理论文报告染整自动线张力控制系统的设计
- 数据挖掘与机器学习-实验
- 基于Linux系统Nginx的动态网站的LNMP环境源码包
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功