Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 17f48c047155a7d4c992d6a672acd57f > files > 2309

libcryptopp-devel-7.0.0-1.1.mga7.armv7hl.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crypto++: gcm.h Source File</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="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 id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Crypto++
   &#160;<span id="projectnumber">7.0</span>
   </div>
   <div id="projectbrief">Free&nbsp;C&#43;&#43;&nbsp;class&nbsp;library&nbsp;of&nbsp;cryptographic&nbsp;schemes</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">gcm.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gcm_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// gcm.h - originally written and placed in the public domain by Wei Dai</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/// \file gcm.h</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">/// \brief GCM block cipher mode of operation</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">/// \since Crypto++ 5.6.0</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#ifndef CRYPTOPP_GCM_H</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#define CRYPTOPP_GCM_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="authenc_8h.html">authenc.h</a>&quot;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="modes_8h.html">modes.h</a>&quot;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;NAMESPACE_BEGIN(<a class="code" href="namespace_crypto_p_p.html">CryptoPP</a>)</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">/// \enum GCM_TablesOption</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"></span><span class="comment">/// \brief GCM table size options</span></div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="gcm_8h.html#a0e626427402436d4e81bd41997072821">   17</a></span>&#160;<span class="comment"></span>enum <a class="code" href="gcm_8h.html#a0e626427402436d4e81bd41997072821">GCM_TablesOption</a> {<span class="comment"></span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">    /// \brief Use a table with 2K entries</span></div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="gcm_8h.html#a0e626427402436d4e81bd41997072821a761a057728a6540ee782654f2b1fc548">   19</a></span>&#160;<span class="comment"></span>    <a class="code" href="gcm_8h.html#a0e626427402436d4e81bd41997072821a761a057728a6540ee782654f2b1fc548">GCM_2K_Tables</a>,<span class="comment"></span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">    /// \brief Use a table with 64K entries</span></div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="gcm_8h.html#a0e626427402436d4e81bd41997072821a8bab074d1f2e3a968428f7e5ab6980f3">   21</a></span>&#160;<span class="comment"></span>    <a class="code" href="gcm_8h.html#a0e626427402436d4e81bd41997072821a8bab074d1f2e3a968428f7e5ab6980f3">GCM_64K_Tables</a>};</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">/// \brief GCM block cipher base implementation</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">/// \details Base implementation of the AuthenticatedSymmetricCipher interface</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">/// \since Crypto++ 5.6.0</span></div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html">   26</a></span>&#160;<span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_g_c_m___base.html">GCM_Base</a> : <span class="keyword">public</span> <a class="code" href="class_authenticated_symmetric_cipher_base.html">AuthenticatedSymmetricCipherBase</a></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="comment">// AuthenticatedSymmetricCipher</span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a0d6236dad4a37fcbf07f4e8d0ab1e913">   30</a></span>&#160;    std::string <a class="code" href="class_g_c_m___base.html#a0d6236dad4a37fcbf07f4e8d0ab1e913">AlgorithmName</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> GetBlockCipher().AlgorithmName() + std::string(<span class="stringliteral">&quot;/GCM&quot;</span>);}</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a08a979b9cfb5aa456259fd8da5de5a75">   32</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="class_g_c_m___base.html#a08a979b9cfb5aa456259fd8da5de5a75">MinKeyLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> GetBlockCipher().MinKeyLength();}</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a2a44b04d0ef0b4f5da92465af37af28b">   34</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="class_g_c_m___base.html#a2a44b04d0ef0b4f5da92465af37af28b">MaxKeyLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> GetBlockCipher().MaxKeyLength();}</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a6051e3b4744520217a1b3d78ed585a13">   36</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="class_g_c_m___base.html#a6051e3b4744520217a1b3d78ed585a13">DefaultKeyLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> GetBlockCipher().DefaultKeyLength();}</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a5d9419e0b6da7cdac65f845a2ccbbcc0">   38</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="class_g_c_m___base.html#a5d9419e0b6da7cdac65f845a2ccbbcc0">GetValidKeyLength</a>(<span class="keywordtype">size_t</span> n)<span class="keyword"> const</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> GetBlockCipher().GetValidKeyLength(n);}</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a2fcb536ce73eec71caa73ab18a364f44">   40</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_g_c_m___base.html#a2fcb536ce73eec71caa73ab18a364f44">IsValidKeyLength</a>(<span class="keywordtype">size_t</span> n)<span class="keyword"> const</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> GetBlockCipher().IsValidKeyLength(n);}</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_stream_transformation.html#a447cfac11f97012dff9662fb5e5d208b">OptimalDataAlignment</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#aa8fef9d4c606289247789cf7a60c6bab">   43</a></span>&#160;    <a class="code" href="class_simple_keying_interface.html#a88201c180fbfaa9fef2715252546ad6e">IV_Requirement</a> <a class="code" href="class_g_c_m___base.html#aa8fef9d4c606289247789cf7a60c6bab">IVRequirement</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> <a class="code" href="class_simple_keying_interface.html#a88201c180fbfaa9fef2715252546ad6ea1cc32e69fe4f385e54d9d482a2ab5a56">UNIQUE_IV</a>;}</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a1a10d6d41ba1d2e4e46a68610d1a499d">   45</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_g_c_m___base.html#a1a10d6d41ba1d2e4e46a68610d1a499d">IVSize</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> 12;}</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#afc086b44f7dad60afe78bbcb204d20cd">   47</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_g_c_m___base.html#afc086b44f7dad60afe78bbcb204d20cd">MinIVLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> 1;}</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#abf6d2a9a9e392f3ccb837761b5a99b0f">   49</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_g_c_m___base.html#abf6d2a9a9e392f3ccb837761b5a99b0f">MaxIVLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> UINT_MAX;}      <span class="comment">// (W64LIT(1)&lt;&lt;61)-1 in the standard</span></div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a4d76d96136a5629c4e370265fefef65a">   51</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_g_c_m___base.html#a4d76d96136a5629c4e370265fefef65a">DigestSize</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> 16;}</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a2e8cb9700da5321c8a949dd3becef23f">   53</a></span>&#160;    lword <a class="code" href="class_g_c_m___base.html#a2e8cb9700da5321c8a949dd3becef23f">MaxHeaderLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> (W64LIT(1)&lt;&lt;61)-1;}</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="class_g_c_m___base.html#a1c7da5ca6c02e74f575ba264d104a842">   55</a></span>&#160;    lword <a class="code" href="class_g_c_m___base.html#a1c7da5ca6c02e74f575ba264d104a842">MaxMessageLength</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> ((W64LIT(1)&lt;&lt;39)-256)/8;}</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="comment">// AuthenticatedSymmetricCipherBase</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordtype">bool</span> AuthenticationIsOnPlaintext()<span class="keyword"> const</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;}</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> AuthenticationBlockSize()<span class="keyword"> const</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> HASH_BLOCKSIZE;}</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">void</span> SetKeyWithoutResync(<span class="keyword">const</span> <span class="keywordtype">byte</span> *userKey, <span class="keywordtype">size_t</span> keylength, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &amp;params);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordtype">void</span> Resync(<span class="keyword">const</span> <span class="keywordtype">byte</span> *iv, <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordtype">size_t</span> AuthenticateBlocks(<span class="keyword">const</span> <span class="keywordtype">byte</span> *data, <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordtype">void</span> AuthenticateLastHeaderBlock();</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordtype">void</span> AuthenticateLastConfidentialBlock();</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordtype">void</span> AuthenticateLastFooterBlock(<span class="keywordtype">byte</span> *mac, <span class="keywordtype">size_t</span> macSize);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="class_symmetric_cipher.html">SymmetricCipher</a> &amp; AccessSymmetricCipher() {<span class="keywordflow">return</span> m_ctr;}</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_block_cipher.html">BlockCipher</a> &amp; AccessBlockCipher() =0;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="gcm_8h.html#a0e626427402436d4e81bd41997072821">GCM_TablesOption</a> GetTablesOption() <span class="keyword">const</span> =0;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_block_cipher.html">BlockCipher</a> &amp; GetBlockCipher()<span class="keyword"> const </span>{<span class="keywordflow">return</span> const_cast&lt;GCM_Base *&gt;(<span class="keyword">this</span>)-&gt;AccessBlockCipher();};</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordtype">byte</span> *HashBuffer() {<span class="keywordflow">return</span> m_buffer+REQUIRED_BLOCKSIZE;}</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">byte</span> *HashKey() {<span class="keywordflow">return</span> m_buffer+2*REQUIRED_BLOCKSIZE;}</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordtype">byte</span> *MulTable() {<span class="keywordflow">return</span> m_buffer+3*REQUIRED_BLOCKSIZE;}</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> ReverseHashBufferIfNeeded();</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keyword">class </span>CRYPTOPP_DLL GCTR : <span class="keyword">public</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html">CTR_Mode_ExternalCipher::Encryption</a></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    {</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keyword">protected</span>:</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordtype">void</span> IncrementCounterBy256();</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    };</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    GCTR m_ctr;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keyword">static</span> word16 s_reductionTable[256];</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">static</span> <span class="keyword">volatile</span> <span class="keywordtype">bool</span> s_reductionTableInitialized;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">enum</span> {REQUIRED_BLOCKSIZE = 16, HASH_BLOCKSIZE = 16};</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;};</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment">/// \brief GCM block cipher final implementation</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="comment">/// \tparam T_BlockCipher block cipher</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">/// \tparam T_TablesOption table size, either \p GCM_2K_Tables or \p GCM_64K_Tables</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">/// \tparam T_IsEncryption direction in which to operate the cipher</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">/// \since Crypto++ 5.6.0</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> T_BlockCipher, GCM_TablesOption T_TablesOption, <span class="keywordtype">bool</span> T_IsEncryption&gt;</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="class_g_c_m___final.html">   99</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_g_c_m___final.html">GCM_Final</a> : <span class="keyword">public</span> <a class="code" href="class_g_c_m___base.html">GCM_Base</a></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;{</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keyword">static</span> std::string StaticAlgorithmName()</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        {<span class="keywordflow">return</span> T_BlockCipher::StaticAlgorithmName() + std::string(<span class="stringliteral">&quot;/GCM&quot;</span>);}</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="class_g_c_m___final.html#ab3b487ec8ef88547e47d184eb2c4aaf4">  104</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_g_c_m___final.html#ab3b487ec8ef88547e47d184eb2c4aaf4">IsForwardTransformation</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> T_IsEncryption;}</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <a class="code" href="gcm_8h.html#a0e626427402436d4e81bd41997072821">GCM_TablesOption</a> GetTablesOption()<span class="keyword"> const </span>{<span class="keywordflow">return</span> T_TablesOption;}</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <a class="code" href="class_block_cipher.html">BlockCipher</a> &amp; AccessBlockCipher() {<span class="keywordflow">return</span> m_cipher;}</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keyword">typename</span> T_BlockCipher::Encryption m_cipher;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;};</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment">/// \brief GCM block cipher mode of operation</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="comment">/// \tparam T_BlockCipher block cipher</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment">/// \tparam T_TablesOption table size, either \p GCM_2K_Tables or \p GCM_64K_Tables</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment">/// \details \p GCM provides the \p Encryption and \p Decryption typedef. See GCM_Base</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment">///   and GCM_Final for the AuthenticatedSymmetricCipher implementation.</span></div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="comment">/// \sa &lt;a href=&quot;http://www.cryptopp.com/wiki/GCM_Mode&quot;&gt;GCM Mode&lt;/a&gt; and</span></div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment">///   &lt;A HREF=&quot;http://www.cryptopp.com/wiki/Modes_of_Operation&quot;&gt;Modes of Operation&lt;/A&gt;</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment">///   on the Crypto++ wiki.</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">/// \since Crypto++ 5.6.0</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> T_BlockCipher, GCM_TablesOption T_TablesOption=GCM_2K_Tables&gt;</div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="struct_g_c_m.html">  123</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_g_c_m.html">GCM</a> : <span class="keyword">public</span> <a class="code" href="struct_authenticated_symmetric_cipher_documentation.html">AuthenticatedSymmetricCipherDocumentation</a></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;{</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="class_g_c_m___final.html">GCM_Final&lt;T_BlockCipher, T_TablesOption, true&gt;</a> <a class="code" href="class_g_c_m___final.html">Encryption</a>;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="class_g_c_m___final.html">GCM_Final&lt;T_BlockCipher, T_TablesOption, false&gt;</a> <a class="code" href="class_g_c_m___final.html">Decryption</a>;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;};</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;NAMESPACE_END</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="class_g_c_m___base_html"><div class="ttname"><a href="class_g_c_m___base.html">GCM_Base</a></div><div class="ttdoc">GCM block cipher base implementation.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00026">gcm.h:26</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a5d9419e0b6da7cdac65f845a2ccbbcc0"><div class="ttname"><a href="class_g_c_m___base.html#a5d9419e0b6da7cdac65f845a2ccbbcc0">GCM_Base::GetValidKeyLength</a></div><div class="ttdeci">size_t GetValidKeyLength(size_t n) const</div><div class="ttdoc">Returns a valid key length for the algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00038">gcm.h:38</a></div></div>
