1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00
arduinolibs/classSpeckLowMemory.html
Rhys Weatherley ab1bf9b19b Update docs
2016-01-16 09:47:55 +10:00

428 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.6"/>
<title>ArduinoLibs: SpeckLowMemory 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">ArduinoLibs
</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><a href="modules.html"><span>Modules</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>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><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="classSpeckLowMemory-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">SpeckLowMemory Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> block cipher with a 128-bit block size (low-memory version).
<a href="classSpeckLowMemory.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="SpeckLowMemory_8h_source.html">SpeckLowMemory.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for SpeckLowMemory:</div>
<div class="dyncontent">
<div class="center">
<img src="classSpeckLowMemory.png" usemap="#SpeckLowMemory_map" alt=""/>
<map id="SpeckLowMemory_map" name="SpeckLowMemory_map">
<area href="classBlockCipher.html" title="Abstract base class for block ciphers. " alt="BlockCipher" shape="rect" coords="0,0,116,24"/>
</map>
</div></div>
<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:a200cb46d4f4044d691a60f4c19c6021c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#a200cb46d4f4044d691a60f4c19c6021c">SpeckLowMemory</a> ()</td></tr>
<tr class="memdesc:a200cb46d4f4044d691a60f4c19c6021c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a low-memory <a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> block cipher with no initial key. <a href="#a200cb46d4f4044d691a60f4c19c6021c">More...</a><br/></td></tr>
<tr class="separator:a200cb46d4f4044d691a60f4c19c6021c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae16cc24406ad4f93e499d1ed95453090"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090">blockSize</a> () const </td></tr>
<tr class="memdesc:ae16cc24406ad4f93e499d1ed95453090"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of a single block processed by this cipher, in bytes. <a href="#ae16cc24406ad4f93e499d1ed95453090">More...</a><br/></td></tr>
<tr class="separator:ae16cc24406ad4f93e499d1ed95453090"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7cd4c7d2acb5b3dfa22ce08d659f279"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#ab7cd4c7d2acb5b3dfa22ce08d659f279">keySize</a> () const </td></tr>
<tr class="memdesc:ab7cd4c7d2acb5b3dfa22ce08d659f279"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default size of the key for this block cipher, in bytes. <a href="#ab7cd4c7d2acb5b3dfa22ce08d659f279">More...</a><br/></td></tr>
<tr class="separator:ab7cd4c7d2acb5b3dfa22ce08d659f279"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fda570e117f2b7977aaee3d1e93584b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#a0fda570e117f2b7977aaee3d1e93584b">setKey</a> (const uint8_t *key, size_t len)</td></tr>
<tr class="memdesc:a0fda570e117f2b7977aaee3d1e93584b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the key to use for future encryption and decryption operations. <a href="#a0fda570e117f2b7977aaee3d1e93584b">More...</a><br/></td></tr>
<tr class="separator:a0fda570e117f2b7977aaee3d1e93584b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad74f9cec21584184511f6d731b8ad5cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#ad74f9cec21584184511f6d731b8ad5cf">encryptBlock</a> (uint8_t *output, const uint8_t *input)</td></tr>
<tr class="memdesc:ad74f9cec21584184511f6d731b8ad5cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encrypts a single block using this cipher. <a href="#ad74f9cec21584184511f6d731b8ad5cf">More...</a><br/></td></tr>
<tr class="separator:ad74f9cec21584184511f6d731b8ad5cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf789790cf8ba15eb7025eea965215e9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#adf789790cf8ba15eb7025eea965215e9">decryptBlock</a> (uint8_t *output, const uint8_t *input)</td></tr>
<tr class="memdesc:adf789790cf8ba15eb7025eea965215e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrypts a single block using this cipher. <a href="#adf789790cf8ba15eb7025eea965215e9">More...</a><br/></td></tr>
<tr class="separator:adf789790cf8ba15eb7025eea965215e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c4fcd9a8ac0d2cf9dd11ce678146d99"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSpeckLowMemory.html#a5c4fcd9a8ac0d2cf9dd11ce678146d99">clear</a> ()</td></tr>
<tr class="memdesc:a5c4fcd9a8ac0d2cf9dd11ce678146d99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all security-sensitive state from this block cipher. <a href="#a5c4fcd9a8ac0d2cf9dd11ce678146d99">More...</a><br/></td></tr>
<tr class="separator:a5c4fcd9a8ac0d2cf9dd11ce678146d99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classBlockCipher"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classBlockCipher')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classBlockCipher.html">BlockCipher</a></td></tr>
<tr class="memitem:adc3d7cba116cbea9ad017f4cded6fe2f inherit pub_methods_classBlockCipher"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc3d7cba116cbea9ad017f4cded6fe2f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#adc3d7cba116cbea9ad017f4cded6fe2f">BlockCipher</a> ()</td></tr>
<tr class="memdesc:adc3d7cba116cbea9ad017f4cded6fe2f inherit pub_methods_classBlockCipher"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a block cipher. <br/></td></tr>
<tr class="separator:adc3d7cba116cbea9ad017f4cded6fe2f inherit pub_methods_classBlockCipher"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acec1bc4faeaa6dda2d91bffd79a988f9 inherit pub_methods_classBlockCipher"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#acec1bc4faeaa6dda2d91bffd79a988f9">~BlockCipher</a> ()</td></tr>
<tr class="memdesc:acec1bc4faeaa6dda2d91bffd79a988f9 inherit pub_methods_classBlockCipher"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys this block cipher object. <a href="#acec1bc4faeaa6dda2d91bffd79a988f9">More...</a><br/></td></tr>
<tr class="separator:acec1bc4faeaa6dda2d91bffd79a988f9 inherit pub_methods_classBlockCipher"><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><a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> block cipher with a 128-bit block size (low-memory version). </p>
<p>This class differs from the <a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> class in the following ways:</p>
<ul>
<li>RAM requirements are vastly reduced. The key (up to 256 bits) is stored directly and then expanded to the full key schedule round by round. The <a class="el" href="classSpeckLowMemory.html#a0fda570e117f2b7977aaee3d1e93584b" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a> method is very fast because of this. </li>
<li>Performance of <a class="el" href="classSpeckLowMemory.html#ad74f9cec21584184511f6d731b8ad5cf" title="Encrypts a single block using this cipher. ">encryptBlock()</a> is slower than for <a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> due to expanding the key on the fly rather than ahead of time. </li>
<li>The <a class="el" href="classSpeckLowMemory.html#adf789790cf8ba15eb7025eea965215e9" title="Decrypts a single block using this cipher. ">decryptBlock()</a> function is not supported, which means that <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> mode cannot be used but the <a class="el" href="classCTR.html" title="Implementation of the Counter (CTR) mode for 128-bit block ciphers. ">CTR</a>, <a class="el" href="classCFB.html" title="Implementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers. ">CFB</a>, <a class="el" href="classOFB.html" title="Implementation of the Output Feedback (OFB) mode for 128-bit block ciphers. ">OFB</a>, and <a class="el" href="classGCM.html" title="Implementation of the Galois Counter Mode (GCM). ">GCM</a> modes can be used.</li>
</ul>
<p>This class is useful when RAM is at a premium, <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> mode is not required, and reduced encryption performance is not a hindrance to the application. Even though the performance of <a class="el" href="classSpeckLowMemory.html#ad74f9cec21584184511f6d731b8ad5cf" title="Encrypts a single block using this cipher. ">encryptBlock()</a> is reduced, this class is still faster than AES with equivalent key sizes.</p>
<p>See the documentation for the <a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> class for more information on the <a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> family of block ciphers.</p>
<p>References: <a href="https://en.wikipedia.org/wiki/Speck_%28cipher%29,">https://en.wikipedia.org/wiki/Speck_%28cipher%29,</a> <a href="http://eprint.iacr.org/2013/404">http://eprint.iacr.org/2013/404</a></p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> </dd></dl>
<p>Definition at line <a class="el" href="SpeckLowMemory_8h_source.html#l00028">28</a> of file <a class="el" href="SpeckLowMemory_8h_source.html">SpeckLowMemory.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a200cb46d4f4044d691a60f4c19c6021c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">SpeckLowMemory::SpeckLowMemory </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a low-memory <a class="el" href="classSpeck.html" title="Speck block cipher with a 128-bit block size. ">Speck</a> block cipher with no initial key. </p>
<p>This constructor must be followed by a call to <a class="el" href="classSpeckLowMemory.html#a0fda570e117f2b7977aaee3d1e93584b" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a> before the block cipher can be used for encryption. </p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00073">73</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ae16cc24406ad4f93e499d1ed95453090"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t SpeckLowMemory::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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Size of a single block processed by this cipher, in bytes. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns the size of a block in bytes.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSpeckLowMemory.html#ab7cd4c7d2acb5b3dfa22ce08d659f279" title="Default size of the key for this block cipher, in bytes. ">keySize()</a>, <a class="el" href="classSpeckLowMemory.html#ad74f9cec21584184511f6d731b8ad5cf" title="Encrypts a single block using this cipher. ">encryptBlock()</a> </dd></dl>
<p>Implements <a class="el" href="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0">BlockCipher</a>.</p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00083">83</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5c4fcd9a8ac0d2cf9dd11ce678146d99"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void SpeckLowMemory::clear </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Clears all security-sensitive state from this block cipher. </p>
<p>Security-sensitive information includes key schedules and any temporary state that is used by <a class="el" href="classSpeckLowMemory.html#ad74f9cec21584184511f6d731b8ad5cf" title="Encrypts a single block using this cipher. ">encryptBlock()</a> or <a class="el" href="classSpeckLowMemory.html#adf789790cf8ba15eb7025eea965215e9" title="Decrypts a single block using this cipher. ">decryptBlock()</a> which is stored in the object itself.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSpeckLowMemory.html#a0fda570e117f2b7977aaee3d1e93584b" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a>, <a class="el" href="classSpeckLowMemory.html#ad74f9cec21584184511f6d731b8ad5cf" title="Encrypts a single block using this cipher. ">encryptBlock()</a>, <a class="el" href="classSpeckLowMemory.html#adf789790cf8ba15eb7025eea965215e9" title="Decrypts a single block using this cipher. ">decryptBlock()</a> </dd></dl>
<p>Implements <a class="el" href="classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b">BlockCipher</a>.</p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00542">542</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="adf789790cf8ba15eb7025eea965215e9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void SpeckLowMemory::decryptBlock </td>
<td>(</td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>output</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t *&#160;</td>
<td class="paramname"><em>input</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Decrypts a single block using this cipher. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">output</td><td>The output buffer to put the plaintext into. Must be at least <a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> bytes in length. </td></tr>
<tr><td class="paramname">input</td><td>The input buffer to read the ciphertext from which is allowed to overlap with <em>output</em>. Must be at least <a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> bytes in length.</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function is not supported for <a class="el" href="classSpeckLowMemory.html" title="Speck block cipher with a 128-bit block size (low-memory version). ">SpeckLowMemory</a>, which means that <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> mode cannot be used but that the <a class="el" href="classCTR.html" title="Implementation of the Counter (CTR) mode for 128-bit block ciphers. ">CTR</a>, <a class="el" href="classCFB.html" title="Implementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers. ">CFB</a>, <a class="el" href="classOFB.html" title="Implementation of the Output Feedback (OFB) mode for 128-bit block ciphers. ">OFB</a>, and <a class="el" href="classGCM.html" title="Implementation of the Galois Counter Mode (GCM). ">GCM</a> modes can be used. </dd></dl>
<p>Implements <a class="el" href="classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c">BlockCipher</a>.</p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00537">537</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad74f9cec21584184511f6d731b8ad5cf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void SpeckLowMemory::encryptBlock </td>
<td>(</td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>output</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t *&#160;</td>
<td class="paramname"><em>input</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Encrypts a single block using this cipher. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">output</td><td>The output buffer to put the ciphertext into. Must be at least <a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> bytes in length. </td></tr>
<tr><td class="paramname">input</td><td>The input buffer to read the plaintext from which is allowed to overlap with <em>output</em>. Must be at least <a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> bytes in length.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSpeckLowMemory.html#adf789790cf8ba15eb7025eea965215e9" title="Decrypts a single block using this cipher. ">decryptBlock()</a>, <a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> </dd></dl>
<p>Implements <a class="el" href="classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33">BlockCipher</a>.</p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00153">153</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab7cd4c7d2acb5b3dfa22ce08d659f279"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t SpeckLowMemory::keySize </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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Default size of the key for this block cipher, in bytes. </p>
<p>This value indicates the default, or recommended, size for the key.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSpeckLowMemory.html#a0fda570e117f2b7977aaee3d1e93584b" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a>, <a class="el" href="classSpeckLowMemory.html#ae16cc24406ad4f93e499d1ed95453090" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> </dd></dl>
<p>Implements <a class="el" href="classBlockCipher.html#afde6004a859e015d877eab3c37042a0f">BlockCipher</a>.</p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00088">88</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0fda570e117f2b7977aaee3d1e93584b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool SpeckLowMemory::setKey </td>
<td>(</td>
<td class="paramtype">const uint8_t *&#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>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the key to use for future encryption and decryption operations. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>The key to use. </td></tr>
<tr><td class="paramname">len</td><td>The length of the key. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.</dd></dl>
<p>Use <a class="el" href="classSpeckLowMemory.html#a5c4fcd9a8ac0d2cf9dd11ce678146d99" title="Clears all security-sensitive state from this block cipher. ">clear()</a> or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classSpeckLowMemory.html#ab7cd4c7d2acb5b3dfa22ce08d659f279" title="Default size of the key for this block cipher, in bytes. ">keySize()</a>, <a class="el" href="classSpeckLowMemory.html#a5c4fcd9a8ac0d2cf9dd11ce678146d99" title="Clears all security-sensitive state from this block cipher. ">clear()</a> </dd></dl>
<p>Implements <a class="el" href="classBlockCipher.html#a9a05307664469777592799c8f77397c4">BlockCipher</a>.</p>
<p>Definition at line <a class="el" href="SpeckLowMemory_8cpp_source.html#l00106">106</a> of file <a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="SpeckLowMemory_8h_source.html">SpeckLowMemory.h</a></li>
<li><a class="el" href="SpeckLowMemory_8cpp_source.html">SpeckLowMemory.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jan 16 2016 09:47:01 for ArduinoLibs 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>