<!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"/> <title>Crypto++: modes.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Crypto++</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>modes.h</h1> </div> </div> <div class="contents"> <a href="modes_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_MODES_H</span> <a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_MODES_H</span> <a name="l00003"></a>00003 <span class="preprocessor"></span><span class="comment"></span> <a name="l00004"></a>00004 <span class="comment">/*! \file</span> <a name="l00005"></a>00005 <span class="comment">*/</span> <a name="l00006"></a>00006 <a name="l00007"></a>00007 <span class="preprocessor">#include "<a class="code" href="cryptlib_8h.html">cryptlib.h</a>"</span> <a name="l00008"></a>00008 <span class="preprocessor">#include "secblock.h"</span> <a name="l00009"></a>00009 <span class="preprocessor">#include "misc.h"</span> <a name="l00010"></a>00010 <span class="preprocessor">#include "<a class="code" href="strciphr_8h.html">strciphr.h</a>"</span> <a name="l00011"></a>00011 <span class="preprocessor">#include "argnames.h"</span> <a name="l00012"></a>00012 <span class="preprocessor">#include "algparam.h"</span> <a name="l00013"></a>00013 <a name="l00014"></a>00014 NAMESPACE_BEGIN(CryptoPP) <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="comment">//! Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymmetricCipherDocumentation for authenticated encryption modes.</span> <a name="l00017"></a>00017 <span class="comment"></span><span class="comment"></span> <a name="l00018"></a>00018 <span class="comment">/*! Each class derived from this one defines two types, Encryption and Decryption, </span> <a name="l00019"></a>00019 <span class="comment"> both of which implement the SymmetricCipher interface.</span> <a name="l00020"></a>00020 <span class="comment"> For each mode there are two classes, one of which is a template class,</span> <a name="l00021"></a>00021 <span class="comment"> and the other one has a name that ends in "_ExternalCipher".</span> <a name="l00022"></a>00022 <span class="comment"> The "external cipher" mode objects hold a reference to the underlying block cipher,</span> <a name="l00023"></a>00023 <span class="comment"> instead of holding an instance of it. The reference must be passed in to the constructor.</span> <a name="l00024"></a>00024 <span class="comment"> For the "cipher holder" classes, the CIPHER template parameter should be a class</span> <a name="l00025"></a>00025 <span class="comment"> derived from BlockCipherDocumentation, for example DES or AES.</span> <a name="l00026"></a>00026 <span class="comment">*/</span> <a name="l00027"></a><a class="code" href="struct_cipher_mode_documentation.html">00027</a> struct <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> : public <a class="code" href="struct_symmetric_cipher_documentation.html" title="Each class derived from this one defines two types, Encryption and Decryption, both of which implemen...">SymmetricCipherDocumentation</a> <a name="l00028"></a>00028 { <a name="l00029"></a>00029 }; <a name="l00030"></a>00030 <a name="l00031"></a><a class="code" href="class_cipher_mode_base.html">00031</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_cipher_mode_base.html">CipherModeBase</a> : <span class="keyword">public</span> <a class="code" href="class_symmetric_cipher.html" title="interface for one direction (encryption or decryption) of a stream cipher or cipher mode...">SymmetricCipher</a> <a name="l00032"></a>00032 { <a name="l00033"></a>00033 <span class="keyword">public</span>: <a name="l00034"></a><a class="code" href="class_cipher_mode_base.html#a8224beab6f15889bae44d06efb8c01f1">00034</a> <span class="keywordtype">size_t</span> <a class="code" href="class_cipher_mode_base.html#a8224beab6f15889bae44d06efb8c01f1" title="returns smallest valid key length in bytes */">MinKeyLength</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->MinKeyLength();} <a name="l00035"></a><a class="code" href="class_cipher_mode_base.html#ae2b61a0b36c284db0500cbd82a92aa09">00035</a> <span class="keywordtype">size_t</span> <a class="code" href="class_cipher_mode_base.html#ae2b61a0b36c284db0500cbd82a92aa09" title="returns largest valid key length in bytes */">MaxKeyLength</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->MaxKeyLength();} <a name="l00036"></a><a class="code" href="class_cipher_mode_base.html#a78845a270a50fc42f0a952e35c781ba6">00036</a> <span class="keywordtype">size_t</span> <a class="code" href="class_cipher_mode_base.html#a78845a270a50fc42f0a952e35c781ba6" title="returns default (recommended) key length in bytes */">DefaultKeyLength</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->DefaultKeyLength();} <a name="l00037"></a><a class="code" href="class_cipher_mode_base.html#a8c1ffbf107876873abb5039b2facf421">00037</a> <span class="keywordtype">size_t</span> <a class="code" href="class_cipher_mode_base.html#a8c1ffbf107876873abb5039b2facf421" title="returns the smallest valid key length in bytes that is &gt;= min(n, GetMaxKeyLength())">GetValidKeyLength</a>(<span class="keywordtype">size_t</span> n)<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->GetValidKeyLength(n);} <a name="l00038"></a><a class="code" href="class_cipher_mode_base.html#a7e6c0f7dd7b952e4f6d46b16b2b2a5ad">00038</a> <span class="keywordtype">bool</span> <a class="code" href="class_cipher_mode_base.html#a7e6c0f7dd7b952e4f6d46b16b2b2a5ad" title="returns whether n is a valid key length">IsValidKeyLength</a>(<span class="keywordtype">size_t</span> n)<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->IsValidKeyLength(n);} <a name="l00039"></a>00039 <a name="l00040"></a><a class="code" href="class_cipher_mode_base.html#a620b247030548f559a9b426e47234f12">00040</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_cipher_mode_base.html#a620b247030548f559a9b426e47234f12" title="returns how input should be aligned for optimal performance">OptimalDataAlignment</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->OptimalDataAlignment();} <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> IVSize()<span class="keyword"> const </span>{<span class="keywordflow">return</span> BlockSize();} <a name="l00043"></a>00043 <span class="keyword">virtual</span> IV_Requirement <a class="code" href="class_simple_keying_interface.html#a867b535e5c4a11704d0645272e8b03f9" title="returns the minimal requirement for secure IVs">IVRequirement</a>() <span class="keyword">const</span> =0; <a name="l00044"></a>00044 <a name="l00045"></a>00045 <span class="keywordtype">void</span> SetCipher(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &cipher) <a name="l00046"></a>00046 { <a name="l00047"></a>00047 this->ThrowIfResynchronizable(); <a name="l00048"></a>00048 this->m_cipher = &cipher; <a name="l00049"></a>00049 this->ResizeBuffers(); <a name="l00050"></a>00050 } <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keywordtype">void</span> SetCipherWithIV(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &cipher, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize = 0) <a name="l00053"></a>00053 { <a name="l00054"></a>00054 this->ThrowIfInvalidIV(iv); <a name="l00055"></a>00055 this->m_cipher = &cipher; <a name="l00056"></a>00056 this->ResizeBuffers(); <a name="l00057"></a>00057 this->SetFeedbackSize(feedbackSize); <a name="l00058"></a>00058 <span class="keywordflow">if</span> (this-><a class="code" href="class_simple_keying_interface.html#ad263f4a96fa8b4e7d01fea8ccaae9d3b" title="returns whether this object can be resynchronized (i.e. supports initialization vectors)">IsResynchronizable</a>()) <a name="l00059"></a>00059 this-><a class="code" href="class_simple_keying_interface.html#ae576137a46ca56005e82f1505cf3cccc" title="resynchronize with an IV. ivLength=-1 means use IVSize()">Resynchronize</a>(iv); <a name="l00060"></a>00060 } <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">protected</span>: <a name="l00063"></a>00063 <a class="code" href="class_cipher_mode_base.html">CipherModeBase</a>() : m_cipher(NULL) {} <a name="l00064"></a>00064 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>()<span class="keyword"> const </span>{assert(m_register.size() > 0); <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)m_register.size();} <a name="l00065"></a>00065 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetFeedbackSize(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> feedbackSize) <a name="l00066"></a>00066 { <a name="l00067"></a>00067 <span class="keywordflow">if</span> (!(feedbackSize == 0 || feedbackSize == <a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>())) <a name="l00068"></a>00068 <span class="keywordflow">throw</span> <a class="code" href="class_invalid_argument.html" title="exception thrown when an invalid argument is detected">InvalidArgument</a>(<span class="stringliteral">"CipherModeBase: feedback size cannot be specified for this cipher mode"</span>); <a name="l00069"></a>00069 } <a name="l00070"></a>00070 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ResizeBuffers() <a name="l00071"></a>00071 { <a name="l00072"></a>00072 m_register.New(m_cipher->BlockSize()); <a name="l00073"></a>00073 } <a name="l00074"></a>00074 <a name="l00075"></a>00075 <a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> *m_cipher; <a name="l00076"></a>00076 <a class="code" href="class_sec_block.html">AlignedSecByteBlock</a> m_register; <a name="l00077"></a>00077 }; <a name="l00078"></a>00078 <a name="l00079"></a>00079 <span class="keyword">template</span> <<span class="keyword">class</span> POLICY_INTERFACE> <a name="l00080"></a><a class="code" href="class_mode_policy_common_template.html">00080</a> <span class="keyword">class </span>CRYPTOPP_NO_VTABLE <a class="code" href="class_mode_policy_common_template.html">ModePolicyCommonTemplate</a> : <span class="keyword">public</span> <a class="code" href="class_cipher_mode_base.html">CipherModeBase</a>, <span class="keyword">public</span> POLICY_INTERFACE <a name="l00081"></a>00081 { <a name="l00082"></a>00082 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetAlignment()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher-><a class="code" href="class_cipher_mode_base.html#a620b247030548f559a9b426e47234f12" title="returns how input should be aligned for optimal performance">OptimalDataAlignment</a>();} <a name="l00083"></a>00083 <span class="keywordtype">void</span> CipherSetKey(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &params, <span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length); <a name="l00084"></a>00084 }; <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keyword">template</span> <<span class="keyword">class</span> POLICY_INTERFACE> <a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="class_mode_policy_common_template.html">ModePolicyCommonTemplate<POLICY_INTERFACE>::CipherSetKey</a>(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &params, <span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length) <a name="l00088"></a>00088 { <a name="l00089"></a>00089 m_cipher-><a class="code" href="class_simple_keying_interface.html#adf3c29b3ef3af74788a58c7c49887fd7" title="set or reset the key of this object">SetKey</a>(key, length, params); <a name="l00090"></a>00090 ResizeBuffers(); <a name="l00091"></a>00091 <span class="keywordtype">int</span> feedbackSize = params.<a class="code" href="class_name_value_pairs.html#ac269314685b737912d3499f4a9399618" title="get a named value with type int, with default">GetIntValueWithDefault</a>(<a class="code" href="namespace_name.html#a62c578a9a83ca83029cd1ce38431989d" title="int">Name::FeedbackSize</a>(), 0); <a name="l00092"></a>00092 SetFeedbackSize(feedbackSize); <a name="l00093"></a>00093 } <a name="l00094"></a>00094 <a name="l00095"></a><a class="code" href="class_c_f_b___mode_policy.html">00095</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_f_b___mode_policy.html">CFB_ModePolicy</a> : <span class="keyword">public</span> <a class="code" href="class_mode_policy_common_template.html">ModePolicyCommonTemplate</a><CFB_CipherAbstractPolicy> <a name="l00096"></a>00096 { <a name="l00097"></a>00097 <span class="keyword">public</span>: <a name="l00098"></a><a class="code" href="class_c_f_b___mode_policy.html#a7f2ddc303436b365a6b5d3bcb6d8142e">00098</a> IV_Requirement <a class="code" href="class_c_f_b___mode_policy.html#a7f2ddc303436b365a6b5d3bcb6d8142e" title="returns the minimal requirement for secure IVs">IVRequirement</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> RANDOM_IV;} <a name="l00099"></a>00099 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CFB"</span>;} <a name="l00100"></a>00100 <a name="l00101"></a>00101 <span class="keyword">protected</span>: <a name="l00102"></a>00102 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetBytesPerIteration()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_feedbackSize;} <a name="l00103"></a>00103 byte * GetRegisterBegin() {<span class="keywordflow">return</span> m_register + <a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>() - m_feedbackSize;} <a name="l00104"></a>00104 <span class="keywordtype">bool</span> CanIterate()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_feedbackSize == <a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>();} <a name="l00105"></a>00105 <span class="keywordtype">void</span> Iterate(byte *output, <span class="keyword">const</span> byte *input, <a class="code" href="cryptlib_8h.html#a353ccabf5ddc119a6a33e92f7b9961c7" title="used to specify a direction for a cipher to operate in (encrypt or decrypt)">CipherDir</a> dir, <span class="keywordtype">size_t</span> iterationCount); <a name="l00106"></a>00106 <span class="keywordtype">void</span> TransformRegister(); <a name="l00107"></a>00107 <span class="keywordtype">void</span> CipherResynchronize(<span class="keyword">const</span> byte *iv, <span class="keywordtype">size_t</span> length); <a name="l00108"></a>00108 <span class="keywordtype">void</span> SetFeedbackSize(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> feedbackSize); <a name="l00109"></a>00109 <span class="keywordtype">void</span> ResizeBuffers(); <a name="l00110"></a>00110 <a name="l00111"></a>00111 <a class="code" href="class_sec_block.html" title="a block of memory allocated using A">SecByteBlock</a> m_temp; <a name="l00112"></a>00112 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_feedbackSize; <a name="l00113"></a>00113 }; <a name="l00114"></a>00114 <a name="l00115"></a>00115 <span class="keyword">inline</span> <span class="keywordtype">void</span> CopyOrZero(<span class="keywordtype">void</span> *dest, <span class="keyword">const</span> <span class="keywordtype">void</span> *src, <span class="keywordtype">size_t</span> s) <a name="l00116"></a>00116 { <a name="l00117"></a>00117 <span class="keywordflow">if</span> (src) <a name="l00118"></a>00118 memcpy_s(dest, s, src, s); <a name="l00119"></a>00119 <span class="keywordflow">else</span> <a name="l00120"></a>00120 memset(dest, 0, s); <a name="l00121"></a>00121 } <a name="l00122"></a>00122 <a name="l00123"></a><a class="code" href="class_o_f_b___mode_policy.html">00123</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_o_f_b___mode_policy.html">OFB_ModePolicy</a> : <span class="keyword">public</span> <a class="code" href="class_mode_policy_common_template.html">ModePolicyCommonTemplate</a><AdditiveCipherAbstractPolicy> <a name="l00124"></a>00124 { <a name="l00125"></a>00125 <span class="keyword">public</span>: <a name="l00126"></a>00126 <span class="keywordtype">bool</span> CipherIsRandomAccess()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;} <a name="l00127"></a><a class="code" href="class_o_f_b___mode_policy.html#a79ed234ba58ac65fc5e5fecee7f62618">00127</a> IV_Requirement <a class="code" href="class_o_f_b___mode_policy.html#a79ed234ba58ac65fc5e5fecee7f62618" title="returns the minimal requirement for secure IVs">IVRequirement</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> UNIQUE_IV;} <a name="l00128"></a>00128 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"OFB"</span>;} <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="keyword">private</span>: <a name="l00131"></a>00131 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetBytesPerIteration()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>();} <a name="l00132"></a>00132 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetIterationsToBuffer()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->OptimalNumberOfParallelBlocks();} <a name="l00133"></a>00133 <span class="keywordtype">void</span> WriteKeystream(byte *keystreamBuffer, <span class="keywordtype">size_t</span> iterationCount); <a name="l00134"></a>00134 <span class="keywordtype">void</span> CipherResynchronize(byte *keystreamBuffer, <span class="keyword">const</span> byte *iv, <span class="keywordtype">size_t</span> length); <a name="l00135"></a>00135 }; <a name="l00136"></a>00136 <a name="l00137"></a><a class="code" href="class_c_t_r___mode_policy.html">00137</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_t_r___mode_policy.html">CTR_ModePolicy</a> : <span class="keyword">public</span> <a class="code" href="class_mode_policy_common_template.html">ModePolicyCommonTemplate</a><AdditiveCipherAbstractPolicy> <a name="l00138"></a>00138 { <a name="l00139"></a>00139 <span class="keyword">public</span>: <a name="l00140"></a>00140 <span class="keywordtype">bool</span> CipherIsRandomAccess()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;} <a name="l00141"></a><a class="code" href="class_c_t_r___mode_policy.html#aa1362c4227cb260577d227750c2f7ff8">00141</a> IV_Requirement <a class="code" href="class_c_t_r___mode_policy.html#aa1362c4227cb260577d227750c2f7ff8" title="returns the minimal requirement for secure IVs">IVRequirement</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> RANDOM_IV;} <a name="l00142"></a>00142 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CTR"</span>;} <a name="l00143"></a>00143 <a name="l00144"></a>00144 <span class="keyword">protected</span>: <a name="l00145"></a>00145 <span class="keyword">virtual</span> <span class="keywordtype">void</span> IncrementCounterBy256(); <a name="l00146"></a>00146 <a name="l00147"></a>00147 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetAlignment()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->OptimalDataAlignment();} <a name="l00148"></a>00148 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetBytesPerIteration()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>();} <a name="l00149"></a>00149 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetIterationsToBuffer()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->OptimalNumberOfParallelBlocks();} <a name="l00150"></a>00150 <span class="keywordtype">void</span> WriteKeystream(byte *buffer, <span class="keywordtype">size_t</span> iterationCount) <a name="l00151"></a>00151 {OperateKeystream(WRITE_KEYSTREAM, buffer, NULL, iterationCount);} <a name="l00152"></a>00152 <span class="keywordtype">bool</span> CanOperateKeystream()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;} <a name="l00153"></a>00153 <span class="keywordtype">void</span> OperateKeystream(KeystreamOperation operation, byte *output, <span class="keyword">const</span> byte *input, <span class="keywordtype">size_t</span> iterationCount); <a name="l00154"></a>00154 <span class="keywordtype">void</span> CipherResynchronize(byte *keystreamBuffer, <span class="keyword">const</span> byte *iv, <span class="keywordtype">size_t</span> length); <a name="l00155"></a>00155 <span class="keywordtype">void</span> SeekToIteration(lword iterationCount); <a name="l00156"></a>00156 <a name="l00157"></a>00157 <a class="code" href="class_sec_block.html">AlignedSecByteBlock</a> m_counterArray; <a name="l00158"></a>00158 }; <a name="l00159"></a>00159 <a name="l00160"></a><a class="code" href="class_block_oriented_cipher_mode_base.html">00160</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_block_oriented_cipher_mode_base.html">BlockOrientedCipherModeBase</a> : <span class="keyword">public</span> <a class="code" href="class_cipher_mode_base.html">CipherModeBase</a> <a name="l00161"></a>00161 { <a name="l00162"></a>00162 <span class="keyword">public</span>: <a name="l00163"></a>00163 <span class="keywordtype">void</span> UncheckedSetKey(<span class="keyword">const</span> byte *key, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &params); <a name="l00164"></a><a class="code" href="class_block_oriented_cipher_mode_base.html#a2fa0c0eb71891b60825c4d9a9723f7a1">00164</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_block_oriented_cipher_mode_base.html#a2fa0c0eb71891b60825c4d9a9723f7a1" title="returns block size, if input must be processed in blocks, otherwise 1">MandatoryBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> BlockSize();} <a name="l00165"></a><a class="code" href="class_block_oriented_cipher_mode_base.html#a39291edcd523e1a8b1d3a8b6e3098438">00165</a> <span class="keywordtype">bool</span> <a class="code" href="class_block_oriented_cipher_mode_base.html#a39291edcd523e1a8b1d3a8b6e3098438" title="returns whether this cipher supports random access">IsRandomAccess</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;} <a name="l00166"></a><a class="code" href="class_block_oriented_cipher_mode_base.html#a332d8dd09adc7a41328d172af05f14db">00166</a> <span class="keywordtype">bool</span> <a class="code" href="class_block_oriented_cipher_mode_base.html#a332d8dd09adc7a41328d172af05f14db" title="returns whether this transformation is self-inverting (e.g. xor with a keystream)">IsSelfInverting</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;} <a name="l00167"></a><a class="code" href="class_block_oriented_cipher_mode_base.html#ac15b9fafc77eb254d6167524452ecbce">00167</a> <span class="keywordtype">bool</span> <a class="code" href="class_block_oriented_cipher_mode_base.html#ac15b9fafc77eb254d6167524452ecbce" title="returns whether this is an encryption object">IsForwardTransformation</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_cipher->IsForwardTransformation();} <a name="l00168"></a><a class="code" href="class_block_oriented_cipher_mode_base.html#af56879c9784d5f70120f46fb60941b9f">00168</a> <span class="keywordtype">void</span> <a class="code" href="class_block_oriented_cipher_mode_base.html#af56879c9784d5f70120f46fb60941b9f" title="resynchronize with an IV. ivLength=-1 means use IVSize()">Resynchronize</a>(<span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> length=-1) {memcpy_s(m_register, m_register.size(), iv, ThrowIfInvalidIVLength(length));} <a name="l00169"></a>00169 <a name="l00170"></a>00170 <span class="keyword">protected</span>: <a name="l00171"></a>00171 <span class="keywordtype">bool</span> RequireAlignedInput()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;} <a name="l00172"></a>00172 <span class="keywordtype">void</span> ResizeBuffers() <a name="l00173"></a>00173 { <a name="l00174"></a>00174 CipherModeBase::ResizeBuffers(); <a name="l00175"></a>00175 m_buffer.New(<a class="code" href="namespace_name.html#aa93e40d0259a59959d270e6c82a9f1eb" title="int, in bytes">BlockSize</a>()); <a name="l00176"></a>00176 } <a name="l00177"></a>00177 <a name="l00178"></a>00178 <a class="code" href="class_sec_block.html" title="a block of memory allocated using A">SecByteBlock</a> m_buffer; <a name="l00179"></a>00179 }; <a name="l00180"></a>00180 <a name="l00181"></a><a class="code" href="class_e_c_b___one_way.html">00181</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_e_c_b___one_way.html">ECB_OneWay</a> : <span class="keyword">public</span> <a class="code" href="class_block_oriented_cipher_mode_base.html">BlockOrientedCipherModeBase</a> <a name="l00182"></a>00182 { <a name="l00183"></a>00183 <span class="keyword">public</span>: <a name="l00184"></a><a class="code" href="class_e_c_b___one_way.html#aea389c964114b73390dd81d836124461">00184</a> <span class="keywordtype">void</span> <a class="code" href="class_simple_keying_interface.html#adf3c29b3ef3af74788a58c7c49887fd7" title="set or reset the key of this object">SetKey</a>(<span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &params = g_nullNameValuePairs) <a name="l00185"></a>00185 {m_cipher->SetKey(key, length, params); BlockOrientedCipherModeBase::ResizeBuffers();} <a name="l00186"></a><a class="code" href="class_e_c_b___one_way.html#af8a68508189a975f873d27d9f070171d">00186</a> IV_Requirement <a class="code" href="class_e_c_b___one_way.html#af8a68508189a975f873d27d9f070171d" title="returns the minimal requirement for secure IVs">IVRequirement</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> NOT_RESYNCHRONIZABLE;} <a name="l00187"></a><a class="code" href="class_e_c_b___one_way.html#ae525b1874f11cd0aa85f2d93c17f9d08">00187</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_e_c_b___one_way.html#ae525b1874f11cd0aa85f2d93c17f9d08" title="returns the input block size that is most efficient for this cipher">OptimalBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> BlockSize() * m_cipher->OptimalNumberOfParallelBlocks();} <a name="l00188"></a>00188 <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#a26feabde21bc4d1783195969733e3bb0" title="encrypt or decrypt an array of bytes of specified length">ProcessData</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length); <a name="l00189"></a>00189 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"ECB"</span>;} <a name="l00190"></a>00190 }; <a name="l00191"></a>00191 <a name="l00192"></a><a class="code" href="class_c_b_c___mode_base.html">00192</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_b_c___mode_base.html">CBC_ModeBase</a> : <span class="keyword">public</span> <a class="code" href="class_block_oriented_cipher_mode_base.html">BlockOrientedCipherModeBase</a> <a name="l00193"></a>00193 { <a name="l00194"></a>00194 <span class="keyword">public</span>: <a name="l00195"></a><a class="code" href="class_c_b_c___mode_base.html#a6ac61ad1f40cfdb1ba1d4b19ef3d60c4">00195</a> IV_Requirement <a class="code" href="class_c_b_c___mode_base.html#a6ac61ad1f40cfdb1ba1d4b19ef3d60c4" title="returns the minimal requirement for secure IVs">IVRequirement</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> UNPREDICTABLE_RANDOM_IV;} <a name="l00196"></a>00196 <span class="keywordtype">bool</span> RequireAlignedInput()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;} <a name="l00197"></a><a class="code" href="class_c_b_c___mode_base.html#a4a1900b5f7c1db0b71cd008c557fa618">00197</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_c_b_c___mode_base.html#a4a1900b5f7c1db0b71cd008c557fa618" title="returns the minimum size of the last block, 0 indicating the last block is not special">MinLastBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 0;} <a name="l00198"></a>00198 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CBC"</span>;} <a name="l00199"></a>00199 }; <a name="l00200"></a>00200 <a name="l00201"></a><a class="code" href="class_c_b_c___encryption.html">00201</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_b_c___encryption.html">CBC_Encryption</a> : <span class="keyword">public</span> <a class="code" href="class_c_b_c___mode_base.html">CBC_ModeBase</a> <a name="l00202"></a>00202 { <a name="l00203"></a>00203 <span class="keyword">public</span>: <a name="l00204"></a>00204 <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#a26feabde21bc4d1783195969733e3bb0" title="encrypt or decrypt an array of bytes of specified length">ProcessData</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length); <a name="l00205"></a>00205 }; <a name="l00206"></a>00206 <a name="l00207"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html">00207</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_b_c___c_t_s___encryption.html">CBC_CTS_Encryption</a> : <span class="keyword">public</span> <a class="code" href="class_c_b_c___encryption.html">CBC_Encryption</a> <a name="l00208"></a>00208 { <a name="l00209"></a>00209 <span class="keyword">public</span>: <a name="l00210"></a>00210 <span class="keywordtype">void</span> SetStolenIV(byte *iv) {m_stolenIV = iv;} <a name="l00211"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html#a6cdc4bc20f0b9834ee7c5e0409fef805">00211</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_c_b_c___c_t_s___encryption.html#a6cdc4bc20f0b9834ee7c5e0409fef805" title="returns the minimum size of the last block, 0 indicating the last block is not special">MinLastBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> BlockSize()+1;} <a name="l00212"></a>00212 <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#a0668b78edaea082f87bf3e878c4c02f7" title="for ciphers where the last block of data is special, encrypt or decrypt the last block of data...">ProcessLastBlock</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length); <a name="l00213"></a>00213 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CBC/CTS"</span>;} <a name="l00214"></a>00214 <a name="l00215"></a>00215 <span class="keyword">protected</span>: <a name="l00216"></a>00216 <span class="keywordtype">void</span> UncheckedSetKey(<span class="keyword">const</span> byte *key, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &params) <a name="l00217"></a>00217 { <a name="l00218"></a>00218 CBC_Encryption::UncheckedSetKey(key, length, params); <a name="l00219"></a>00219 m_stolenIV = params.<a class="code" href="class_name_value_pairs.html#a943b2009297783f1c35bae46efc3b5f7" title="get a named value, returns the default if the name doesn&#39;t exist">GetValueWithDefault</a>(<a class="code" href="namespace_name.html#aa102d92107376dd3fafe1788b2c42b13" title="byte *">Name::StolenIV</a>(), (byte *)NULL); <a name="l00220"></a>00220 } <a name="l00221"></a>00221 <a name="l00222"></a>00222 byte *m_stolenIV; <a name="l00223"></a>00223 }; <a name="l00224"></a>00224 <a name="l00225"></a><a class="code" href="class_c_b_c___decryption.html">00225</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_b_c___decryption.html">CBC_Decryption</a> : <span class="keyword">public</span> <a class="code" href="class_c_b_c___mode_base.html">CBC_ModeBase</a> <a name="l00226"></a>00226 { <a name="l00227"></a>00227 <span class="keyword">public</span>: <a name="l00228"></a>00228 <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#a26feabde21bc4d1783195969733e3bb0" title="encrypt or decrypt an array of bytes of specified length">ProcessData</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length); <a name="l00229"></a>00229 <a name="l00230"></a>00230 <span class="keyword">protected</span>: <a name="l00231"></a>00231 <span class="keywordtype">void</span> ResizeBuffers() <a name="l00232"></a>00232 { <a name="l00233"></a>00233 BlockOrientedCipherModeBase::ResizeBuffers(); <a name="l00234"></a>00234 m_temp.New(BlockSize()); <a name="l00235"></a>00235 } <a name="l00236"></a>00236 <a class="code" href="class_sec_block.html">AlignedSecByteBlock</a> m_temp; <a name="l00237"></a>00237 }; <a name="l00238"></a>00238 <a name="l00239"></a><a class="code" href="class_c_b_c___c_t_s___decryption.html">00239</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_c_b_c___c_t_s___decryption.html">CBC_CTS_Decryption</a> : <span class="keyword">public</span> <a class="code" href="class_c_b_c___decryption.html">CBC_Decryption</a> <a name="l00240"></a>00240 { <a name="l00241"></a>00241 <span class="keyword">public</span>: <a name="l00242"></a><a class="code" href="class_c_b_c___c_t_s___decryption.html#aad1121b9d712a62b288bc7a1da0f31c4">00242</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_c_b_c___c_t_s___decryption.html#aad1121b9d712a62b288bc7a1da0f31c4" title="returns the minimum size of the last block, 0 indicating the last block is not special">MinLastBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> BlockSize()+1;} <a name="l00243"></a>00243 <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#a0668b78edaea082f87bf3e878c4c02f7" title="for ciphers where the last block of data is special, encrypt or decrypt the last block of data...">ProcessLastBlock</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length); <a name="l00244"></a>00244 }; <a name="l00245"></a>00245 <span class="comment"></span> <a name="l00246"></a>00246 <span class="comment">//! _</span> <a name="l00247"></a>00247 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER, <span class="keyword">class</span> BASE> <a name="l00248"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html">00248</a> <span class="keyword">class </span><a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a> : <span class="keyword">protected</span> <a class="code" href="class_object_holder.html">ObjectHolder</a><CIPHER>, <span class="keyword">public</span> <a class="code" href="class_algorithm_impl.html" title="_">AlgorithmImpl</a><BASE, CipherModeFinalTemplate_CipherHolder<CIPHER, BASE> > <a name="l00249"></a>00249 { <a name="l00250"></a>00250 <span class="keyword">public</span>: <a name="l00251"></a>00251 <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a>() <a name="l00252"></a>00252 { <a name="l00253"></a>00253 this->m_cipher = &this->m_object; <a name="l00254"></a>00254 this->ResizeBuffers(); <a name="l00255"></a>00255 } <a name="l00256"></a>00256 <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a>(<span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length) <a name="l00257"></a>00257 { <a name="l00258"></a>00258 this->m_cipher = &this->m_object; <a name="l00259"></a>00259 this->SetKey(key, length); <a name="l00260"></a>00260 } <a name="l00261"></a>00261 <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a>(<span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length, <span class="keyword">const</span> byte *iv) <a name="l00262"></a>00262 { <a name="l00263"></a>00263 this->m_cipher = &this->m_object; <a name="l00264"></a>00264 this->SetKey(key, length, MakeParameters(<a class="code" href="namespace_name.html#a9b6839240a8bdf1f5bcbebf1866f4733" title="ConstByteArrayParameter, also accepts const byte * for backwards compatibility.">Name::IV</a>(), <a class="code" href="class_const_byte_array_parameter.html" title="used to pass byte array input as part of a NameValuePairs object">ConstByteArrayParameter</a>(iv, this->m_cipher->BlockSize()))); <a name="l00265"></a>00265 } <a name="l00266"></a>00266 <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a>(<span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize) <a name="l00267"></a>00267 { <a name="l00268"></a>00268 this->m_cipher = &this->m_object; <a name="l00269"></a>00269 this->SetKey(key, length, MakeParameters(<a class="code" href="namespace_name.html#a9b6839240a8bdf1f5bcbebf1866f4733" title="ConstByteArrayParameter, also accepts const byte * for backwards compatibility.">Name::IV</a>(), <a class="code" href="class_const_byte_array_parameter.html" title="used to pass byte array input as part of a NameValuePairs object">ConstByteArrayParameter</a>(iv, this->m_cipher->BlockSize()))(<a class="code" href="namespace_name.html#a62c578a9a83ca83029cd1ce38431989d" title="int">Name::FeedbackSize</a>(), feedbackSize)); <a name="l00270"></a>00270 } <a name="l00271"></a>00271 <a name="l00272"></a>00272 <span class="keyword">static</span> std::string CRYPTOPP_API StaticAlgorithmName() <a name="l00273"></a>00273 {<span class="keywordflow">return</span> CIPHER::StaticAlgorithmName() + <span class="stringliteral">"/"</span> + BASE::StaticAlgorithmName();} <a name="l00274"></a>00274 }; <a name="l00275"></a>00275 <span class="comment"></span> <a name="l00276"></a>00276 <span class="comment">//! _</span> <a name="l00277"></a>00277 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> BASE> <a name="l00278"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html">00278</a> <span class="keyword">class </span><a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="class_b_a_s_e.html">BASE</a> <a name="l00279"></a>00279 { <a name="l00280"></a>00280 <span class="keyword">public</span>: <a name="l00281"></a>00281 <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a>() {} <a name="l00282"></a>00282 <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a>(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &cipher) <a name="l00283"></a>00283 {this->SetCipher(cipher);} <a name="l00284"></a>00284 <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a>(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &cipher, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize = 0) <a name="l00285"></a>00285 {this->SetCipherWithIV(cipher, iv, feedbackSize);} <a name="l00286"></a>00286 <a name="l00287"></a>00287 std::string AlgorithmName()<span class="keyword"> const</span> <a name="l00288"></a>00288 <span class="keyword"> </span>{<span class="keywordflow">return</span> (this->m_cipher ? this->m_cipher->AlgorithmName() + <span class="stringliteral">"/"</span> : std::string(<span class="stringliteral">""</span>)) + BASE::StaticAlgorithmName();} <a name="l00289"></a>00289 }; <a name="l00290"></a>00290 <a name="l00291"></a>00291 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_c_f_b___cipher_template.html">CFB_CipherTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> >; <a name="l00292"></a>00292 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_c_f_b___encryption_template.html">CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> >; <a name="l00293"></a>00293 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_c_f_b___decryption_template.html">CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> >; <a name="l00294"></a>00294 <span class="comment"></span> <a name="l00295"></a>00295 <span class="comment">//! CFB mode</span> <a name="l00296"></a>00296 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00297"></a><a class="code" href="struct_c_f_b___mode.html">00297</a> <span class="keyword">struct </span><a class="code" href="struct_c_f_b___mode.html" title="CFB mode.">CFB_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00298"></a>00298 { <a name="l00299"></a><a class="code" href="struct_c_f_b___mode.html#a4a74a3c2de19570ba002d634feed6e89">00299</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder<Empty, CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > <a class="code" href="struct_c_f_b___mode.html#a4a74a3c2de19570ba002d634feed6e89" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00300"></a><a class="code" href="struct_c_f_b___mode.html#a5d18795dd56bf1330ce02c0415b37353">00300</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder<Empty, CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > <a class="code" href="struct_c_f_b___mode.html#a5d18795dd56bf1330ce02c0415b37353" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00301"></a>00301 }; <a name="l00302"></a>00302 <span class="comment"></span> <a name="l00303"></a>00303 <span class="comment">//! CFB mode, external cipher</span> <a name="l00304"></a><a class="code" href="struct_c_f_b___mode___external_cipher.html">00304</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_f_b___mode___external_cipher.html" title="CFB mode, external cipher.">CFB_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00305"></a>00305 { <a name="l00306"></a><a class="code" href="struct_c_f_b___mode___external_cipher.html#a7813692f6a4c0af1ef2eeeccf0c0d1aa">00306</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > <a class="code" href="struct_c_f_b___mode___external_cipher.html#a7813692f6a4c0af1ef2eeeccf0c0d1aa" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00307"></a><a class="code" href="struct_c_f_b___mode___external_cipher.html#a3eaabeb1e794d26b41ddaba2423fa85e">00307</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > <a class="code" href="struct_c_f_b___mode___external_cipher.html#a3eaabeb1e794d26b41ddaba2423fa85e" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00308"></a>00308 }; <a name="l00309"></a>00309 <span class="comment"></span> <a name="l00310"></a>00310 <span class="comment">//! CFB mode FIPS variant, requiring full block plaintext according to FIPS 800-38A</span> <a name="l00311"></a>00311 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00312"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode.html">00312</a> <span class="keyword">struct </span><a class="code" href="struct_c_f_b___f_i_p_s___mode.html" title="CFB mode FIPS variant, requiring full block plaintext according to FIPS 800-38A.">CFB_FIPS_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00313"></a>00313 { <a name="l00314"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode.html#abc5d8acb64d528f1a5c5ad71f0f5165f">00314</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder<Empty, CFB_RequireFullDataBlocks<CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > > <a class="code" href="struct_c_f_b___f_i_p_s___mode.html#abc5d8acb64d528f1a5c5ad71f0f5165f" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00315"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode.html#a21cf18a03c3b3ffa67b58aacfd129665">00315</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder<Empty, CFB_RequireFullDataBlocks<CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > > <a class="code" href="struct_c_f_b___f_i_p_s___mode.html#a21cf18a03c3b3ffa67b58aacfd129665" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00316"></a>00316 }; <a name="l00317"></a>00317 <span class="comment"></span> <a name="l00318"></a>00318 <span class="comment">//! CFB mode FIPS variant, requiring full block plaintext according to FIPS 800-38A, external cipher</span> <a name="l00319"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode___external_cipher.html">00319</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_f_b___f_i_p_s___mode___external_cipher.html" title="CFB mode FIPS variant, requiring full block plaintext according to FIPS 800-38A, external cipher...">CFB_FIPS_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00320"></a>00320 { <a name="l00321"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode___external_cipher.html#ab8bd472edefe7b4e86eefb86ac1db44c">00321</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, CFB_RequireFullDataBlocks<CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > > <a class="code" href="struct_c_f_b___f_i_p_s___mode___external_cipher.html#ab8bd472edefe7b4e86eefb86ac1db44c" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00322"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode___external_cipher.html#a1ed857b189576655a94ae1c9e3fa5caf">00322</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, CFB_RequireFullDataBlocks<CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy></a> > > > > <a class="code" href="struct_c_f_b___f_i_p_s___mode___external_cipher.html#a1ed857b189576655a94ae1c9e3fa5caf" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00323"></a>00323 }; <a name="l00324"></a>00324 <a name="l00325"></a>00325 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_additive_cipher_template.html">AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, OFB_ModePolicy></a> >; <a name="l00326"></a>00326 <span class="comment"></span> <a name="l00327"></a>00327 <span class="comment">//! OFB mode</span> <a name="l00328"></a>00328 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00329"></a><a class="code" href="struct_o_f_b___mode.html">00329</a> <span class="keyword">struct </span><a class="code" href="struct_o_f_b___mode.html" title="OFB mode.">OFB_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00330"></a>00330 { <a name="l00331"></a><a class="code" href="struct_o_f_b___mode.html#adbe0a022031c7c5983276211ac492532">00331</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder<Empty, AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, OFB_ModePolicy></a> > > > <a class="code" href="struct_o_f_b___mode.html#adbe0a022031c7c5983276211ac492532" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00332"></a><a class="code" href="struct_o_f_b___mode.html#a2b1a4908df1d6e7c7cf8a685434dd0b7">00332</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">Encryption</a> <a class="code" href="struct_o_f_b___mode.html#a2b1a4908df1d6e7c7cf8a685434dd0b7" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00333"></a>00333 }; <a name="l00334"></a>00334 <span class="comment"></span> <a name="l00335"></a>00335 <span class="comment">//! OFB mode, external cipher</span> <a name="l00336"></a><a class="code" href="struct_o_f_b___mode___external_cipher.html">00336</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_o_f_b___mode___external_cipher.html" title="OFB mode, external cipher.">OFB_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00337"></a>00337 { <a name="l00338"></a><a class="code" href="struct_o_f_b___mode___external_cipher.html#a8e46c20c5ab2c3606c58e6104913ec17">00338</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, OFB_ModePolicy></a> > > > <a class="code" href="struct_o_f_b___mode___external_cipher.html#a8e46c20c5ab2c3606c58e6104913ec17" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00339"></a><a class="code" href="struct_o_f_b___mode___external_cipher.html#ad8ac9143cbe63b9c72f8823c94e1335a">00339</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">Encryption</a> <a class="code" href="struct_o_f_b___mode___external_cipher.html#ad8ac9143cbe63b9c72f8823c94e1335a" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00340"></a>00340 }; <a name="l00341"></a>00341 <a name="l00342"></a>00342 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_additive_cipher_template.html">AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy></a> >; <a name="l00343"></a>00343 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy></a> > > >; <a name="l00344"></a>00344 <span class="comment"></span> <a name="l00345"></a>00345 <span class="comment">//! CTR mode</span> <a name="l00346"></a>00346 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00347"></a><a class="code" href="struct_c_t_r___mode.html">00347</a> <span class="keyword">struct </span><a class="code" href="struct_c_t_r___mode.html" title="CTR mode.">CTR_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00348"></a>00348 { <a name="l00349"></a><a class="code" href="struct_c_t_r___mode.html#a00d6f1bb61c831fa7aa531ee280eb99c">00349</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder<Empty, AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy></a> > > > <a class="code" href="struct_c_t_r___mode.html#a00d6f1bb61c831fa7aa531ee280eb99c" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00350"></a><a class="code" href="struct_c_t_r___mode.html#aa03cbe2f81ebbf2caf030f1f3f71d845">00350</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">Encryption</a> <a class="code" href="struct_c_t_r___mode.html#aa03cbe2f81ebbf2caf030f1f3f71d845" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00351"></a>00351 }; <a name="l00352"></a>00352 <span class="comment"></span> <a name="l00353"></a>00353 <span class="comment">//! CTR mode, external cipher</span> <a name="l00354"></a><a class="code" href="struct_c_t_r___mode___external_cipher.html">00354</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_t_r___mode___external_cipher.html" title="CTR mode, external cipher.">CTR_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00355"></a>00355 { <a name="l00356"></a><a class="code" href="struct_c_t_r___mode___external_cipher.html#a8ab6bcd15b8bb44d49076708feda772c">00356</a> <span class="keyword">typedef</span> CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy> > > > <a class="code" href="struct_c_t_r___mode___external_cipher.html#a8ab6bcd15b8bb44d49076708feda772c" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00357"></a><a class="code" href="struct_c_t_r___mode___external_cipher.html#a931e7e4cf74d14a3ca6ce7a88ece5ae6">00357</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html">Encryption</a> <a class="code" href="struct_c_t_r___mode___external_cipher.html#a931e7e4cf74d14a3ca6ce7a88ece5ae6" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00358"></a>00358 }; <a name="l00359"></a>00359 <span class="comment"></span> <a name="l00360"></a>00360 <span class="comment">//! ECB mode</span> <a name="l00361"></a>00361 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00362"></a><a class="code" href="struct_e_c_b___mode.html">00362</a> <span class="keyword">struct </span><a class="code" href="struct_e_c_b___mode.html" title="ECB mode.">ECB_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00363"></a>00363 { <a name="l00364"></a><a class="code" href="struct_e_c_b___mode.html#a126391ae616f61acf75466ea4c4ad23b">00364</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, ECB_OneWay></a> <a class="code" href="struct_e_c_b___mode.html#a126391ae616f61acf75466ea4c4ad23b" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00365"></a><a class="code" href="struct_e_c_b___mode.html#a0881e991d20186934f9e1d73893f010f">00365</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Decryption, ECB_OneWay></a> <a class="code" href="struct_e_c_b___mode.html#a0881e991d20186934f9e1d73893f010f" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00366"></a>00366 }; <a name="l00367"></a>00367 <a name="l00368"></a>00368 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<ECB_OneWay></a>; <a name="l00369"></a>00369 <span class="comment"></span> <a name="l00370"></a>00370 <span class="comment">//! ECB mode, external cipher</span> <a name="l00371"></a><a class="code" href="struct_e_c_b___mode___external_cipher.html">00371</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_e_c_b___mode___external_cipher.html" title="ECB mode, external cipher.">ECB_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00372"></a>00372 { <a name="l00373"></a><a class="code" href="struct_e_c_b___mode___external_cipher.html#ae8a34d40b7d0c1fb0b529c956ae6842b">00373</a> <span class="keyword">typedef</span> CipherModeFinalTemplate_ExternalCipher<ECB_OneWay> <a class="code" href="struct_e_c_b___mode___external_cipher.html#ae8a34d40b7d0c1fb0b529c956ae6842b" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00374"></a><a class="code" href="struct_e_c_b___mode___external_cipher.html#a85e46f55e4cf4d2d0159ccbea4ec410c">00374</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">Encryption</a> <a class="code" href="struct_e_c_b___mode___external_cipher.html#a85e46f55e4cf4d2d0159ccbea4ec410c" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00375"></a>00375 }; <a name="l00376"></a>00376 <span class="comment"></span> <a name="l00377"></a>00377 <span class="comment">//! CBC mode</span> <a name="l00378"></a>00378 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00379"></a><a class="code" href="struct_c_b_c___mode.html">00379</a> <span class="keyword">struct </span><a class="code" href="struct_c_b_c___mode.html" title="CBC mode.">CBC_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00380"></a>00380 { <a name="l00381"></a><a class="code" href="struct_c_b_c___mode.html#a765a13576e41b3f09301ad4c465fe13c">00381</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, CBC_Encryption></a> <a class="code" href="struct_c_b_c___mode.html#a765a13576e41b3f09301ad4c465fe13c" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00382"></a><a class="code" href="struct_c_b_c___mode.html#a1f760827ba62835fb2d752ba41f5d8c1">00382</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Decryption, CBC_Decryption></a> <a class="code" href="struct_c_b_c___mode.html#a1f760827ba62835fb2d752ba41f5d8c1" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00383"></a>00383 }; <a name="l00384"></a>00384 <a name="l00385"></a>00385 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<CBC_Encryption></a>; <a name="l00386"></a>00386 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<CBC_Decryption></a>; <a name="l00387"></a>00387 <span class="comment"></span> <a name="l00388"></a>00388 <span class="comment">//! CBC mode, external cipher</span> <a name="l00389"></a><a class="code" href="struct_c_b_c___mode___external_cipher.html">00389</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_b_c___mode___external_cipher.html" title="CBC mode, external cipher.">CBC_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00390"></a>00390 { <a name="l00391"></a><a class="code" href="struct_c_b_c___mode___external_cipher.html#aaa2800fcf5153e07c41c1916f3587e4a">00391</a> <span class="keyword">typedef</span> CipherModeFinalTemplate_ExternalCipher<CBC_Encryption> <a class="code" href="struct_c_b_c___mode___external_cipher.html#aaa2800fcf5153e07c41c1916f3587e4a" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00392"></a><a class="code" href="struct_c_b_c___mode___external_cipher.html#a5ceba83614c424c79a13b64583627796">00392</a> <span class="keyword">typedef</span> CipherModeFinalTemplate_ExternalCipher<CBC_Decryption> <a class="code" href="struct_c_b_c___mode___external_cipher.html#a5ceba83614c424c79a13b64583627796" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00393"></a>00393 }; <a name="l00394"></a>00394 <span class="comment"></span> <a name="l00395"></a>00395 <span class="comment">//! CBC mode with ciphertext stealing</span> <a name="l00396"></a>00396 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> CIPHER> <a name="l00397"></a><a class="code" href="struct_c_b_c___c_t_s___mode.html">00397</a> <span class="keyword">struct </span><a class="code" href="struct_c_b_c___c_t_s___mode.html" title="CBC mode with ciphertext stealing.">CBC_CTS_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00398"></a>00398 { <a name="l00399"></a><a class="code" href="struct_c_b_c___c_t_s___mode.html#a3a8e842188f75dbfc0e6222c5cb2954d">00399</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Encryption, CBC_CTS_Encryption></a> <a class="code" href="struct_c_b_c___c_t_s___mode.html#a3a8e842188f75dbfc0e6222c5cb2954d" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00400"></a><a class="code" href="struct_c_b_c___c_t_s___mode.html#a57f5ef103c917e3a811b5838f864eade">00400</a> <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder<CPP_TYPENAME CIPHER::Decryption, CBC_CTS_Decryption></a> <a class="code" href="struct_c_b_c___c_t_s___mode.html#a57f5ef103c917e3a811b5838f864eade" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00401"></a>00401 }; <a name="l00402"></a>00402 <a name="l00403"></a>00403 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Encryption></a>; <a name="l00404"></a>00404 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Decryption></a>; <a name="l00405"></a>00405 <span class="comment"></span> <a name="l00406"></a>00406 <span class="comment">//! CBC mode with ciphertext stealing, external cipher</span> <a name="l00407"></a><a class="code" href="struct_c_b_c___c_t_s___mode___external_cipher.html">00407</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_b_c___c_t_s___mode___external_cipher.html" title="CBC mode with ciphertext stealing, external cipher.">CBC_CTS_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher modes documentation. See NIST SP 800-38A for definitions of these modes. See AuthenticatedSymm...">CipherModeDocumentation</a> <a name="l00408"></a>00408 { <a name="l00409"></a><a class="code" href="struct_c_b_c___c_t_s___mode___external_cipher.html#ac489281da057e155f2ecea432d8ad98d">00409</a> <span class="keyword">typedef</span> CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Encryption> <a class="code" href="struct_c_b_c___c_t_s___mode___external_cipher.html#ac489281da057e155f2ecea432d8ad98d" title="implements the SymmetricCipher interface">Encryption</a>; <a name="l00410"></a><a class="code" href="struct_c_b_c___c_t_s___mode___external_cipher.html#a733a9ac70d490a182c12a541ffa274f8">00410</a> <span class="keyword">typedef</span> CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Decryption> <a class="code" href="struct_c_b_c___c_t_s___mode___external_cipher.html#a733a9ac70d490a182c12a541ffa274f8" title="implements the SymmetricCipher interface">Decryption</a>; <a name="l00411"></a>00411 }; <a name="l00412"></a>00412 <a name="l00413"></a>00413 <span class="preprocessor">#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY</span> <a name="l00414"></a>00414 <span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CFB_Mode_ExternalCipher::Encryption</a> CFBEncryption; <a name="l00415"></a>00415 <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CFB_Mode_ExternalCipher::Decryption</a> CFBDecryption; <a name="l00416"></a>00416 <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">OFB_Mode_ExternalCipher::Encryption</a> OFB; <a name="l00417"></a>00417 <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html">CTR_Mode_ExternalCipher::Encryption</a> CounterMode; <a name="l00418"></a>00418 <span class="preprocessor">#endif</span> <a name="l00419"></a>00419 <span class="preprocessor"></span> <a name="l00420"></a>00420 NAMESPACE_END <a name="l00421"></a>00421 <a name="l00422"></a>00422 <span class="preprocessor">#endif</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Feb 8 2011 for Crypto++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>