1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00
arduinolibs/classKeccakCore.html
Rhys Weatherley 6fadd58f39 Update docs
2018-04-27 12:01:49 +10:00

483 lines
31 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.6"/>
<title>Arduino Cryptography Library: KeccakCore Class 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/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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">Arduino Cryptography Library
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<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&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><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="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;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)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></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><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classKeccakCore-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">KeccakCore Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Keccak core sponge function.
<a href="classKeccakCore.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="KeccakCore_8h_source.html">KeccakCore.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a850c8e85bdb6b347411239716535d9c9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#a850c8e85bdb6b347411239716535d9c9">KeccakCore</a> ()</td></tr>
<tr class="memdesc:a850c8e85bdb6b347411239716535d9c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new Keccak sponge function. <a href="#a850c8e85bdb6b347411239716535d9c9">More...</a><br/></td></tr>
<tr class="separator:a850c8e85bdb6b347411239716535d9c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4579e3a9b24f1d615fa8d660c23e77a4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4579e3a9b24f1d615fa8d660c23e77a4"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#a4579e3a9b24f1d615fa8d660c23e77a4">~KeccakCore</a> ()</td></tr>
<tr class="memdesc:a4579e3a9b24f1d615fa8d660c23e77a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys this Keccak sponge function after clearing all sensitive information. <br/></td></tr>
<tr class="separator:a4579e3a9b24f1d615fa8d660c23e77a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a804b895121a4e04bc491f41a5821a13e"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e">capacity</a> () const </td></tr>
<tr class="memdesc:a804b895121a4e04bc491f41a5821a13e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the capacity of the sponge function in bits. <a href="#a804b895121a4e04bc491f41a5821a13e">More...</a><br/></td></tr>
<tr class="separator:a804b895121a4e04bc491f41a5821a13e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3c1905f2002e49aca085d6f0b5546f7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#ab3c1905f2002e49aca085d6f0b5546f7">setCapacity</a> (size_t <a class="el" href="classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e">capacity</a>)</td></tr>
<tr class="memdesc:ab3c1905f2002e49aca085d6f0b5546f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the capacity of the Keccak sponge function in bits. <a href="#ab3c1905f2002e49aca085d6f0b5546f7">More...</a><br/></td></tr>
<tr class="separator:ab3c1905f2002e49aca085d6f0b5546f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3742ed39151811b5d1c263c75ee5b20a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a">blockSize</a> () const </td></tr>
<tr class="memdesc:a3742ed39151811b5d1c263c75ee5b20a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the input block size for the sponge function in bytes. <a href="#a3742ed39151811b5d1c263c75ee5b20a">More...</a><br/></td></tr>
<tr class="separator:a3742ed39151811b5d1c263c75ee5b20a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a322eb7e3b5c1eaad127c9c6e6a529b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#a5a322eb7e3b5c1eaad127c9c6e6a529b">reset</a> ()</td></tr>
<tr class="memdesc:a5a322eb7e3b5c1eaad127c9c6e6a529b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the Keccak sponge function ready for a new session. <a href="#a5a322eb7e3b5c1eaad127c9c6e6a529b">More...</a><br/></td></tr>
<tr class="separator:a5a322eb7e3b5c1eaad127c9c6e6a529b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaaa0355ccec0f469ac8eb577bdf853ed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed">update</a> (const void *data, size_t size)</td></tr>
<tr class="memdesc:aaaa0355ccec0f469ac8eb577bdf853ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the Keccak sponge function with more input data. <a href="#aaaa0355ccec0f469ac8eb577bdf853ed">More...</a><br/></td></tr>
<tr class="separator:aaaa0355ccec0f469ac8eb577bdf853ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97852ee4381ced17ee6d21704cf0b4d7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#a97852ee4381ced17ee6d21704cf0b4d7">pad</a> (uint8_t tag)</td></tr>
<tr class="memdesc:a97852ee4381ced17ee6d21704cf0b4d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pads the last block of input data to <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a>. <a href="#a97852ee4381ced17ee6d21704cf0b4d7">More...</a><br/></td></tr>
<tr class="separator:a97852ee4381ced17ee6d21704cf0b4d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad83ece853c0cc15fcab947fdcba924f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f">extract</a> (void *data, size_t size)</td></tr>
<tr class="memdesc:aad83ece853c0cc15fcab947fdcba924f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts data from the Keccak sponge function. <a href="#aad83ece853c0cc15fcab947fdcba924f">More...</a><br/></td></tr>
<tr class="separator:aad83ece853c0cc15fcab947fdcba924f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acaf5c13452003e6e2e7793939f62a123"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#acaf5c13452003e6e2e7793939f62a123">encrypt</a> (void *output, const void *input, size_t size)</td></tr>
<tr class="memdesc:acaf5c13452003e6e2e7793939f62a123"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts data from the Keccak sponge function and uses it to encrypt a buffer. <a href="#acaf5c13452003e6e2e7793939f62a123">More...</a><br/></td></tr>
<tr class="separator:acaf5c13452003e6e2e7793939f62a123"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeff1df56e4a3103c99c1fe4307e60c66"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeff1df56e4a3103c99c1fe4307e60c66"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66">clear</a> ()</td></tr>
<tr class="memdesc:aeff1df56e4a3103c99c1fe4307e60c66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all sensitive data from this object. <br/></td></tr>
<tr class="separator:aeff1df56e4a3103c99c1fe4307e60c66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeff6b3357916bf426b60d3629db52628"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKeccakCore.html#aeff6b3357916bf426b60d3629db52628">setHMACKey</a> (const void *key, size_t len, uint8_t <a class="el" href="classKeccakCore.html#a97852ee4381ced17ee6d21704cf0b4d7">pad</a>, size_t hashSize)</td></tr>
<tr class="memdesc:aeff6b3357916bf426b60d3629db52628"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a HMAC key for a Keccak-based hash algorithm. <a href="#aeff6b3357916bf426b60d3629db52628">More...</a><br/></td></tr>
<tr class="separator:aeff6b3357916bf426b60d3629db52628"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Keccak core sponge function. </p>
<p><a class="el" href="classKeccakCore.html" title="Keccak core sponge function. ">KeccakCore</a> provides the core sponge function for different capacities. It is used to implement algorithms such as SHA3 and <a class="el" href="classSHAKE.html" title="Abstract base class for the SHAKE Extendable-Output Functions (XOFs). ">SHAKE</a>.</p>
<p>References: <a href="http://en.wikipedia.org/wiki/SHA-3">http://en.wikipedia.org/wiki/SHA-3</a></p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSHA3__256.html" title="SHA3-256 hash algorithm. ">SHA3_256</a>, <a class="el" href="classSHAKE256.html" title="SHAKE Extendable-Output Function (XOF) with 256-bit security. ">SHAKE256</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8h_source.html#l00029">29</a> of file <a class="el" href="KeccakCore_8h_source.html">KeccakCore.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a850c8e85bdb6b347411239716535d9c9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">KeccakCore::KeccakCore </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a new Keccak sponge function. </p>
<p>The <a class="el" href="classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e" title="Returns the capacity of the sponge function in bits. ">capacity()</a> will initially be set to 1536, which normally won't be of much use to the caller. The constructor should be followed by a call to <a class="el" href="classKeccakCore.html#ab3c1905f2002e49aca085d6f0b5546f7" title="Sets the capacity of the Keccak sponge function in bits. ">setCapacity()</a> to select the capacity of interest. </p>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00054">54</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3742ed39151811b5d1c263c75ee5b20a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t KeccakCore::blockSize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the input block size for the sponge function in bytes. </p>
<p>The block size is (1600 - <a class="el" href="classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e" title="Returns the capacity of the sponge function in bits. ">capacity()</a>) / 8.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e" title="Returns the capacity of the sponge function in bits. ">capacity()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8h_source.html#l00038">38</a> of file <a class="el" href="KeccakCore_8h_source.html">KeccakCore.h</a>.</p>
</div>
</div>
<a class="anchor" id="a804b895121a4e04bc491f41a5821a13e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t KeccakCore::capacity </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the capacity of the sponge function in bits. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#ab3c1905f2002e49aca085d6f0b5546f7" title="Sets the capacity of the Keccak sponge function in bits. ">setCapacity()</a>, <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00076">76</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="acaf5c13452003e6e2e7793939f62a123"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::encrypt </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>output</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>input</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Extracts data from the Keccak sponge function and uses it to encrypt a buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">output</td><td>The output buffer to write to, which may be the same buffer as <em>input</em>. The <em>output</em> buffer must have at least as many bytes as the <em>input</em> buffer. </td></tr>
<tr><td class="paramname">input</td><td>The input buffer to read from. </td></tr>
<tr><td class="paramname">size</td><td>The number of bytes to encrypt.</td></tr>
</table>
</dd>
</dl>
<p>This function extracts data from the sponge function and then XOR's it with <em>input</em> to generate the <em>output</em>.</p>
<p>If more than <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a> bytes are required, the sponge function will be invoked to generate additional data.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed" title="Updates the Keccak sponge function with more input data. ">update()</a>, <a class="el" href="classKeccakCore.html#a5a322eb7e3b5c1eaad127c9c6e6a529b" title="Resets the Keccak sponge function ready for a new session. ">reset()</a>, <a class="el" href="classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f" title="Extracts data from the Keccak sponge function. ">extract()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00240">240</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aad83ece853c0cc15fcab947fdcba924f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::extract </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Extracts data from the Keccak sponge function. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>The data buffer to fill with extracted data. </td></tr>
<tr><td class="paramname">size</td><td>The number number of bytes of extracted data that are required.</td></tr>
</table>
</dd>
</dl>
<p>If more than <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a> bytes are required, the sponge function will be invoked to generate additional data.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed" title="Updates the Keccak sponge function with more input data. ">update()</a>, <a class="el" href="classKeccakCore.html#a5a322eb7e3b5c1eaad127c9c6e6a529b" title="Resets the Keccak sponge function ready for a new session. ">reset()</a>, <a class="el" href="classKeccakCore.html#acaf5c13452003e6e2e7793939f62a123" title="Extracts data from the Keccak sponge function and uses it to encrypt a buffer. ">encrypt()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00194">194</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a97852ee4381ced17ee6d21704cf0b4d7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::pad </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>tag</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Pads the last block of input data to <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">tag</td><td>The tag byte to add to the padding to identify SHA3 (0x06), <a class="el" href="classSHAKE.html" title="Abstract base class for the SHAKE Extendable-Output Functions (XOFs). ">SHAKE</a> (0x1F), or the plain pre-standardized version of Keccak (0x01).</td></tr>
</table>
</dd>
</dl>
<p>The sponge function will be invoked to process the completed padding block.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed" title="Updates the Keccak sponge function with more input data. ">update()</a>, <a class="el" href="classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f" title="Extracts data from the Keccak sponge function. ">extract()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00167">167</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5a322eb7e3b5c1eaad127c9c6e6a529b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::reset </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Resets the Keccak sponge function ready for a new session. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed" title="Updates the Keccak sponge function with more input data. ">update()</a>, <a class="el" href="classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f" title="Extracts data from the Keccak sponge function. ">extract()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00114">114</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab3c1905f2002e49aca085d6f0b5546f7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::setCapacity </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>capacity</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the capacity of the Keccak sponge function in bits. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">capacity</td><td>The capacity of the Keccak sponge function in bits which should be a multiple of 64 and between 64 and 1536.</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>It is possible to create a sponge function with this constructor that doesn't strictly conform with the capacity and hash size constraints defined in the relevant standards. It is the responsibility of callers to only use standard parameter combinations.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e" title="Returns the capacity of the sponge function in bits. ">capacity()</a>, <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00094">94</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aeff6b3357916bf426b60d3629db52628"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::setHMACKey </td>
<td>(</td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pad</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>hashSize</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets a HMAC key for a Keccak-based hash algorithm. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>Points to the HMAC key for the hashing process. </td></tr>
<tr><td class="paramname">len</td><td>Length of the HMAC <em>key</em> in bytes. </td></tr>
<tr><td class="paramname">pad</td><td>Inner (0x36) or outer (0x5C) padding value to XOR with the formatted HMAC key. </td></tr>
<tr><td class="paramname">hashSize</td><td>The size of the output from the hash algorithm.</td></tr>
</table>
</dd>
</dl>
<p>This function is intended to help classes implement <a class="el" href="classHash.html#adf50359c1f525af884721cc9034e7945" title="Resets the hash ready for a new HMAC hashing process. ">Hash::resetHMAC()</a> and <a class="el" href="classHash.html#aab42fa5420cc0bda4321a3d3866cfd06" title="Finalizes the HMAC hashing process and returns the hash. ">Hash::finalizeHMAC()</a> by directly formatting the HMAC key into the internal block buffer and resetting the hash. </p>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00293">293</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaaa0355ccec0f469ac8eb577bdf853ed"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void KeccakCore::update </td>
<td>(</td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the Keccak sponge function with more input data. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>The extra input data to incorporate. </td></tr>
<tr><td class="paramname">size</td><td>The size of the new data to incorporate.</td></tr>
</table>
</dd>
</dl>
<p>This function will invoke the sponge function whenever a full <a class="el" href="classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a" title="Returns the input block size for the sponge function in bytes. ">blockSize()</a> bytes of input data have been accumulated. Call <a class="el" href="classKeccakCore.html#a97852ee4381ced17ee6d21704cf0b4d7" title="Pads the last block of input data to blockSize(). ">pad()</a> after the last block to finalize the input before calling <a class="el" href="classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f" title="Extracts data from the Keccak sponge function. ">extract()</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classKeccakCore.html#a97852ee4381ced17ee6d21704cf0b4d7" title="Pads the last block of input data to blockSize(). ">pad()</a>, <a class="el" href="classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f" title="Extracts data from the Keccak sponge function. ">extract()</a>, <a class="el" href="classKeccakCore.html#a5a322eb7e3b5c1eaad127c9c6e6a529b" title="Resets the Keccak sponge function ready for a new session. ">reset()</a> </dd></dl>
<p>Definition at line <a class="el" href="KeccakCore_8cpp_source.html#l00133">133</a> of file <a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="KeccakCore_8h_source.html">KeccakCore.h</a></li>
<li><a class="el" href="KeccakCore_8cpp_source.html">KeccakCore.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 27 2018 12:01:32 for Arduino Cryptography Library by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>