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

505 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: XTSCommon 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="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classXTSCommon-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">XTSCommon Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Concrete base class to assist with implementing <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode for 128-bit block ciphers.
<a href="classXTSCommon.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="XTS_8h_source.html">XTS.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for XTSCommon:</div>
<div class="dyncontent">
<div class="center">
<img src="classXTSCommon.png" usemap="#XTSCommon_map" alt=""/>
<map id="XTSCommon_map" name="XTSCommon_map">
<area href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. " alt="XTS&lt; T1, T2 &gt;" shape="rect" coords="0,56,141,80"/>
<area href="classXTSSingleKeyCommon.html" title="Concrete base class to assist with implementing single-key XTS mode for 128-bit block ciphers..." alt="XTSSingleKeyCommon" shape="rect" coords="151,56,292,80"/>
<area href="classXTSSingleKey.html" title="Implementation of the single-key XTS mode for 128-bit block ciphers. " alt="XTSSingleKey&lt; T &gt;" shape="rect" coords="151,112,292,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:ac5398f0bd2201e7d3fa335899fb3c6f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac5398f0bd2201e7d3fa335899fb3c6f3"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#ac5398f0bd2201e7d3fa335899fb3c6f3">~XTSCommon</a> ()</td></tr>
<tr class="memdesc:ac5398f0bd2201e7d3fa335899fb3c6f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all sensitive information and destroys this object. <br/></td></tr>
<tr class="separator:ac5398f0bd2201e7d3fa335899fb3c6f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2da350825a438355665683ab9eb57aa7"><td class="memItemLeft" align="right" valign="top">virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a2da350825a438355665683ab9eb57aa7">keySize</a> () const </td></tr>
<tr class="memdesc:a2da350825a438355665683ab9eb57aa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the size of the key for <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode. <a href="#a2da350825a438355665683ab9eb57aa7">More...</a><br/></td></tr>
<tr class="separator:a2da350825a438355665683ab9eb57aa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb3ebf14c7879bcbc92e3d6cc70b19a9"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#afb3ebf14c7879bcbc92e3d6cc70b19a9">tweakSize</a> () const </td></tr>
<tr class="memdesc:afb3ebf14c7879bcbc92e3d6cc70b19a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the maximum supported size for the tweak. <a href="#afb3ebf14c7879bcbc92e3d6cc70b19a9">More...</a><br/></td></tr>
<tr class="separator:afb3ebf14c7879bcbc92e3d6cc70b19a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b96255bdf33eccca8f64eb1572cf8eb"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a7b96255bdf33eccca8f64eb1572cf8eb">sectorSize</a> () const </td></tr>
<tr class="memdesc:a7b96255bdf33eccca8f64eb1572cf8eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the size of sectors encrypted or decrypted by this class. <a href="#a7b96255bdf33eccca8f64eb1572cf8eb">More...</a><br/></td></tr>
<tr class="separator:a7b96255bdf33eccca8f64eb1572cf8eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e0aa61628285073545a8f8e0b0d981d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a7e0aa61628285073545a8f8e0b0d981d">setSectorSize</a> (size_t size)</td></tr>
<tr class="memdesc:a7e0aa61628285073545a8f8e0b0d981d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the size of sectors encrypted or decrypted by this class. <a href="#a7e0aa61628285073545a8f8e0b0d981d">More...</a><br/></td></tr>
<tr class="separator:a7e0aa61628285073545a8f8e0b0d981d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68b1ad6bad0b29aeb97dea80e4e03170"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a68b1ad6bad0b29aeb97dea80e4e03170">setKey</a> (const uint8_t *key, size_t len)</td></tr>
<tr class="memdesc:a68b1ad6bad0b29aeb97dea80e4e03170"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the key to use for <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode. <a href="#a68b1ad6bad0b29aeb97dea80e4e03170">More...</a><br/></td></tr>
<tr class="separator:a68b1ad6bad0b29aeb97dea80e4e03170"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a744a533d46078de5ea9723139f74bcdb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a744a533d46078de5ea9723139f74bcdb">setTweak</a> (const uint8_t *tweak, size_t len)</td></tr>
<tr class="memdesc:a744a533d46078de5ea9723139f74bcdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the tweak value for the current sector to encrypt or decrypt. <a href="#a744a533d46078de5ea9723139f74bcdb">More...</a><br/></td></tr>
<tr class="separator:a744a533d46078de5ea9723139f74bcdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bf1cbd4c1a5422a3cf285fe995fe0e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a8bf1cbd4c1a5422a3cf285fe995fe0e7">encryptSector</a> (uint8_t *output, const uint8_t *input)</td></tr>
<tr class="memdesc:a8bf1cbd4c1a5422a3cf285fe995fe0e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encrypts an entire sector of data. <a href="#a8bf1cbd4c1a5422a3cf285fe995fe0e7">More...</a><br/></td></tr>
<tr class="separator:a8bf1cbd4c1a5422a3cf285fe995fe0e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dd21d5a994724e2af433872ecc3a90b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a7dd21d5a994724e2af433872ecc3a90b">decryptSector</a> (uint8_t *output, const uint8_t *input)</td></tr>
<tr class="memdesc:a7dd21d5a994724e2af433872ecc3a90b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrypts an entire sector of data. <a href="#a7dd21d5a994724e2af433872ecc3a90b">More...</a><br/></td></tr>
<tr class="separator:a7dd21d5a994724e2af433872ecc3a90b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96e3cb4a3d35dc4e3a5acbae19b4465b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96e3cb4a3d35dc4e3a5acbae19b4465b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#a96e3cb4a3d35dc4e3a5acbae19b4465b">clear</a> ()</td></tr>
<tr class="memdesc:a96e3cb4a3d35dc4e3a5acbae19b4465b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all security-sensitive state from this <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> object. <br/></td></tr>
<tr class="separator:a96e3cb4a3d35dc4e3a5acbae19b4465b"><td class="memSeparator" colspan="2">&#160;</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:ae3ce2a2a72eb839f8ccde4a166ad40e6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3ce2a2a72eb839f8ccde4a166ad40e6"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#ae3ce2a2a72eb839f8ccde4a166ad40e6">XTSCommon</a> ()</td></tr>
<tr class="memdesc:ae3ce2a2a72eb839f8ccde4a166ad40e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs an <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> object with a default sector size of 512 bytes. <br/></td></tr>
<tr class="separator:ae3ce2a2a72eb839f8ccde4a166ad40e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aade8a16b70a49e8b04cb776522b29b7e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXTSCommon.html#aade8a16b70a49e8b04cb776522b29b7e">setBlockCiphers</a> (<a class="el" href="classBlockCipher.html">BlockCipher</a> *cipher1, <a class="el" href="classBlockCipher.html">BlockCipher</a> *cipher2)</td></tr>
<tr class="memdesc:aade8a16b70a49e8b04cb776522b29b7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the two block ciphers to use for <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode. <a href="#aade8a16b70a49e8b04cb776522b29b7e">More...</a><br/></td></tr>
<tr class="separator:aade8a16b70a49e8b04cb776522b29b7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a491bc097ea27712b30da67eb4a1d66bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a491bc097ea27712b30da67eb4a1d66bd"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>XTSSingleKeyCommon</b></td></tr>
<tr class="separator:a491bc097ea27712b30da67eb4a1d66bd"><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>Concrete base class to assist with implementing <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode for 128-bit block ciphers. </p>
<p>References: <a href="http://libeccio.di.unisa.it/Crypto14/Lab/p1619.pdf">IEEE Std. 1619-2007</a>, <a href="http://csrc.nist.gov/publications/nistpubs/800-38E/nist-sp-800-38E.pdf">NIST SP 800-38E</a>, a href="http://web.cs.ucdavis.edu/~rogaway/papers/offsets.pdf"&gt;XEX.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a>, <a class="el" href="classXTSSingleKey.html" title="Implementation of the single-key XTS mode for 128-bit block ciphers. ">XTSSingleKey</a> </dd></dl>
<p>Definition at line <a class="el" href="XTS_8h_source.html#l00030">30</a> of file <a class="el" href="XTS_8h_source.html">XTS.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7dd21d5a994724e2af433872ecc3a90b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XTSCommon::decryptSector </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>
</div><div class="memdoc">
<p>Decrypts an entire sector of data. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">output</td><td>The output buffer to write the plaintext to, which can be the same as <em>input</em>. </td></tr>
<tr><td class="paramname">input</td><td>The input buffer to read the ciphertext from.</td></tr>
</table>
</dd>
</dl>
<p>The <em>input</em> and <em>output</em> buffers must be at least <a class="el" href="classXTSCommon.html#a7b96255bdf33eccca8f64eb1572cf8eb" title="Gets the size of sectors encrypted or decrypted by this class. ">sectorSize()</a> bytes in length.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#a8bf1cbd4c1a5422a3cf285fe995fe0e7" title="Encrypts an entire sector of data. ">encryptSector()</a>, <a class="el" href="classXTSCommon.html#a68b1ad6bad0b29aeb97dea80e4e03170" title="Sets the key to use for XTS mode. ">setKey()</a>, <a class="el" href="classXTSCommon.html#a744a533d46078de5ea9723139f74bcdb" title="Sets the tweak value for the current sector to encrypt or decrypt. ">setTweak()</a> </dd></dl>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00215">215</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8bf1cbd4c1a5422a3cf285fe995fe0e7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XTSCommon::encryptSector </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>
</div><div class="memdoc">
<p>Encrypts an entire sector of data. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">output</td><td>The output buffer to write the ciphertext to, which can be the same as <em>input</em>. </td></tr>
<tr><td class="paramname">input</td><td>The input buffer to read the plaintext from.</td></tr>
</table>
</dd>
</dl>
<p>The <em>input</em> and <em>output</em> buffers must be at least <a class="el" href="classXTSCommon.html#a7b96255bdf33eccca8f64eb1572cf8eb" title="Gets the size of sectors encrypted or decrypted by this class. ">sectorSize()</a> bytes in length.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#a7dd21d5a994724e2af433872ecc3a90b" title="Decrypts an entire sector of data. ">decryptSector()</a>, <a class="el" href="classXTSCommon.html#a68b1ad6bad0b29aeb97dea80e4e03170" title="Sets the key to use for XTS mode. ">setKey()</a>, <a class="el" href="classXTSCommon.html#a744a533d46078de5ea9723139f74bcdb" title="Sets the tweak value for the current sector to encrypt or decrypt. ">setTweak()</a> </dd></dl>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00170">170</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a2da350825a438355665683ab9eb57aa7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t XTSCommon::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>Gets the size of the key for <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode. </p>
<p>The key size for <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode is twice the size of the underlying block cipher key size.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#a68b1ad6bad0b29aeb97dea80e4e03170" title="Sets the key to use for XTS mode. ">setKey()</a>, <a class="el" href="classXTSCommon.html#afb3ebf14c7879bcbc92e3d6cc70b19a9" title="Gets the maximum supported size for the tweak. ">tweakSize()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classXTSSingleKeyCommon.html#ac017d457a08001a3ea44a9900dee2b64">XTSSingleKeyCommon</a>.</p>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00062">62</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7b96255bdf33eccca8f64eb1572cf8eb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t XTSCommon::sectorSize </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>Gets the size of sectors encrypted or decrypted by this class. </p>
<p>The default value is 512 bytes.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#a7e0aa61628285073545a8f8e0b0d981d" title="Sets the size of sectors encrypted or decrypted by this class. ">setSectorSize()</a> </dd></dl>
<p>Definition at line <a class="el" href="XTS_8h_source.html#l00038">38</a> of file <a class="el" href="XTS_8h_source.html">XTS.h</a>.</p>
</div>
</div>
<a class="anchor" id="aade8a16b70a49e8b04cb776522b29b7e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void XTSCommon::setBlockCiphers </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classBlockCipher.html">BlockCipher</a> *&#160;</td>
<td class="paramname"><em>cipher1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classBlockCipher.html">BlockCipher</a> *&#160;</td>
<td class="paramname"><em>cipher2</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">inline</span><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the two block ciphers to use for <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">cipher1</td><td>Points to the first block cipher object, which must be capable of both encryption and decryption. </td></tr>
<tr><td class="paramname">cipher2</td><td>Points to the second block cipher object, which must be capable of both encryption but does not need to be capable of decryption.</td></tr>
</table>
</dd>
</dl>
<p>Both block ciphers must have a 128-bit block size. </p>
<p>Definition at line <a class="el" href="XTS_8h_source.html#l00051">51</a> of file <a class="el" href="XTS_8h_source.html">XTS.h</a>.</p>
</div>
</div>
<a class="anchor" id="a68b1ad6bad0b29aeb97dea80e4e03170"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool XTSCommon::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 <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>Points to the key. </td></tr>
<tr><td class="paramname">len</td><td>The size of the key in bytes which must be twice the size of the underlying block cipher's key size.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns true if the key was set or false if <em>len</em> was incorrect.</dd></dl>
<p>This function should be followed by a call to <a class="el" href="classXTSCommon.html#a744a533d46078de5ea9723139f74bcdb" title="Sets the tweak value for the current sector to encrypt or decrypt. ">setTweak()</a> to specify the sector-specific tweak.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#a2da350825a438355665683ab9eb57aa7" title="Gets the size of the key for XTS mode. ">keySize()</a>, <a class="el" href="classXTSCommon.html#a744a533d46078de5ea9723139f74bcdb" title="Sets the tweak value for the current sector to encrypt or decrypt. ">setTweak()</a>, <a class="el" href="classXTSCommon.html#a8bf1cbd4c1a5422a3cf285fe995fe0e7" title="Encrypts an entire sector of data. ">encryptSector()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classXTSSingleKeyCommon.html#af150ada65640d0dcd1f5e09817f63769">XTSSingleKeyCommon</a>.</p>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00119">119</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7e0aa61628285073545a8f8e0b0d981d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool XTSCommon::setSectorSize </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the size of sectors encrypted or decrypted by this class. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">size</td><td>The sector size in bytes, which must be greater than or equal to 16.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns false if <em>size</em> is less than 16.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#a7b96255bdf33eccca8f64eb1572cf8eb" title="Gets the size of sectors encrypted or decrypted by this class. ">sectorSize()</a>, <a class="el" href="classXTSCommon.html#a8bf1cbd4c1a5422a3cf285fe995fe0e7" title="Encrypts an entire sector of data. ">encryptSector()</a> </dd></dl>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00097">97</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a744a533d46078de5ea9723139f74bcdb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool XTSCommon::setTweak </td>
<td>(</td>
<td class="paramtype">const uint8_t *&#160;</td>
<td class="paramname"><em>tweak</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>
</div><div class="memdoc">
<p>Sets the tweak value for the current sector to encrypt or decrypt. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">tweak</td><td>Points to the tweak. </td></tr>
<tr><td class="paramname">len</td><td>The length of the tweak which must be less than or equal to 16.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns true if the tweak was set or false if <em>len</em> was incorrect.</dd></dl>
<p>If <em>len</em> is less than 16, then the <em>tweak</em> will be zero-padded to 16 bytes.</p>
<p>The <em>tweak</em> is encrypted with the second half of the <a class="el" href="classXTS.html" title="Implementation of the XTS mode for 128-bit block ciphers. ">XTS</a> key to generate the actual tweak value for the sector.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classXTSCommon.html#afb3ebf14c7879bcbc92e3d6cc70b19a9" title="Gets the maximum supported size for the tweak. ">tweakSize()</a>, <a class="el" href="classXTSCommon.html#a68b1ad6bad0b29aeb97dea80e4e03170" title="Sets the key to use for XTS mode. ">setKey()</a>, <a class="el" href="classXTSCommon.html#a8bf1cbd4c1a5422a3cf285fe995fe0e7" title="Encrypts an entire sector of data. ">encryptSector()</a> </dd></dl>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00142">142</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="afb3ebf14c7879bcbc92e3d6cc70b19a9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t XTSCommon::tweakSize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the maximum supported size for the tweak. </p>
<p>This function returns 16, which indicates that any tweak up to 16 bytes in size can be specified via <a class="el" href="classXTSCommon.html#a744a533d46078de5ea9723139f74bcdb" title="Sets the tweak value for the current sector to encrypt or decrypt. ">setTweak()</a>. </p>
<p>Definition at line <a class="el" href="XTS_8cpp_source.html#l00073">73</a> of file <a class="el" href="XTS_8cpp_source.html">XTS.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="XTS_8h_source.html">XTS.h</a></li>
<li><a class="el" href="XTS_8cpp_source.html">XTS.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>