mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
543 lines
32 KiB
HTML
543 lines
32 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: CBCCommon 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 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 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 List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class 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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </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> |
|
|
<a href="#pro-methods">Protected Member Functions</a> |
|
|
<a href="classCBCCommon-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">CBCCommon Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Concrete base class to assist with implementing <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> for 128-bit block ciphers.
|
|
<a href="classCBCCommon.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="CBC_8h_source.html">CBC.h</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for CBCCommon:</div>
|
|
<div class="dyncontent">
|
|
<div class="center">
|
|
<img src="classCBCCommon.png" usemap="#CBCCommon_map" alt=""/>
|
|
<map id="CBCCommon_map" name="CBCCommon_map">
|
|
<area href="classCipher.html" title="Abstract base class for stream ciphers. " alt="Cipher" shape="rect" coords="0,0,86,24"/>
|
|
<area href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ..." alt="CBC< T >" shape="rect" coords="0,112,86,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:a45a91367531b4692b3bb7237ab6e9015"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45a91367531b4692b3bb7237ab6e9015"></a>
|
|
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#a45a91367531b4692b3bb7237ab6e9015">~CBCCommon</a> ()</td></tr>
|
|
<tr class="memdesc:a45a91367531b4692b3bb7237ab6e9015"><td class="mdescLeft"> </td><td class="mdescRight">Destroys this cipher object after clearing sensitive information. <br/></td></tr>
|
|
<tr class="separator:a45a91367531b4692b3bb7237ab6e9015"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:adb7daacfe2a4fca3d13b62b75372fe4e"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e">keySize</a> () const </td></tr>
|
|
<tr class="memdesc:adb7daacfe2a4fca3d13b62b75372fe4e"><td class="mdescLeft"> </td><td class="mdescRight">Default size of the key for this cipher, in bytes. <a href="#adb7daacfe2a4fca3d13b62b75372fe4e">More...</a><br/></td></tr>
|
|
<tr class="separator:adb7daacfe2a4fca3d13b62b75372fe4e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a016277533730284a38bb6ad8cd6f91ce"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#a016277533730284a38bb6ad8cd6f91ce">ivSize</a> () const </td></tr>
|
|
<tr class="memdesc:a016277533730284a38bb6ad8cd6f91ce"><td class="mdescLeft"> </td><td class="mdescRight">Size of the initialization vector for this cipher, in bytes. <a href="#a016277533730284a38bb6ad8cd6f91ce">More...</a><br/></td></tr>
|
|
<tr class="separator:a016277533730284a38bb6ad8cd6f91ce"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:add75ea4342a190e560cee26a8e9efc37"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#add75ea4342a190e560cee26a8e9efc37">setKey</a> (const uint8_t *key, size_t len)</td></tr>
|
|
<tr class="memdesc:add75ea4342a190e560cee26a8e9efc37"><td class="mdescLeft"> </td><td class="mdescRight">Sets the key to use for future encryption and decryption operations. <a href="#add75ea4342a190e560cee26a8e9efc37">More...</a><br/></td></tr>
|
|
<tr class="separator:add75ea4342a190e560cee26a8e9efc37"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac7a586217835055b3a354bb932db160c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#ac7a586217835055b3a354bb932db160c">setIV</a> (const uint8_t *iv, size_t len)</td></tr>
|
|
<tr class="memdesc:ac7a586217835055b3a354bb932db160c"><td class="mdescLeft"> </td><td class="mdescRight">Sets the initialization vector to use for future encryption and decryption operations. <a href="#ac7a586217835055b3a354bb932db160c">More...</a><br/></td></tr>
|
|
<tr class="separator:ac7a586217835055b3a354bb932db160c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a41d2f655a7df13cfcd009b2882e13147"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147">encrypt</a> (uint8_t *output, const uint8_t *input, size_t len)</td></tr>
|
|
<tr class="memdesc:a41d2f655a7df13cfcd009b2882e13147"><td class="mdescLeft"> </td><td class="mdescRight">Encrypts an input buffer and writes the ciphertext to an output buffer. <a href="#a41d2f655a7df13cfcd009b2882e13147">More...</a><br/></td></tr>
|
|
<tr class="separator:a41d2f655a7df13cfcd009b2882e13147"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab46a2625cae9a654c708e1f31a0e22b6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6">decrypt</a> (uint8_t *output, const uint8_t *input, size_t len)</td></tr>
|
|
<tr class="memdesc:ab46a2625cae9a654c708e1f31a0e22b6"><td class="mdescLeft"> </td><td class="mdescRight">Decrypts an input buffer and writes the plaintext to an output buffer. <a href="#ab46a2625cae9a654c708e1f31a0e22b6">More...</a><br/></td></tr>
|
|
<tr class="separator:ab46a2625cae9a654c708e1f31a0e22b6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7befadfe7384e0e857a96a59bf3845e9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9">clear</a> ()</td></tr>
|
|
<tr class="memdesc:a7befadfe7384e0e857a96a59bf3845e9"><td class="mdescLeft"> </td><td class="mdescRight">Clears all security-sensitive state from this cipher. <a href="#a7befadfe7384e0e857a96a59bf3845e9">More...</a><br/></td></tr>
|
|
<tr class="separator:a7befadfe7384e0e857a96a59bf3845e9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="inherit_header pub_methods_classCipher"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classCipher')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classCipher.html">Cipher</a></td></tr>
|
|
<tr class="memitem:a6a61077eca3ccd5900f92ceac58fb09c inherit pub_methods_classCipher"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a61077eca3ccd5900f92ceac58fb09c"></a>
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classCipher.html#a6a61077eca3ccd5900f92ceac58fb09c">Cipher</a> ()</td></tr>
|
|
<tr class="memdesc:a6a61077eca3ccd5900f92ceac58fb09c inherit pub_methods_classCipher"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a new cipher object. <br/></td></tr>
|
|
<tr class="separator:a6a61077eca3ccd5900f92ceac58fb09c inherit pub_methods_classCipher"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a84bdea765f7e35aa5b5950dd2853a383 inherit pub_methods_classCipher"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classCipher.html#a84bdea765f7e35aa5b5950dd2853a383">~Cipher</a> ()</td></tr>
|
|
<tr class="memdesc:a84bdea765f7e35aa5b5950dd2853a383 inherit pub_methods_classCipher"><td class="mdescLeft"> </td><td class="mdescRight">Destroys this cipher object. <a href="#a84bdea765f7e35aa5b5950dd2853a383">More...</a><br/></td></tr>
|
|
<tr class="separator:a84bdea765f7e35aa5b5950dd2853a383 inherit pub_methods_classCipher"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
|
|
Protected Member Functions</h2></td></tr>
|
|
<tr class="memitem:a7575b369910e05f54e76698dd04bfa05"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#a7575b369910e05f54e76698dd04bfa05">CBCCommon</a> ()</td></tr>
|
|
<tr class="memdesc:a7575b369910e05f54e76698dd04bfa05"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a new cipher in <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> mode. <a href="#a7575b369910e05f54e76698dd04bfa05">More...</a><br/></td></tr>
|
|
<tr class="separator:a7575b369910e05f54e76698dd04bfa05"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0b7631244b0c2c954cfdb50eb32f7db1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCBCCommon.html#a0b7631244b0c2c954cfdb50eb32f7db1">setBlockCipher</a> (<a class="el" href="classBlockCipher.html">BlockCipher</a> *cipher)</td></tr>
|
|
<tr class="memdesc:a0b7631244b0c2c954cfdb50eb32f7db1"><td class="mdescLeft"> </td><td class="mdescRight">Sets the block cipher to use for this <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> object. <a href="#a0b7631244b0c2c954cfdb50eb32f7db1">More...</a><br/></td></tr>
|
|
<tr class="separator:a0b7631244b0c2c954cfdb50eb32f7db1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Concrete base class to assist with implementing <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> for 128-bit block ciphers. </p>
|
|
<p>Reference: <a href="http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation">http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation</a></p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8h_source.html#l00029">29</a> of file <a class="el" href="CBC_8h_source.html">CBC.h</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" id="a7575b369910e05f54e76698dd04bfa05"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">CBCCommon::CBCCommon </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Constructs a new cipher in <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> mode. </p>
|
|
<p>This constructor should be followed by a call to <a class="el" href="classCBCCommon.html#a0b7631244b0c2c954cfdb50eb32f7db1" title="Sets the block cipher to use for this CBC object. ">setBlockCipher()</a>. </p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00042">42</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a class="anchor" id="a7befadfe7384e0e857a96a59bf3845e9"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CBCCommon::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 cipher. </p>
|
|
<p>Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by <a class="el" href="classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147" title="Encrypts an input buffer and writes the ciphertext to an output buffer. ">encrypt()</a> or <a class="el" href="classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6" title="Decrypts an input buffer and writes the plaintext to an output buffer. ">decrypt()</a> which is stored in the cipher itself. </p>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00113">113</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ab46a2625cae9a654c708e1f31a0e22b6"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CBCCommon::decrypt </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t * </td>
|
|
<td class="paramname"><em>output</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const uint8_t * </td>
|
|
<td class="paramname"><em>input</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>len</em> </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 an input buffer and writes the plaintext to an output 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">len</td><td>The number of bytes to decrypt.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>The <a class="el" href="classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6" title="Decrypts an input buffer and writes the plaintext to an output buffer. ">decrypt()</a> function can be called multiple times with different regions of the ciphertext data.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147" title="Encrypts an input buffer and writes the ciphertext to an output buffer. ">encrypt()</a> </dd></dl>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#ac6099d1a0d7f2ff67b0e4ccb4a17eb08">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00099">99</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a41d2f655a7df13cfcd009b2882e13147"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CBCCommon::encrypt </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t * </td>
|
|
<td class="paramname"><em>output</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const uint8_t * </td>
|
|
<td class="paramname"><em>input</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>len</em> </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 an input buffer and writes the ciphertext to an output 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">len</td><td>The number of bytes to encrypt.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>The <a class="el" href="classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147" title="Encrypts an input buffer and writes the ciphertext to an output buffer. ">encrypt()</a> function can be called multiple times with different regions of the plaintext data.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6" title="Decrypts an input buffer and writes the plaintext to an output buffer. ">decrypt()</a> </dd></dl>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#ad2832bd61039d61560e34ea3382ca562">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00086">86</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a016277533730284a38bb6ad8cd6f91ce"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t CBCCommon::ivSize </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 the initialization vector for this cipher, in bytes. </p>
|
|
<p>If the cipher does not need an initialization vector, this function will return zero. </p>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#ab8b53ddc4ce431f03c2a1903d70ace9c">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00062">62</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="adb7daacfe2a4fca3d13b62b75372fe4e"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t CBCCommon::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 cipher, in bytes. </p>
|
|
<p>If the cipher supports variable-sized keys, <a class="el" href="classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e" title="Default size of the key for this cipher, in bytes. ">keySize()</a> indicates the default or recommended key size. The cipher may support other key sizes.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCBCCommon.html#add75ea4342a190e560cee26a8e9efc37" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a>, <a class="el" href="classCBCCommon.html#a016277533730284a38bb6ad8cd6f91ce" title="Size of the initialization vector for this cipher, in bytes. ">ivSize()</a> </dd></dl>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#a4cea432ea0278c865441f17cbb88b1ab">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00057">57</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a0b7631244b0c2c954cfdb50eb32f7db1"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CBCCommon::setBlockCipher </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classBlockCipher.html">BlockCipher</a> * </td>
|
|
<td class="paramname"><em>cipher</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the block cipher to use for this <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> object. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">cipher</td><td>The block cipher to use to implement <a class="el" href="classCBC.html" title="Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...">CBC</a> mode, which must have a block size of 16 bytes (128 bits). </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8h_source.html#l00047">47</a> of file <a class="el" href="CBC_8h_source.html">CBC.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ac7a586217835055b3a354bb932db160c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CBCCommon::setIV </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const uint8_t * </td>
|
|
<td class="paramname"><em>iv</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>len</em> </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 initialization vector to use for future encryption and decryption operations. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">iv</td><td>The initialization vector to use. </td></tr>
|
|
<tr><td class="paramname">len</td><td>The length of the initialization vector in bytes. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Returns false if the length is not supported.</dd></dl>
|
|
<p>Initialization vectors should be set before the first call to <a class="el" href="classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147" title="Encrypts an input buffer and writes the ciphertext to an output buffer. ">encrypt()</a> or <a class="el" href="classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6" title="Decrypts an input buffer and writes the plaintext to an output buffer. ">decrypt()</a> after a <a class="el" href="classCBCCommon.html#add75ea4342a190e560cee26a8e9efc37" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a> call. If the initialization vector is changed after encryption or decryption begins, then the behaviour is undefined.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>The IV is not encoded into the output stream by <a class="el" href="classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147" title="Encrypts an input buffer and writes the ciphertext to an output buffer. ">encrypt()</a>. The caller is responsible for communicating the IV to the other party.</dd></dl>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCBCCommon.html#a016277533730284a38bb6ad8cd6f91ce" title="Size of the initialization vector for this cipher, in bytes. ">ivSize()</a> </dd></dl>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#a3777acd8ff776a4e945bb7c9f2d044d9">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00077">77</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="add75ea4342a190e560cee26a8e9efc37"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CBCCommon::setKey </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const uint8_t * </td>
|
|
<td class="paramname"><em>key</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>len</em> </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 in bytes. </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="classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9" title="Clears all security-sensitive state from this 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>
|
|
<p>Calling <a class="el" href="classCBCCommon.html#add75ea4342a190e560cee26a8e9efc37" title="Sets the key to use for future encryption and decryption operations. ">setKey()</a> resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e" title="Default size of the key for this cipher, in bytes. ">keySize()</a>, <a class="el" href="classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9" title="Clears all security-sensitive state from this cipher. ">clear()</a> </dd></dl>
|
|
|
|
<p>Implements <a class="el" href="classCipher.html#a0dfe133bda81dfa680b668f5908ccbe5">Cipher</a>.</p>
|
|
|
|
<p>Definition at line <a class="el" href="CBC_8cpp_source.html#l00067">67</a> of file <a class="el" href="CBC_8cpp_source.html">CBC.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li><a class="el" href="CBC_8h_source.html">CBC.h</a></li>
|
|
<li><a class="el" href="CBC_8cpp_source.html">CBC.cpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Thu Apr 2 2015 16:36:51 for ArduinoLibs by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.6
|
|
</small></address>
|
|
</body>
|
|
</html>
|