282 lines
29 KiB
HTML
282 lines
29 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_hash.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="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">stm32f4xx_hash.c File Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>This file provides firmware functions to manage the following functionalities of the HASH / HMAC Processor (HASH) peripheral:
|
|
<a href="#details">More...</a></p>
|
|
<div class="textblock"><code>#include "<a class="el" href="stm32f4xx__hash_8h_source.html">stm32f4xx_hash.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_hash.c:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="stm32f4xx__hash_8c__incl.png" border="0" usemap="#discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__hash_8c" alt=""/></div>
|
|
<map name="discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__hash_8c" id="discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__hash_8c">
|
|
<area shape="rect" id="node2" href="stm32f4xx__hash_8h.html" title="This file contains all the functions prototypes for the HASH firmware library. " alt="" coords="2285,95,2413,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="4019,319,4137,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__cryp_8h.html" title="This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware librar..." alt="" coords="3130,319,3255,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="3280,319,3399,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="3423,319,3544,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="3568,319,3689,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="3714,319,3842,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="3866,319,3994,345"/></map>
|
|
</div>
|
|
</div><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:ga88717fe3a4f557182841a958e1dcd9c7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group1.html#ga88717fe3a4f557182841a958e1dcd9c7">HASH_DeInit</a> (void)</td></tr>
|
|
<tr class="memdesc:ga88717fe3a4f557182841a958e1dcd9c7"><td class="mdescLeft"> </td><td class="mdescRight">De-initializes the HASH peripheral registers to their default reset values. <a href="group___h_a_s_h___group1.html#ga88717fe3a4f557182841a958e1dcd9c7">More...</a><br /></td></tr>
|
|
<tr class="separator:ga88717fe3a4f557182841a958e1dcd9c7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga4a7d33f0954ac0463a6cda81121635cf"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group1.html#ga4a7d33f0954ac0463a6cda81121635cf">HASH_Init</a> (<a class="el" href="struct_h_a_s_h___init_type_def.html">HASH_InitTypeDef</a> *HASH_InitStruct)</td></tr>
|
|
<tr class="memdesc:ga4a7d33f0954ac0463a6cda81121635cf"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the HASH peripheral according to the specified parameters in the HASH_InitStruct structure. <a href="group___h_a_s_h___group1.html#ga4a7d33f0954ac0463a6cda81121635cf">More...</a><br /></td></tr>
|
|
<tr class="separator:ga4a7d33f0954ac0463a6cda81121635cf"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga9cfaaa73eafec40a06154f58d48adeb5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group1.html#ga9cfaaa73eafec40a06154f58d48adeb5">HASH_StructInit</a> (<a class="el" href="struct_h_a_s_h___init_type_def.html">HASH_InitTypeDef</a> *HASH_InitStruct)</td></tr>
|
|
<tr class="memdesc:ga9cfaaa73eafec40a06154f58d48adeb5"><td class="mdescLeft"> </td><td class="mdescRight">Fills each HASH_InitStruct member with its default value. <a href="group___h_a_s_h___group1.html#ga9cfaaa73eafec40a06154f58d48adeb5">More...</a><br /></td></tr>
|
|
<tr class="separator:ga9cfaaa73eafec40a06154f58d48adeb5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga11745813cf85a08b2058aac3bd026e4d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group1.html#ga11745813cf85a08b2058aac3bd026e4d">HASH_Reset</a> (void)</td></tr>
|
|
<tr class="memdesc:ga11745813cf85a08b2058aac3bd026e4d"><td class="mdescLeft"> </td><td class="mdescRight">Resets the HASH processor core, so that the HASH will be ready to compute the message digest of a new message. <a href="group___h_a_s_h___group1.html#ga11745813cf85a08b2058aac3bd026e4d">More...</a><br /></td></tr>
|
|
<tr class="separator:ga11745813cf85a08b2058aac3bd026e4d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gac4d1fa51c9240ad0287b371564b5d2a6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group2.html#gac4d1fa51c9240ad0287b371564b5d2a6">HASH_SetLastWordValidBitsNbr</a> (uint16_t ValidNumber)</td></tr>
|
|
<tr class="memdesc:gac4d1fa51c9240ad0287b371564b5d2a6"><td class="mdescLeft"> </td><td class="mdescRight">Configure the Number of valid bits in last word of the message. <a href="group___h_a_s_h___group2.html#gac4d1fa51c9240ad0287b371564b5d2a6">More...</a><br /></td></tr>
|
|
<tr class="separator:gac4d1fa51c9240ad0287b371564b5d2a6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga9c4c0cebdeb1ce2631dd2eeab82107ef"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group2.html#ga9c4c0cebdeb1ce2631dd2eeab82107ef">HASH_DataIn</a> (uint32_t Data)</td></tr>
|
|
<tr class="memdesc:ga9c4c0cebdeb1ce2631dd2eeab82107ef"><td class="mdescLeft"> </td><td class="mdescRight">Writes data in the Data Input FIFO. <a href="group___h_a_s_h___group2.html#ga9c4c0cebdeb1ce2631dd2eeab82107ef">More...</a><br /></td></tr>
|
|
<tr class="separator:ga9c4c0cebdeb1ce2631dd2eeab82107ef"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga37bec5e637a57124f3179185d03537ab"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group2.html#ga37bec5e637a57124f3179185d03537ab">HASH_GetInFIFOWordsNbr</a> (void)</td></tr>
|
|
<tr class="memdesc:ga37bec5e637a57124f3179185d03537ab"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of words already pushed into the IN FIFO. <a href="group___h_a_s_h___group2.html#ga37bec5e637a57124f3179185d03537ab">More...</a><br /></td></tr>
|
|
<tr class="separator:ga37bec5e637a57124f3179185d03537ab"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga23018d770837d6ab9f46941f105cc017"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group2.html#ga23018d770837d6ab9f46941f105cc017">HASH_GetDigest</a> (<a class="el" href="struct_h_a_s_h___msg_digest.html">HASH_MsgDigest</a> *HASH_MessageDigest)</td></tr>
|
|
<tr class="memdesc:ga23018d770837d6ab9f46941f105cc017"><td class="mdescLeft"> </td><td class="mdescRight">Provides the message digest result. <a href="group___h_a_s_h___group2.html#ga23018d770837d6ab9f46941f105cc017">More...</a><br /></td></tr>
|
|
<tr class="separator:ga23018d770837d6ab9f46941f105cc017"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga84ac2b64179fd37b75c4d5f665126e93"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group2.html#ga84ac2b64179fd37b75c4d5f665126e93">HASH_StartDigest</a> (void)</td></tr>
|
|
<tr class="memdesc:ga84ac2b64179fd37b75c4d5f665126e93"><td class="mdescLeft"> </td><td class="mdescRight">Starts the message padding and calculation of the final message. <a href="group___h_a_s_h___group2.html#ga84ac2b64179fd37b75c4d5f665126e93">More...</a><br /></td></tr>
|
|
<tr class="separator:ga84ac2b64179fd37b75c4d5f665126e93"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga9432b2b66e223414c840e9313c388bc5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group3.html#ga9432b2b66e223414c840e9313c388bc5">HASH_SaveContext</a> (<a class="el" href="struct_h_a_s_h___context.html">HASH_Context</a> *HASH_ContextSave)</td></tr>
|
|
<tr class="memdesc:ga9432b2b66e223414c840e9313c388bc5"><td class="mdescLeft"> </td><td class="mdescRight">Save the Hash peripheral Context. <a href="group___h_a_s_h___group3.html#ga9432b2b66e223414c840e9313c388bc5">More...</a><br /></td></tr>
|
|
<tr class="separator:ga9432b2b66e223414c840e9313c388bc5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga1d8412a13601376c968aec63212ca54e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group3.html#ga1d8412a13601376c968aec63212ca54e">HASH_RestoreContext</a> (<a class="el" href="struct_h_a_s_h___context.html">HASH_Context</a> *HASH_ContextRestore)</td></tr>
|
|
<tr class="memdesc:ga1d8412a13601376c968aec63212ca54e"><td class="mdescLeft"> </td><td class="mdescRight">Restore the Hash peripheral Context. <a href="group___h_a_s_h___group3.html#ga1d8412a13601376c968aec63212ca54e">More...</a><br /></td></tr>
|
|
<tr class="separator:ga1d8412a13601376c968aec63212ca54e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga4742c00f70505dc0c2a05d8a0447a603"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group4.html#ga4742c00f70505dc0c2a05d8a0447a603">HASH_AutoStartDigest</a> (FunctionalState NewState)</td></tr>
|
|
<tr class="memdesc:ga4742c00f70505dc0c2a05d8a0447a603"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables auto-start message padding and calculation of the final message digest at the end of DMA transfer. <a href="group___h_a_s_h___group4.html#ga4742c00f70505dc0c2a05d8a0447a603">More...</a><br /></td></tr>
|
|
<tr class="separator:ga4742c00f70505dc0c2a05d8a0447a603"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga6bc756803b0b3a03eecc47cb570e1bd3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group4.html#ga6bc756803b0b3a03eecc47cb570e1bd3">HASH_DMACmd</a> (FunctionalState NewState)</td></tr>
|
|
<tr class="memdesc:ga6bc756803b0b3a03eecc47cb570e1bd3"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables the HASH DMA interface. <a href="group___h_a_s_h___group4.html#ga6bc756803b0b3a03eecc47cb570e1bd3">More...</a><br /></td></tr>
|
|
<tr class="separator:ga6bc756803b0b3a03eecc47cb570e1bd3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga2559847a2b44be3c66e1155500810059"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group5.html#ga2559847a2b44be3c66e1155500810059">HASH_ITConfig</a> (uint32_t HASH_IT, FunctionalState NewState)</td></tr>
|
|
<tr class="memdesc:ga2559847a2b44be3c66e1155500810059"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables the specified HASH interrupts. <a href="group___h_a_s_h___group5.html#ga2559847a2b44be3c66e1155500810059">More...</a><br /></td></tr>
|
|
<tr class="separator:ga2559847a2b44be3c66e1155500810059"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga826f7bbe15d07c123446cc3d30959f72"><td class="memItemLeft" align="right" valign="top">FlagStatus </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group5.html#ga826f7bbe15d07c123446cc3d30959f72">HASH_GetFlagStatus</a> (uint32_t HASH_FLAG)</td></tr>
|
|
<tr class="memdesc:ga826f7bbe15d07c123446cc3d30959f72"><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the specified HASH flag is set or not. <a href="group___h_a_s_h___group5.html#ga826f7bbe15d07c123446cc3d30959f72">More...</a><br /></td></tr>
|
|
<tr class="separator:ga826f7bbe15d07c123446cc3d30959f72"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gae5a1d3897008d8923913b052e511ec0d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group5.html#gae5a1d3897008d8923913b052e511ec0d">HASH_ClearFlag</a> (uint32_t HASH_FLAG)</td></tr>
|
|
<tr class="memdesc:gae5a1d3897008d8923913b052e511ec0d"><td class="mdescLeft"> </td><td class="mdescRight">Clears the HASH flags. <a href="group___h_a_s_h___group5.html#gae5a1d3897008d8923913b052e511ec0d">More...</a><br /></td></tr>
|
|
<tr class="separator:gae5a1d3897008d8923913b052e511ec0d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gab20c96ef920c62f6fa5efb72cfad95f6"><td class="memItemLeft" align="right" valign="top">ITStatus </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group5.html#gab20c96ef920c62f6fa5efb72cfad95f6">HASH_GetITStatus</a> (uint32_t HASH_IT)</td></tr>
|
|
<tr class="memdesc:gab20c96ef920c62f6fa5efb72cfad95f6"><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the specified HASH interrupt has occurred or not. <a href="group___h_a_s_h___group5.html#gab20c96ef920c62f6fa5efb72cfad95f6">More...</a><br /></td></tr>
|
|
<tr class="separator:gab20c96ef920c62f6fa5efb72cfad95f6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga1c75ffce3992eced01403dd429a673fd"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___group5.html#ga1c75ffce3992eced01403dd429a673fd">HASH_ClearITPendingBit</a> (uint32_t HASH_IT)</td></tr>
|
|
<tr class="memdesc:ga1c75ffce3992eced01403dd429a673fd"><td class="mdescLeft"> </td><td class="mdescRight">Clears the HASH interrupt pending bit(s). <a href="group___h_a_s_h___group5.html#ga1c75ffce3992eced01403dd429a673fd">More...</a><br /></td></tr>
|
|
<tr class="separator:ga1c75ffce3992eced01403dd429a673fd"><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 HASH / HMAC Processor (HASH) 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>Message Digest generation 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 #####
|
|
===================================================================
|
|
|
|
*** HASH operation : ***
|
|
========================
|
|
[..]
|
|
(#) Enable the HASH controller clock using
|
|
RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_HASH, ENABLE) function.
|
|
|
|
(#) Initialise the HASH using HASH_Init() function.
|
|
|
|
(#) Reset the HASH processor core, so that the HASH will be ready
|
|
to compute he message digest of a new message by using HASH_Reset() function.
|
|
|
|
(#) Enable the HASH controller using the HASH_Cmd() function.
|
|
|
|
(#) if using DMA for Data input transfer, Activate the DMA Request
|
|
using HASH_DMACmd() function
|
|
|
|
(#) if DMA is not used for data transfer, use HASH_DataIn() function
|
|
to enter data to IN FIFO.
|
|
|
|
|
|
(#) Configure the Number of valid bits in last word of the message
|
|
using HASH_SetLastWordValidBitsNbr() function.
|
|
|
|
(#) if the message length is not an exact multiple of 512 bits,
|
|
then the function HASH_StartDigest() must be called to launch the computation
|
|
of the final digest.
|
|
|
|
(#) Once computed, the digest can be read using HASH_GetDigest() function.
|
|
|
|
(#) To control HASH events you can use one of the following wo methods:
|
|
(++) Check on HASH flags using the HASH_GetFlagStatus() function.
|
|
(++) Use HASH interrupts through the function HASH_ITConfig() at
|
|
initialization phase and HASH_GetITStatus() function into
|
|
interrupt routines in hashing phase.
|
|
After checking on a flag you should clear it using HASH_ClearFlag()
|
|
function. And after checking on an interrupt event you should
|
|
clear it using HASH_ClearITPendingBit() function.
|
|
|
|
(#) Save and restore hash processor context using
|
|
HASH_SaveContext() and HASH_RestoreContext() functions.
|
|
|
|
|
|
|
|
*** HMAC operation : ***
|
|
========================
|
|
[..] The HMAC algorithm is used for message authentication, by
|
|
irreversibly binding the message being processed to a key chosen
|
|
by the user.
|
|
For HMAC specifications, refer to "HMAC: keyed-hashing for message
|
|
authentication, H. Krawczyk, M. Bellare, R. Canetti, February 1997"
|
|
|
|
[..] Basically, the HMAC algorithm consists of two nested hash operations:
|
|
HMAC(message) = Hash[((key | pad) XOR 0x5C) | Hash(((key | pad) XOR 0x36) | message)]
|
|
where:
|
|
(+) "pad" is a sequence of zeroes needed to extend the key to the
|
|
length of the underlying hash function data block (that is
|
|
512 bits for both the SHA-1 and MD5 hash algorithms)
|
|
(+) "|" represents the concatenation operator
|
|
|
|
|
|
[..]To compute the HMAC, four different phases are required:
|
|
(#) Initialise the HASH using HASH_Init() function to do HMAC
|
|
operation.
|
|
|
|
(#) The key (to be used for the inner hash function) is then given to the core.
|
|
This operation follows the same mechanism as the one used to send the
|
|
message in the hash operation (that is, by HASH_DataIn() function and,
|
|
finally, HASH_StartDigest() function.
|
|
|
|
(#) Once the last word has been entered and computation has started,
|
|
the hash processor elaborates the key. It is then ready to accept the message
|
|
text using the same mechanism as the one used to send the message in the
|
|
hash operation.
|
|
|
|
(#) After the first hash round, the hash processor returns "ready" to indicate
|
|
that it is ready to receive the key to be used for the outer hash function
|
|
(normally, this key is the same as the one used for the inner hash function).
|
|
When the last word of the key is entered and computation starts, the HMAC
|
|
result is made available using HASH_GetDigest() function.</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>
|