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

422 lines
28 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: BlockCipher 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="classBlockCipher-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">BlockCipher Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Abstract base class for block ciphers.
<a href="classBlockCipher.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="BlockCipher_8h_source.html">BlockCipher.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BlockCipher:</div>
<div class="dyncontent">
<div class="center">
<img src="classBlockCipher.png" usemap="#BlockCipher_map" alt=""/>
<map id="BlockCipher_map" name="BlockCipher_map">
<area href="classAESCommon.html" title="Abstract base class for AES block ciphers. " alt="AESCommon" shape="rect" coords="98,56,186,80"/>
<area href="classAESTiny128.html" title="AES block cipher with 128-bit keys and tiny memory usage. " alt="AESTiny128" shape="rect" coords="294,56,382,80"/>
<area href="classAESTiny256.html" title="AES block cipher with 256-bit keys and tiny memory usage. " alt="AESTiny256" shape="rect" coords="392,56,480,80"/>
<area href="classSpeck.html" title="Speck block cipher with a 128-bit block size. " alt="Speck" shape="rect" coords="490,56,578,80"/>
<area href="classSpeckTiny.html" title="Speck block cipher with a 128-bit block size (tiny-memory version). " alt="SpeckTiny" shape="rect" coords="588,56,676,80"/>
<area href="classAES128.html" title="AES block cipher with 128-bit keys. " alt="AES128" shape="rect" coords="0,112,88,136"/>
<area href="classAES192.html" title="AES block cipher with 192-bit keys. " alt="AES192" shape="rect" coords="98,112,186,136"/>
<area href="classAES256.html" title="AES block cipher with 256-bit keys. " alt="AES256" shape="rect" coords="196,112,284,136"/>
<area href="classAESSmall128.html" title="AES block cipher with 128-bit keys and reduced memory usage. " alt="AESSmall128" shape="rect" coords="294,112,382,136"/>
<area href="classAESSmall256.html" title="AES block cipher with 256-bit keys and reduced memory usage. " alt="AESSmall256" shape="rect" coords="392,112,480,136"/>
<area href="classSpeckSmall.html" title="Speck block cipher with a 128-bit block size (small-memory version). " alt="SpeckSmall" shape="rect" coords="588,112,676,136"/>
</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:adc3d7cba116cbea9ad017f4cded6fe2f"><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"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a block cipher. <br/></td></tr>
<tr class="separator:adc3d7cba116cbea9ad017f4cded6fe2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acec1bc4faeaa6dda2d91bffd79a988f9"><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"><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"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7059a310487c128db034b0ce0ad425a0"><td class="memItemLeft" align="right" valign="top">virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0">blockSize</a> () const =0</td></tr>
<tr class="memdesc:a7059a310487c128db034b0ce0ad425a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of a single block processed by this cipher, in bytes. <a href="#a7059a310487c128db034b0ce0ad425a0">More...</a><br/></td></tr>
<tr class="separator:a7059a310487c128db034b0ce0ad425a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afde6004a859e015d877eab3c37042a0f"><td class="memItemLeft" align="right" valign="top">virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#afde6004a859e015d877eab3c37042a0f">keySize</a> () const =0</td></tr>
<tr class="memdesc:afde6004a859e015d877eab3c37042a0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default size of the key for this block cipher, in bytes. <a href="#afde6004a859e015d877eab3c37042a0f">More...</a><br/></td></tr>
<tr class="separator:afde6004a859e015d877eab3c37042a0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a05307664469777592799c8f77397c4"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#a9a05307664469777592799c8f77397c4">setKey</a> (const uint8_t *key, size_t len)=0</td></tr>
<tr class="memdesc:a9a05307664469777592799c8f77397c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the key to use for future encryption and decryption operations. <a href="#a9a05307664469777592799c8f77397c4">More...</a><br/></td></tr>
<tr class="separator:a9a05307664469777592799c8f77397c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed0788b25f6bb2f1bd47d5a5f0c5db33"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33">encryptBlock</a> (uint8_t *output, const uint8_t *input)=0</td></tr>
<tr class="memdesc:aed0788b25f6bb2f1bd47d5a5f0c5db33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encrypts a single block using this cipher. <a href="#aed0788b25f6bb2f1bd47d5a5f0c5db33">More...</a><br/></td></tr>
<tr class="separator:aed0788b25f6bb2f1bd47d5a5f0c5db33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3ba2450222aa1ea804ae4881ab6440c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c">decryptBlock</a> (uint8_t *output, const uint8_t *input)=0</td></tr>
<tr class="memdesc:ac3ba2450222aa1ea804ae4881ab6440c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrypts a single block using this cipher. <a href="#ac3ba2450222aa1ea804ae4881ab6440c">More...</a><br/></td></tr>
<tr class="separator:ac3ba2450222aa1ea804ae4881ab6440c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f27d46e9dfa7761d014d828ad5f955b"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b">clear</a> ()=0</td></tr>
<tr class="memdesc:a6f27d46e9dfa7761d014d828ad5f955b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all security-sensitive state from this block cipher. <a href="#a6f27d46e9dfa7761d014d828ad5f955b">More...</a><br/></td></tr>
<tr class="separator:a6f27d46e9dfa7761d014d828ad5f955b"><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>Abstract base class for block ciphers. </p>
<p>Block ciphers always operate in electronic codebook (ECB) mode. Higher-level classes such as CFB128 and CTR128 wrap the block cipher to create more useful classes for encryption and decryption of bulk data.</p>
<p>References: <a href="http://en.wikipedia.org/wiki/Block_cipher,">http://en.wikipedia.org/wiki/Block_cipher,</a> <a href="http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29">http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29</a> </p>
<p>Definition at line <a class="el" href="BlockCipher_8h_source.html#l00029">29</a> of file <a class="el" href="BlockCipher_8h_source.html">BlockCipher.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="acec1bc4faeaa6dda2d91bffd79a988f9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">BlockCipher::~BlockCipher </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>Destroys this block cipher object. </p>
<p>Subclasses are responsible for clearing temporary key schedules and other buffers so as to avoid leaking sensitive information.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b" title="Clears all security-sensitive state from this block cipher. ">clear()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlockCipher_8cpp_source.html#l00052">52</a> of file <a class="el" href="BlockCipher_8cpp_source.html">BlockCipher.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7059a310487c128db034b0ce0ad425a0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t BlockCipher::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">pure 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="classBlockCipher.html#afde6004a859e015d877eab3c37042a0f" title="Default size of the key for this block cipher, in bytes. ">keySize()</a>, <a class="el" href="classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33" title="Encrypts a single block using this cipher. ">encryptBlock()</a> </dd></dl>
<p>Implemented in <a class="el" href="classAESTiny128.html#ad00941c5ed48c413b30636420fd42a2e">AESTiny128</a>, <a class="el" href="classAESTiny256.html#a3f48f55b7600dfc672acda899928de76">AESTiny256</a>, <a class="el" href="classAESCommon.html#ae26afdcc6d18e8888974acae16df1413">AESCommon</a>, <a class="el" href="classSpeckTiny.html#af8bbd1d1124fd1c4ef1aa167625376a9">SpeckTiny</a>, and <a class="el" href="classSpeck.html#a18a3b982a2cbc48befc8d498de08f188">Speck</a>.</p>
</div>
</div>
<a class="anchor" id="a6f27d46e9dfa7761d014d828ad5f955b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void BlockCipher::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">pure 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="classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33" title="Encrypts a single block using this cipher. ">encryptBlock()</a> or <a class="el" href="classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c" 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="classBlockCipher.html#a9a05307664469777592799c8f77397c4" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a>, <a class="el" href="classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33" title="Encrypts a single block using this cipher. ">encryptBlock()</a>, <a class="el" href="classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c" title="Decrypts a single block using this cipher. ">decryptBlock()</a> </dd></dl>
<p>Implemented in <a class="el" href="classAESSmall128.html#a215b28599d388c2149aba2206d40863d">AESSmall128</a>, <a class="el" href="classAESTiny128.html#a17e56d025f9e55041150953d8561c793">AESTiny128</a>, <a class="el" href="classAESSmall256.html#ac63bf2dff7de8a73ba57f4bb0f1df444">AESSmall256</a>, <a class="el" href="classAESTiny256.html#ae4cac6af2e78cbf399b7f6d0e613a578">AESTiny256</a>, <a class="el" href="classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6">AESCommon</a>, <a class="el" href="classSpeckTiny.html#a303ecc2639459e47c6eeb21991d52ccf">SpeckTiny</a>, <a class="el" href="classSpeck.html#aa3866273282addabb9d3703c41fdc95f">Speck</a>, and <a class="el" href="classSpeckSmall.html#aa93d9f0b5153425dc04e8fb8faff7513">SpeckSmall</a>.</p>
</div>
</div>
<a class="anchor" id="ac3ba2450222aa1ea804ae4881ab6440c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void BlockCipher::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">pure 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="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" 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="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" 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="classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33" title="Encrypts a single block using this cipher. ">encryptBlock()</a>, <a class="el" href="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> </dd></dl>
<p>Implemented in <a class="el" href="classAESSmall128.html#aabdb20c638b2107b5b5e3e41dc6dae26">AESSmall128</a>, <a class="el" href="classAESTiny128.html#a631c417a0f12c7e43f633c555b950182">AESTiny128</a>, <a class="el" href="classAESSmall256.html#aaba6d59d07d2f40efa8c962375c15888">AESSmall256</a>, <a class="el" href="classAESTiny256.html#abdf72a52c37c060a9089693c118585bc">AESTiny256</a>, <a class="el" href="classAESCommon.html#a95a806adf42f975765ff62907efdc639">AESCommon</a>, <a class="el" href="classSpeckTiny.html#a19e54aef7d1b3ef92e8140dd9c308c3c">SpeckTiny</a>, <a class="el" href="classSpeck.html#ad8c040df1c52d2559da8fdb3963d28b4">Speck</a>, and <a class="el" href="classSpeckSmall.html#acced022717603980ecca21b3f953bf51">SpeckSmall</a>.</p>
</div>
</div>
<a class="anchor" id="aed0788b25f6bb2f1bd47d5a5f0c5db33"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void BlockCipher::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">pure 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="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" 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="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" 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="classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c" title="Decrypts a single block using this cipher. ">decryptBlock()</a>, <a class="el" href="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> </dd></dl>
<p>Implemented in <a class="el" href="classAESTiny128.html#a9e343baf2c3c815f8482222c52ebb3a3">AESTiny128</a>, <a class="el" href="classAESTiny256.html#a36e4ffc85f7d7604d01a5629c185d0ef">AESTiny256</a>, <a class="el" href="classAESCommon.html#a2d95f6159abfcd92b5841f9018e44296">AESCommon</a>, <a class="el" href="classSpeckTiny.html#a5dd2cf40dc48addb6a393e78a58a07c0">SpeckTiny</a>, and <a class="el" href="classSpeck.html#af6b8b91929e4b5b2023400688c9437f9">Speck</a>.</p>
</div>
</div>
<a class="anchor" id="afde6004a859e015d877eab3c37042a0f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t BlockCipher::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">pure 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="classBlockCipher.html#a9a05307664469777592799c8f77397c4" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a>, <a class="el" href="classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0" title="Size of a single block processed by this cipher, in bytes. ">blockSize()</a> </dd></dl>
<p>Implemented in <a class="el" href="classAESTiny128.html#a6ff732873f0df88d93c3f7df1fb7a168">AESTiny128</a>, <a class="el" href="classAESTiny256.html#a7b5a2ba4829e79283c53248d3d8a7a06">AESTiny256</a>, <a class="el" href="classAES256.html#af8ed6412bae6fc78274f60344899366a">AES256</a>, <a class="el" href="classAES192.html#ade28843e51e262b30eb55791c83fd791">AES192</a>, <a class="el" href="classAES128.html#aa871832a156f0ea61b964e489670ae9d">AES128</a>, <a class="el" href="classSpeckTiny.html#a5587909ba48776b01bbd40b339b1262e">SpeckTiny</a>, and <a class="el" href="classSpeck.html#a061e43c1363178cda088c3f46e07d87b">Speck</a>.</p>
</div>
</div>
<a class="anchor" id="a9a05307664469777592799c8f77397c4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool BlockCipher::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">pure 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="classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b" 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="classBlockCipher.html#afde6004a859e015d877eab3c37042a0f" title="Default size of the key for this block cipher, in bytes. ">keySize()</a>, <a class="el" href="classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b" title="Clears all security-sensitive state from this block cipher. ">clear()</a> </dd></dl>
<p>Implemented in <a class="el" href="classAESSmall128.html#a6ca13e59f88498c8c3da338e76f47de5">AESSmall128</a>, <a class="el" href="classAESTiny128.html#a475b147be367e6053ff64e30bf79694c">AESTiny128</a>, <a class="el" href="classAESSmall256.html#ae7e05119a6183d5f7fc520206f97c0e0">AESSmall256</a>, <a class="el" href="classAESTiny256.html#abc162075b181bfca34144f4eec6deec7">AESTiny256</a>, <a class="el" href="classAES256.html#a6af085d2d6a730ff1e025f982121bbda">AES256</a>, <a class="el" href="classAES192.html#a4ab37cff19fb05ceef1533ebc5e37cde">AES192</a>, <a class="el" href="classAES128.html#a42d7548eb5084a2c3e2d5aa5f6f98ba4">AES128</a>, <a class="el" href="classSpeckTiny.html#a05180c773b9d26d3b67ff569dc86fc2d">SpeckTiny</a>, <a class="el" href="classSpeck.html#a7a07fc025bd25d832e9899333b5dabef">Speck</a>, and <a class="el" href="classSpeckSmall.html#a3345df135f6530bad475d630ef6c1038">SpeckSmall</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="BlockCipher_8h_source.html">BlockCipher.h</a></li>
<li><a class="el" href="BlockCipher_8cpp_source.html">BlockCipher.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>