336 lines
33 KiB
HTML
336 lines
33 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.9.1"/>
|
|
<title>discoverpixy: discovery/libs/StmCoreNPheriph/src/stm32f4xx_cryp.c File Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { init_search(); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">discoverpixy
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.9.1 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_84db96586f7d962b526d6d9627d831c2.html">discovery</a></li><li class="navelem"><a class="el" href="dir_07523c13f04fd35d8848cb17a371cb5b.html">libs</a></li><li class="navelem"><a class="el" href="dir_1d60ba7d807ff336a2be2f2de640bf2b.html">StmCoreNPheriph</a></li><li class="navelem"><a class="el" href="dir_12f7a99b9d2a0e5955a2ac990af20021.html">src</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#define-members">Macros</a> |
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">stm32f4xx_cryp.c File Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>This file provides firmware functions to manage the following functionalities of the Cryptographic processor (CRYP) peripheral:
|
|
<a href="#details">More...</a></p>
|
|
<div class="textblock"><code>#include "<a class="el" href="stm32f4xx__cryp_8h_source.html">stm32f4xx_cryp.h</a>"</code><br />
|
|
<code>#include "<a class="el" href="stm32f4xx__rcc_8h_source.html">stm32f4xx_rcc.h</a>"</code><br />
|
|
</div><div class="textblock"><div class="dynheader">
|
|
Include dependency graph for stm32f4xx_cryp.c:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="stm32f4xx__cryp_8c__incl.png" border="0" usemap="#discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__cryp_8c" alt=""/></div>
|
|
<map name="discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__cryp_8c" id="discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__cryp_8c">
|
|
<area shape="rect" id="node2" href="stm32f4xx__cryp_8h.html" title="This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware librar..." alt="" coords="2286,95,2411,121"/><area shape="rect" id="node21" href="stm32f4xx__rcc_8h.html" title="This file contains all the functions prototypes for the RCC firmware library. " alt="" coords="4021,319,4140,345"/><area shape="rect" id="node3" href="stm32f4xx_8h.html" title="CMSIS Cortex-M4 Device Peripheral Access Layer Header File. This file contains all the peripheral reg..." alt="" coords="2177,169,2270,196"/><area shape="rect" id="node4" href="core__cm4_8h.html" title="CMSIS Cortex-M4 Core Peripheral Access Layer Header File. " alt="" coords="350,244,441,271"/><area shape="rect" id="node9" href="system__stm32f4xx_8h.html" title="CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. " alt="" coords="183,244,325,271"/><area shape="rect" id="node10" href="stm32f4xx__conf_8h_source.html" title="stm32f4xx_conf.h" alt="" coords="2287,244,2411,271"/><area shape="rect" id="node6" href="core__cm_instr_8h.html" title="CMSIS Cortex-M Core Instruction Access Header File. " alt="" coords="245,319,351,345"/><area shape="rect" id="node7" href="core__cm_func_8h.html" title="CMSIS Cortex-M Core Function Access Header File. " alt="" coords="375,319,487,345"/><area shape="rect" id="node8" href="core__cm4__simd_8h.html" title="CMSIS Cortex-M4 SIMD Header File. " alt="" coords="95,319,221,345"/><area shape="rect" id="node11" href="stm32f4xx__adc_8h.html" title="This file contains all the functions prototypes for the ADC firmware library. " alt="" coords="512,319,633,345"/><area shape="rect" id="node12" href="stm32f4xx__crc_8h.html" title="This file contains all the functions prototypes for the CRC firmware library. " alt="" coords="657,319,776,345"/><area shape="rect" id="node13" href="stm32f4xx__dbgmcu_8h.html" title="This file contains all the functions prototypes for the DBGMCU firmware library. " alt="" coords="801,319,947,345"/><area shape="rect" id="node14" href="stm32f4xx__dma_8h.html" title="This file contains all the functions prototypes for the DMA firmware library. " alt="" coords="971,319,1097,345"/><area shape="rect" id="node15" href="stm32f4xx__exti_8h.html" title="This file contains all the functions prototypes for the EXTI firmware library. " alt="" coords="1121,319,1243,345"/><area shape="rect" id="node16" href="stm32f4xx__flash_8h.html" title="This file contains all the functions prototypes for the FLASH firmware library. " alt="" coords="1267,319,1393,345"/><area shape="rect" id="node17" href="stm32f4xx__gpio_8h.html" title="This file contains all the functions prototypes for the GPIO firmware library. " alt="" coords="1417,319,1541,345"/><area shape="rect" id="node18" href="stm32f4xx__i2c_8h.html" title="This file contains all the functions prototypes for the I2C firmware library. " alt="" coords="1565,319,1682,345"/><area shape="rect" id="node19" href="stm32f4xx__iwdg_8h.html" title="This file contains all the functions prototypes for the IWDG firmware library. " alt="" coords="1707,319,1833,345"/><area shape="rect" id="node20" href="stm32f4xx__pwr_8h.html" title="This file contains all the functions prototypes for the PWR firmware library. " alt="" coords="1857,319,1976,345"/><area shape="rect" id="node22" href="stm32f4xx__rtc_8h.html" title="This file contains all the functions prototypes for the RTC firmware library. " alt="" coords="2001,319,2115,345"/><area shape="rect" id="node23" href="stm32f4xx__sdio_8h.html" title="This file contains all the functions prototypes for the SDIO firmware library. " alt="" coords="2140,319,2264,345"/><area shape="rect" id="node24" href="stm32f4xx__spi_8h.html" title="This file contains all the functions prototypes for the SPI firmware library. " alt="" coords="2287,319,2405,345"/><area shape="rect" id="node25" href="stm32f4xx__syscfg_8h.html" title="This file contains all the functions prototypes for the SYSCFG firmware library. " alt="" coords="2429,319,2567,345"/><area shape="rect" id="node26" href="stm32f4xx__tim_8h.html" title="This file contains all the functions prototypes for the TIM firmware library. " alt="" coords="2592,319,2711,345"/><area shape="rect" id="node27" href="stm32f4xx__usart_8h.html" title="This file contains all the functions prototypes for the USART firmware library. " alt="" coords="2735,319,2864,345"/><area shape="rect" id="node28" href="stm32f4xx__wwdg_8h.html" title="This file contains all the functions prototypes for the WWDG firmware library. " alt="" coords="2888,319,3020,345"/><area shape="rect" id="node29" href="misc_8h.html" title="This file contains all the functions prototypes for the miscellaneous firmware library functions (add..." alt="" coords="3045,319,3106,345"/><area shape="rect" id="node30" href="stm32f4xx__hash_8h.html" title="This file contains all the functions prototypes for the HASH firmware library. " alt="" coords="3130,319,3258,345"/><area shape="rect" id="node31" href="stm32f4xx__rng_8h.html" title="This file contains all the functions prototypes for the Random Number Generator(RNG) firmware library..." alt="" coords="3283,319,3401,345"/><area shape="rect" id="node32" href="stm32f4xx__can_8h.html" title="This file contains all the functions prototypes for the CAN firmware library. " alt="" coords="3425,319,3547,345"/><area shape="rect" id="node33" href="stm32f4xx__dac_8h.html" title="This file contains all the functions prototypes for the DAC firmware library. " alt="" coords="3571,319,3692,345"/><area shape="rect" id="node34" href="stm32f4xx__dcmi_8h.html" title="This file contains all the functions prototypes for the DCMI firmware library. " alt="" coords="3717,319,3845,345"/><area shape="rect" id="node35" href="stm32f4xx__fsmc_8h.html" title="This file contains all the functions prototypes for the FSMC firmware library. " alt="" coords="3869,319,3997,345"/></map>
|
|
</div>
|
|
</div><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
|
|
Macros</h2></td></tr>
|
|
<tr class="memitem:ga890221cb651a3f30f6d1bca0d9b0e13d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga890221cb651a3f30f6d1bca0d9b0e13d"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>FLAG_MASK</b>   ((uint8_t)0x20)</td></tr>
|
|
<tr class="separator:ga890221cb651a3f30f6d1bca0d9b0e13d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga85fda3522e69a1bf85f7dcd97b6023a1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga85fda3522e69a1bf85f7dcd97b6023a1"></a>
|
|
#define </td><td class="memItemRight" valign="bottom"><b>MAX_TIMEOUT</b>   ((uint16_t)0xFFFF)</td></tr>
|
|
<tr class="separator:ga85fda3522e69a1bf85f7dcd97b6023a1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:gae19e54c9910b697e38f6c7577704ffae"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#gae19e54c9910b697e38f6c7577704ffae">CRYP_DeInit</a> (void)</td></tr>
|
|
<tr class="memdesc:gae19e54c9910b697e38f6c7577704ffae"><td class="mdescLeft"> </td><td class="mdescRight">Deinitializes the CRYP peripheral registers to their default reset values. <a href="group___c_r_y_p___group1.html#gae19e54c9910b697e38f6c7577704ffae">More...</a><br /></td></tr>
|
|
<tr class="separator:gae19e54c9910b697e38f6c7577704ffae"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga7b72c458d95581ab0a36be3e017fcf02"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#ga7b72c458d95581ab0a36be3e017fcf02">CRYP_Init</a> (<a class="el" href="struct_c_r_y_p___init_type_def.html">CRYP_InitTypeDef</a> *CRYP_InitStruct)</td></tr>
|
|
<tr class="memdesc:ga7b72c458d95581ab0a36be3e017fcf02"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the CRYP peripheral according to the specified parameters in the CRYP_InitStruct. <a href="group___c_r_y_p___group1.html#ga7b72c458d95581ab0a36be3e017fcf02">More...</a><br /></td></tr>
|
|
<tr class="separator:ga7b72c458d95581ab0a36be3e017fcf02"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga8fb8ec75fe72d55046c8220825dfe41e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#ga8fb8ec75fe72d55046c8220825dfe41e">CRYP_StructInit</a> (<a class="el" href="struct_c_r_y_p___init_type_def.html">CRYP_InitTypeDef</a> *CRYP_InitStruct)</td></tr>
|
|
<tr class="memdesc:ga8fb8ec75fe72d55046c8220825dfe41e"><td class="mdescLeft"> </td><td class="mdescRight">Fills each CRYP_InitStruct member with its default value. <a href="group___c_r_y_p___group1.html#ga8fb8ec75fe72d55046c8220825dfe41e">More...</a><br /></td></tr>
|
|
<tr class="separator:ga8fb8ec75fe72d55046c8220825dfe41e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gad4baa3865415215cae07c9fbfa131cb9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#gad4baa3865415215cae07c9fbfa131cb9">CRYP_KeyInit</a> (<a class="el" href="struct_c_r_y_p___key_init_type_def.html">CRYP_KeyInitTypeDef</a> *CRYP_KeyInitStruct)</td></tr>
|
|
<tr class="memdesc:gad4baa3865415215cae07c9fbfa131cb9"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the CRYP Keys according to the specified parameters in the CRYP_KeyInitStruct. <a href="group___c_r_y_p___group1.html#gad4baa3865415215cae07c9fbfa131cb9">More...</a><br /></td></tr>
|
|
<tr class="separator:gad4baa3865415215cae07c9fbfa131cb9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaeecd86b00d0d0137d97b06108789bcb2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#gaeecd86b00d0d0137d97b06108789bcb2">CRYP_KeyStructInit</a> (<a class="el" href="struct_c_r_y_p___key_init_type_def.html">CRYP_KeyInitTypeDef</a> *CRYP_KeyInitStruct)</td></tr>
|
|
<tr class="memdesc:gaeecd86b00d0d0137d97b06108789bcb2"><td class="mdescLeft"> </td><td class="mdescRight">Fills each CRYP_KeyInitStruct member with its default value. <a href="group___c_r_y_p___group1.html#gaeecd86b00d0d0137d97b06108789bcb2">More...</a><br /></td></tr>
|
|
<tr class="separator:gaeecd86b00d0d0137d97b06108789bcb2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga133964b50a07db3a32864308f6355a8b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#ga133964b50a07db3a32864308f6355a8b">CRYP_IVInit</a> (<a class="el" href="struct_c_r_y_p___i_v_init_type_def.html">CRYP_IVInitTypeDef</a> *CRYP_IVInitStruct)</td></tr>
|
|
<tr class="memdesc:ga133964b50a07db3a32864308f6355a8b"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the CRYP Initialization Vectors(IV) according to the specified parameters in the CRYP_IVInitStruct. <a href="group___c_r_y_p___group1.html#ga133964b50a07db3a32864308f6355a8b">More...</a><br /></td></tr>
|
|
<tr class="separator:ga133964b50a07db3a32864308f6355a8b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga58899074e08bbd65f2ed304cf0f42987"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#ga58899074e08bbd65f2ed304cf0f42987">CRYP_IVStructInit</a> (<a class="el" href="struct_c_r_y_p___i_v_init_type_def.html">CRYP_IVInitTypeDef</a> *CRYP_IVInitStruct)</td></tr>
|
|
<tr class="memdesc:ga58899074e08bbd65f2ed304cf0f42987"><td class="mdescLeft"> </td><td class="mdescRight">Fills each CRYP_IVInitStruct member with its default value. <a href="group___c_r_y_p___group1.html#ga58899074e08bbd65f2ed304cf0f42987">More...</a><br /></td></tr>
|
|
<tr class="separator:ga58899074e08bbd65f2ed304cf0f42987"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga4370106a2baf2b8e6cb360865050a027"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#ga4370106a2baf2b8e6cb360865050a027">CRYP_PhaseConfig</a> (uint32_t CRYP_Phase)</td></tr>
|
|
<tr class="memdesc:ga4370106a2baf2b8e6cb360865050a027"><td class="mdescLeft"> </td><td class="mdescRight">Configures the AES-CCM and AES-GCM phases. <a href="group___c_r_y_p___group1.html#ga4370106a2baf2b8e6cb360865050a027">More...</a><br /></td></tr>
|
|
<tr class="separator:ga4370106a2baf2b8e6cb360865050a027"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga23ada9d9464e1362299d7612a1409a57"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#ga23ada9d9464e1362299d7612a1409a57">CRYP_FIFOFlush</a> (void)</td></tr>
|
|
<tr class="memdesc:ga23ada9d9464e1362299d7612a1409a57"><td class="mdescLeft"> </td><td class="mdescRight">Flushes the IN and OUT FIFOs (that is read and write pointers of the FIFOs are reset) <a href="group___c_r_y_p___group1.html#ga23ada9d9464e1362299d7612a1409a57">More...</a><br /></td></tr>
|
|
<tr class="separator:ga23ada9d9464e1362299d7612a1409a57"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gad39ccd9b1f2e088e3a227d7a1c410d7c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group1.html#gad39ccd9b1f2e088e3a227d7a1c410d7c">CRYP_Cmd</a> (FunctionalState NewState)</td></tr>
|
|
<tr class="memdesc:gad39ccd9b1f2e088e3a227d7a1c410d7c"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables the CRYP peripheral. <a href="group___c_r_y_p___group1.html#gad39ccd9b1f2e088e3a227d7a1c410d7c">More...</a><br /></td></tr>
|
|
<tr class="separator:gad39ccd9b1f2e088e3a227d7a1c410d7c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga16dc76244318d464357ee6ff208bf9a4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group2.html#ga16dc76244318d464357ee6ff208bf9a4">CRYP_DataIn</a> (uint32_t Data)</td></tr>
|
|
<tr class="memdesc:ga16dc76244318d464357ee6ff208bf9a4"><td class="mdescLeft"> </td><td class="mdescRight">Writes data in the Data Input register (DIN). <a href="group___c_r_y_p___group2.html#ga16dc76244318d464357ee6ff208bf9a4">More...</a><br /></td></tr>
|
|
<tr class="separator:ga16dc76244318d464357ee6ff208bf9a4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gacbe5fcf4c7e4919192376fa615588b54"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group2.html#gacbe5fcf4c7e4919192376fa615588b54">CRYP_DataOut</a> (void)</td></tr>
|
|
<tr class="memdesc:gacbe5fcf4c7e4919192376fa615588b54"><td class="mdescLeft"> </td><td class="mdescRight">Returns the last data entered into the output FIFO. <a href="group___c_r_y_p___group2.html#gacbe5fcf4c7e4919192376fa615588b54">More...</a><br /></td></tr>
|
|
<tr class="separator:gacbe5fcf4c7e4919192376fa615588b54"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga41a14be7fa43d500e7c94cce40910ea8"><td class="memItemLeft" align="right" valign="top">ErrorStatus </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group3.html#ga41a14be7fa43d500e7c94cce40910ea8">CRYP_SaveContext</a> (<a class="el" href="struct_c_r_y_p___context.html">CRYP_Context</a> *CRYP_ContextSave, <a class="el" href="struct_c_r_y_p___key_init_type_def.html">CRYP_KeyInitTypeDef</a> *CRYP_KeyInitStruct)</td></tr>
|
|
<tr class="memdesc:ga41a14be7fa43d500e7c94cce40910ea8"><td class="mdescLeft"> </td><td class="mdescRight">Saves the CRYP peripheral Context. <a href="group___c_r_y_p___group3.html#ga41a14be7fa43d500e7c94cce40910ea8">More...</a><br /></td></tr>
|
|
<tr class="separator:ga41a14be7fa43d500e7c94cce40910ea8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaf2986782fa66ea95b2a389595e17e0e5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group3.html#gaf2986782fa66ea95b2a389595e17e0e5">CRYP_RestoreContext</a> (<a class="el" href="struct_c_r_y_p___context.html">CRYP_Context</a> *CRYP_ContextRestore)</td></tr>
|
|
<tr class="memdesc:gaf2986782fa66ea95b2a389595e17e0e5"><td class="mdescLeft"> </td><td class="mdescRight">Restores the CRYP peripheral Context. <a href="group___c_r_y_p___group3.html#gaf2986782fa66ea95b2a389595e17e0e5">More...</a><br /></td></tr>
|
|
<tr class="separator:gaf2986782fa66ea95b2a389595e17e0e5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga111d0ec56facb27f8367ce6a33869115"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group4.html#ga111d0ec56facb27f8367ce6a33869115">CRYP_DMACmd</a> (uint8_t CRYP_DMAReq, FunctionalState NewState)</td></tr>
|
|
<tr class="memdesc:ga111d0ec56facb27f8367ce6a33869115"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables the CRYP DMA interface. <a href="group___c_r_y_p___group4.html#ga111d0ec56facb27f8367ce6a33869115">More...</a><br /></td></tr>
|
|
<tr class="separator:ga111d0ec56facb27f8367ce6a33869115"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gafbf5ee5f2c3ae4404149a994e15b33d8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group5.html#gafbf5ee5f2c3ae4404149a994e15b33d8">CRYP_ITConfig</a> (uint8_t CRYP_IT, FunctionalState NewState)</td></tr>
|
|
<tr class="memdesc:gafbf5ee5f2c3ae4404149a994e15b33d8"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables the specified CRYP interrupts. <a href="group___c_r_y_p___group5.html#gafbf5ee5f2c3ae4404149a994e15b33d8">More...</a><br /></td></tr>
|
|
<tr class="separator:gafbf5ee5f2c3ae4404149a994e15b33d8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga00a48b748ed127fa517cacec9dbf18f4"><td class="memItemLeft" align="right" valign="top">ITStatus </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group5.html#ga00a48b748ed127fa517cacec9dbf18f4">CRYP_GetITStatus</a> (uint8_t CRYP_IT)</td></tr>
|
|
<tr class="memdesc:ga00a48b748ed127fa517cacec9dbf18f4"><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the specified CRYP interrupt has occurred or not. <a href="group___c_r_y_p___group5.html#ga00a48b748ed127fa517cacec9dbf18f4">More...</a><br /></td></tr>
|
|
<tr class="separator:ga00a48b748ed127fa517cacec9dbf18f4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gabe26186adf64660a4a573bd6a4368fee"><td class="memItemLeft" align="right" valign="top">FunctionalState </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group5.html#gabe26186adf64660a4a573bd6a4368fee">CRYP_GetCmdStatus</a> (void)</td></tr>
|
|
<tr class="memdesc:gabe26186adf64660a4a573bd6a4368fee"><td class="mdescLeft"> </td><td class="mdescRight">Returns whether CRYP peripheral is enabled or disabled. <a href="group___c_r_y_p___group5.html#gabe26186adf64660a4a573bd6a4368fee">More...</a><br /></td></tr>
|
|
<tr class="separator:gabe26186adf64660a4a573bd6a4368fee"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga993d568b626a74b2973d4a6848a681f6"><td class="memItemLeft" align="right" valign="top">FlagStatus </td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_r_y_p___group5.html#ga993d568b626a74b2973d4a6848a681f6">CRYP_GetFlagStatus</a> (uint8_t CRYP_FLAG)</td></tr>
|
|
<tr class="memdesc:ga993d568b626a74b2973d4a6848a681f6"><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the specified CRYP flag is set or not. <a href="group___c_r_y_p___group5.html#ga993d568b626a74b2973d4a6848a681f6">More...</a><br /></td></tr>
|
|
<tr class="separator:ga993d568b626a74b2973d4a6848a681f6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>This file provides firmware functions to manage the following functionalities of the Cryptographic processor (CRYP) peripheral: </p>
|
|
<dl class="section author"><dt>Author</dt><dd>MCD Application Team </dd></dl>
|
|
<dl class="section version"><dt>Version</dt><dd>V1.4.0 </dd></dl>
|
|
<dl class="section date"><dt>Date</dt><dd>04-August-2014<ul>
|
|
<li>Initialization and Configuration functions</li>
|
|
<li>Data treatment functions</li>
|
|
<li>Context swapping functions</li>
|
|
<li>DMA interface function</li>
|
|
<li>Interrupts and flags management</li>
|
|
</ul>
|
|
</dd></dl>
|
|
<pre class="fragment"> ===================================================================
|
|
##### How to use this driver #####
|
|
===================================================================
|
|
[..]
|
|
(#) Enable the CRYP controller clock using
|
|
RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_CRYP, ENABLE); function.
|
|
|
|
(#) Initialise the CRYP using CRYP_Init(), CRYP_KeyInit() and if needed
|
|
CRYP_IVInit().
|
|
|
|
(#) Flush the IN and OUT FIFOs by using CRYP_FIFOFlush() function.
|
|
|
|
(#) Enable the CRYP controller using the CRYP_Cmd() function.
|
|
|
|
(#) If using DMA for Data input and output transfer, activate the needed DMA
|
|
Requests using CRYP_DMACmd() function
|
|
|
|
(#) If DMA is not used for data transfer, use CRYP_DataIn() and CRYP_DataOut()
|
|
functions to enter data to IN FIFO and get result from OUT FIFO.
|
|
|
|
(#) To control CRYP events you can use one of the following two methods:
|
|
(++) Check on CRYP flags using the CRYP_GetFlagStatus() function.
|
|
(++) Use CRYP interrupts through the function CRYP_ITConfig() at
|
|
initialization phase and CRYP_GetITStatus() function into interrupt
|
|
routines in processing phase.
|
|
|
|
(#) Save and restore Cryptographic processor context using CRYP_SaveContext()
|
|
and CRYP_RestoreContext() functions.
|
|
|
|
|
|
*** Procedure to perform an encryption or a decryption ***
|
|
==========================================================
|
|
|
|
*** Initialization ***
|
|
======================
|
|
[..]
|
|
(#) Initialize the peripheral using CRYP_Init(), CRYP_KeyInit() and CRYP_IVInit
|
|
functions:
|
|
(++) Configure the key size (128-, 192- or 256-bit, in the AES only)
|
|
(++) Enter the symmetric key
|
|
(++) Configure the data type
|
|
(++) In case of decryption in AES-ECB or AES-CBC, you must prepare
|
|
the key: configure the key preparation mode. Then Enable the CRYP
|
|
peripheral using CRYP_Cmd() function: the BUSY flag is set.
|
|
Wait until BUSY flag is reset : the key is prepared for decryption
|
|
(++) Configure the algorithm and chaining (the DES/TDES in ECB/CBC, the
|
|
AES in ECB/CBC/CTR)
|
|
(++) Configure the direction (encryption/decryption).
|
|
(++) Write the initialization vectors (in CBC or CTR modes only)
|
|
|
|
(#) Flush the IN and OUT FIFOs using the CRYP_FIFOFlush() function
|
|
|
|
|
|
*** Basic Processing mode (polling mode) ***
|
|
============================================
|
|
[..]
|
|
(#) Enable the cryptographic processor using CRYP_Cmd() function.
|
|
|
|
(#) Write the first blocks in the input FIFO (2 to 8 words) using
|
|
CRYP_DataIn() function.
|
|
|
|
(#) Repeat the following sequence until the complete message has been
|
|
processed:
|
|
|
|
(++) Wait for flag CRYP_FLAG_OFNE occurs (using CRYP_GetFlagStatus()
|
|
function), then read the OUT-FIFO using CRYP_DataOut() function
|
|
(1 block or until the FIFO is empty)
|
|
|
|
(++) Wait for flag CRYP_FLAG_IFNF occurs, (using CRYP_GetFlagStatus()
|
|
function then write the IN FIFO using CRYP_DataIn() function
|
|
(1 block or until the FIFO is full)
|
|
|
|
(#) At the end of the processing, CRYP_FLAG_BUSY flag will be reset and
|
|
both FIFOs are empty (CRYP_FLAG_IFEM is set and CRYP_FLAG_OFNE is
|
|
reset). You can disable the peripheral using CRYP_Cmd() function.
|
|
|
|
*** Interrupts Processing mode ***
|
|
==================================
|
|
[..] In this mode, Processing is done when the data are transferred by the
|
|
CPU during interrupts.
|
|
|
|
(#) Enable the interrupts CRYP_IT_INI and CRYP_IT_OUTI using CRYP_ITConfig()
|
|
function.
|
|
|
|
(#) Enable the cryptographic processor using CRYP_Cmd() function.
|
|
|
|
(#) In the CRYP_IT_INI interrupt handler : load the input message into the
|
|
IN FIFO using CRYP_DataIn() function . You can load 2 or 4 words at a
|
|
time, or load data until the IN FIFO is full. When the last word of
|
|
the message has been entered into the IN FIFO, disable the CRYP_IT_INI
|
|
interrupt (using CRYP_ITConfig() function).
|
|
|
|
(#) In the CRYP_IT_OUTI interrupt handler : read the output message from
|
|
the OUT FIFO using CRYP_DataOut() function. You can read 1 block (2 or
|
|
4 words) at a time or read data until the FIFO is empty.
|
|
When the last word has been read, INIM=0, BUSY=0 and both FIFOs are
|
|
empty (CRYP_FLAG_IFEM is set and CRYP_FLAG_OFNE is reset).
|
|
You can disable the CRYP_IT_OUTI interrupt (using CRYP_ITConfig()
|
|
function) and you can disable the peripheral using CRYP_Cmd() function.
|
|
|
|
*** DMA Processing mode ***
|
|
===========================
|
|
[..] In this mode, Processing is done when the DMA is used to transfer the
|
|
data from/to the memory.
|
|
|
|
(#) Configure the DMA controller to transfer the input data from the
|
|
memory using DMA_Init() function.
|
|
The transfer length is the length of the message.
|
|
As message padding is not managed by the peripheral, the message
|
|
length must be an entire number of blocks. The data are transferred
|
|
in burst mode. The burst length is 4 words in the AES and 2 or 4
|
|
words in the DES/TDES. The DMA should be configured to set an
|
|
interrupt on transfer completion of the output data to indicate that
|
|
the processing is finished.
|
|
Refer to DMA peripheral driver for more details.
|
|
|
|
(#) Enable the cryptographic processor using CRYP_Cmd() function.
|
|
Enable the DMA requests CRYP_DMAReq_DataIN and CRYP_DMAReq_DataOUT
|
|
using CRYP_DMACmd() function.
|
|
|
|
(#) All the transfers and processing are managed by the DMA and the
|
|
cryptographic processor. The DMA transfer complete interrupt indicates
|
|
that the processing is complete. Both FIFOs are normally empty and
|
|
CRYP_FLAG_BUSY flag is reset.</pre><pre class="fragment">@attention
|
|
|
|
<h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
|
|
|
|
Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
|
You may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at:
|
|
|
|
http://www.st.com/software_license_agreement_liberty_v2
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.</pre></div></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Sun May 10 2015 15:15:18 for discoverpixy by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.9.1
|
|
</small></address>
|
|
</body>
|
|
</html>
|