<div class="ttc" id="class_cipher_mode_final_template___external_cipher_html"><div class="ttname"><a href="class_cipher_mode_final_template___external_cipher.html">CipherModeFinalTemplate_ExternalCipher&lt; ConcretePolicyHolder&lt; Empty, AdditiveCipherTemplate&lt; AbstractPolicyHolder&lt; AdditiveCipherAbstractPolicy, CTR_ModePolicy &gt; &gt; &gt; &gt;</a></div></div>
<div class="ttc" id="gcm_8h_html_a0e626427402436d4e81bd41997072821a761a057728a6540ee782654f2b1fc548"><div class="ttname"><a href="gcm_8h.html#a0e626427402436d4e81bd41997072821a761a057728a6540ee782654f2b1fc548">GCM_2K_Tables</a></div><div class="ttdoc">Use a table with 2K entries.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00019">gcm.h:19</a></div></div>
<div class="ttc" id="modes_8h_html"><div class="ttname"><a href="modes_8h.html">modes.h</a></div><div class="ttdoc">Classes for block cipher modes of operation.</div></div>
<div class="ttc" id="class_g_c_m___base_html_aa8fef9d4c606289247789cf7a60c6bab"><div class="ttname"><a href="class_g_c_m___base.html#aa8fef9d4c606289247789cf7a60c6bab">GCM_Base::IVRequirement</a></div><div class="ttdeci">IV_Requirement IVRequirement() const</div><div class="ttdoc">Minimal requirement for secure IVs.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00043">gcm.h:43</a></div></div>
<div class="ttc" id="struct_authenticated_symmetric_cipher_documentation_html"><div class="ttname"><a href="struct_authenticated_symmetric_cipher_documentation.html">AuthenticatedSymmetricCipherDocumentation</a></div><div class="ttdoc">Provides Encryption and Decryption typedefs used by derived classes to implement an authenticated enc...</div><div class="ttdef"><b>Definition:</b> <a href="seckey_8h_source.html#l00447">seckey.h:447</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a2e8cb9700da5321c8a949dd3becef23f"><div class="ttname"><a href="class_g_c_m___base.html#a2e8cb9700da5321c8a949dd3becef23f">GCM_Base::MaxHeaderLength</a></div><div class="ttdeci">lword MaxHeaderLength() const</div><div class="ttdoc">Provides the maximum length of AAD that can be input.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00053">gcm.h:53</a></div></div>
<div class="ttc" id="class_block_cipher_html"><div class="ttname"><a href="class_block_cipher.html">BlockCipher</a></div><div class="ttdoc">Interface for one direction (encryption or decryption) of a block cipher.</div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l01229">cryptlib.h:1229</a></div></div>
<div class="ttc" id="gcm_8h_html_a0e626427402436d4e81bd41997072821a8bab074d1f2e3a968428f7e5ab6980f3"><div class="ttname"><a href="gcm_8h.html#a0e626427402436d4e81bd41997072821a8bab074d1f2e3a968428f7e5ab6980f3">GCM_64K_Tables</a></div><div class="ttdoc">Use a table with 64K entries.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00021">gcm.h:21</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a08a979b9cfb5aa456259fd8da5de5a75"><div class="ttname"><a href="class_g_c_m___base.html#a08a979b9cfb5aa456259fd8da5de5a75">GCM_Base::MinKeyLength</a></div><div class="ttdeci">size_t MinKeyLength() const</div><div class="ttdoc">Returns smallest valid key length.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00032">gcm.h:32</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a6051e3b4744520217a1b3d78ed585a13"><div class="ttname"><a href="class_g_c_m___base.html#a6051e3b4744520217a1b3d78ed585a13">GCM_Base::DefaultKeyLength</a></div><div class="ttdeci">size_t DefaultKeyLength() const</div><div class="ttdoc">Returns default key length.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00036">gcm.h:36</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_abf6d2a9a9e392f3ccb837761b5a99b0f"><div class="ttname"><a href="class_g_c_m___base.html#abf6d2a9a9e392f3ccb837761b5a99b0f">GCM_Base::MaxIVLength</a></div><div class="ttdeci">unsigned int MaxIVLength() const</div><div class="ttdoc">Provides the maximum size of an IV.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00049">gcm.h:49</a></div></div>
<div class="ttc" id="class_symmetric_cipher_html"><div class="ttname"><a href="class_symmetric_cipher.html">SymmetricCipher</a></div><div class="ttdoc">Interface for one direction (encryption or decryption) of a stream cipher or cipher mode.</div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l01237">cryptlib.h:1237</a></div></div>
<div class="ttc" id="struct_g_c_m_html"><div class="ttname"><a href="struct_g_c_m.html">GCM</a></div><div class="ttdoc">GCM block cipher mode of operation.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00123">gcm.h:123</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a2a44b04d0ef0b4f5da92465af37af28b"><div class="ttname"><a href="class_g_c_m___base.html#a2a44b04d0ef0b4f5da92465af37af28b">GCM_Base::MaxKeyLength</a></div><div class="ttdeci">size_t MaxKeyLength() const</div><div class="ttdoc">Returns largest valid key length.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00034">gcm.h:34</a></div></div>
<div class="ttc" id="class_authenticated_symmetric_cipher_base_html"><div class="ttname"><a href="class_authenticated_symmetric_cipher_base.html">AuthenticatedSymmetricCipherBase</a></div><div class="ttdoc">Base class for authenticated encryption modes of operation.</div><div class="ttdef"><b>Definition:</b> <a href="authenc_8h_source.html#l00040">authenc.h:40</a></div></div>
<div class="ttc" id="class_stream_transformation_html_a447cfac11f97012dff9662fb5e5d208b"><div class="ttname"><a href="class_stream_transformation.html#a447cfac11f97012dff9662fb5e5d208b">StreamTransformation::OptimalDataAlignment</a></div><div class="ttdeci">virtual unsigned int OptimalDataAlignment() const</div><div class="ttdoc">Provides input and output data alignment for optimal performance.</div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8cpp_source.html#l00201">cryptlib.cpp:201</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a0d6236dad4a37fcbf07f4e8d0ab1e913"><div class="ttname"><a href="class_g_c_m___base.html#a0d6236dad4a37fcbf07f4e8d0ab1e913">GCM_Base::AlgorithmName</a></div><div class="ttdeci">std::string AlgorithmName() const</div><div class="ttdoc">Provides the name of this algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00030">gcm.h:30</a></div></div>
<div class="ttc" id="class_g_c_m___final_html_ab3b487ec8ef88547e47d184eb2c4aaf4"><div class="ttname"><a href="class_g_c_m___final.html#ab3b487ec8ef88547e47d184eb2c4aaf4">GCM_Final::IsForwardTransformation</a></div><div class="ttdeci">bool IsForwardTransformation() const</div><div class="ttdoc">Determines if the cipher is being operated in its forward direction.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00104">gcm.h:104</a></div></div>
<div class="ttc" id="class_simple_keying_interface_html_a88201c180fbfaa9fef2715252546ad6e"><div class="ttname"><a href="class_simple_keying_interface.html#a88201c180fbfaa9fef2715252546ad6e">SimpleKeyingInterface::IV_Requirement</a></div><div class="ttdeci">IV_Requirement</div><div class="ttdoc">Secure IVs requirements as enumerated values.</div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00672">cryptlib.h:672</a></div></div>
<div class="ttc" id="gcm_8h_html_a0e626427402436d4e81bd41997072821"><div class="ttname"><a href="gcm_8h.html#a0e626427402436d4e81bd41997072821">GCM_TablesOption</a></div><div class="ttdeci">GCM_TablesOption</div><div class="ttdoc">GCM table size options.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00017">gcm.h:17</a></div></div>
<div class="ttc" id="namespace_crypto_p_p_html"><div class="ttname"><a href="namespace_crypto_p_p.html">CryptoPP</a></div><div class="ttdoc">Crypto++ library namespace.</div></div>
<div class="ttc" id="class_g_c_m___final_html"><div class="ttname"><a href="class_g_c_m___final.html">GCM_Final</a></div><div class="ttdoc">GCM block cipher final implementation.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00099">gcm.h:99</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a4d76d96136a5629c4e370265fefef65a"><div class="ttname"><a href="class_g_c_m___base.html#a4d76d96136a5629c4e370265fefef65a">GCM_Base::DigestSize</a></div><div class="ttdeci">unsigned int DigestSize() const</div><div class="ttdoc">Provides the digest size of the hash.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00051">gcm.h:51</a></div></div>
<div class="ttc" id="authenc_8h_html"><div class="ttname"><a href="authenc_8h.html">authenc.h</a></div><div class="ttdoc">Classes for authenticated encryption modes of operation.</div></div>
<div class="ttc" id="class_g_c_m___base_html_afc086b44f7dad60afe78bbcb204d20cd"><div class="ttname"><a href="class_g_c_m___base.html#afc086b44f7dad60afe78bbcb204d20cd">GCM_Base::MinIVLength</a></div><div class="ttdeci">unsigned int MinIVLength() const</div><div class="ttdoc">Provides the minimum size of an IV.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00047">gcm.h:47</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a1c7da5ca6c02e74f575ba264d104a842"><div class="ttname"><a href="class_g_c_m___base.html#a1c7da5ca6c02e74f575ba264d104a842">GCM_Base::MaxMessageLength</a></div><div class="ttdeci">lword MaxMessageLength() const</div><div class="ttdoc">Provides the maximum length of encrypted data.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00055">gcm.h:55</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a1a10d6d41ba1d2e4e46a68610d1a499d"><div class="ttname"><a href="class_g_c_m___base.html#a1a10d6d41ba1d2e4e46a68610d1a499d">GCM_Base::IVSize</a></div><div class="ttdeci">unsigned int IVSize() const</div><div class="ttdoc">Returns length of the IV accepted by this object.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00045">gcm.h:45</a></div></div>
<div class="ttc" id="class_simple_keying_interface_html_a88201c180fbfaa9fef2715252546ad6ea1cc32e69fe4f385e54d9d482a2ab5a56"><div class="ttname"><a href="class_simple_keying_interface.html#a88201c180fbfaa9fef2715252546ad6ea1cc32e69fe4f385e54d9d482a2ab5a56">SimpleKeyingInterface::UNIQUE_IV</a></div><div class="ttdoc">The IV must be unique.</div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00674">cryptlib.h:674</a></div></div>
<div class="ttc" id="class_g_c_m___base_html_a2fcb536ce73eec71caa73ab18a364f44"><div class="ttname"><a href="class_g_c_m___base.html#a2fcb536ce73eec71caa73ab18a364f44">GCM_Base::IsValidKeyLength</a></div><div class="ttdeci">bool IsValidKeyLength(size_t n) const</div><div class="ttdoc">Returns whether keylength is a valid key length.</div><div class="ttdef"><b>Definition:</b> <a href="gcm_8h_source.html#l00040">gcm.h:40</a></div></div>
<div class="ttc" id="class_name_value_pairs_html"><div class="ttname"><a href="class_name_value_pairs.html">NameValuePairs</a></div><div class="ttdoc">Interface for retrieving values given their names.</div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00290">cryptlib.h:290</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 27 2019 15:03:32 for Crypto++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>