<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crypto++: seal.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.3.7 --> <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> <h1>seal.h</h1><pre class="fragment"><div>00001 <span class="preprocessor">#ifndef CRYPTOPP_SEAL_H</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_SEAL_H</span> 00003 <span class="preprocessor"></span> 00004 <span class="preprocessor">#include "<a class="code" href="strciphr_8h.html">strciphr.h</a>"</span> 00005 00006 NAMESPACE_BEGIN(CryptoPP) 00007 00008 <span class="comment">//! _</span> 00009 <span class="comment"></span>template <class B = BigEndian> <a name="l00010"></a><a class="code" href="struct_s_e_a_l___info.html">00010</a> struct <a class="code" href="struct_s_e_a_l___info.html">SEAL_Info</a> : public <a class="code" href="class_fixed_key_length.html">FixedKeyLength</a><20, <a class="code" href="class_simple_keying_interface.html">SimpleKeyingInterface</a>::INTERNALLY_GENERATED_IV> 00011 { 00012 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *StaticAlgorithmName() {<span class="keywordflow">return</span> B::ToEnum() == LITTLE_ENDIAN_ORDER ? <span class="stringliteral">"SEAL-3.0-LE"</span> : <span class="stringliteral">"SEAL-3.0-BE"</span>;} 00013 }; 00014 00015 <span class="keyword">template</span> <<span class="keyword">class</span> B = BigEndian> 00016 <span class="keyword">class </span>CRYPTOPP_NO_VTABLE SEAL_Policy : <span class="keyword">public</span> AdditiveCipherConcretePolicy<word32, 256>, <span class="keyword">public</span> <a class="code" href="struct_s_e_a_l___info.html">SEAL_Info</a><B> 00017 { 00018 <span class="keyword">public</span>: 00019 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> IVSize()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 4;} 00020 <span class="keywordtype">void</span> GetNextIV(byte *IV)<span class="keyword"> const </span>{UnalignedPutWord(BIG_ENDIAN_ORDER, IV, m_outsideCounter+1);} 00021 00022 <span class="keyword">protected</span>: 00023 <span class="keywordtype">void</span> CipherSetKey(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &params, <span class="keyword">const</span> byte *key, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length); 00024 <span class="keywordtype">void</span> OperateKeystream(KeystreamOperation operation, byte *output, <span class="keyword">const</span> byte *input, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iterationCount); 00025 <span class="keywordtype">void</span> CipherResynchronize(byte *keystreamBuffer, <span class="keyword">const</span> byte *IV); 00026 <span class="keywordtype">bool</span> IsRandomAccess()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;} 00027 <span class="keywordtype">void</span> SeekToIteration(lword iterationCount); 00028 00029 <span class="keyword">private</span>: 00030 FixedSizeSecBlock<word32, 512> m_T; 00031 FixedSizeSecBlock<word32, 256> m_S; 00032 <a class="code" href="class_sec_block.html">SecBlock<word32></a> m_R; 00033 00034 word32 m_startCount, m_iterationsPerCount; 00035 word32 m_outsideCounter, m_insideCounter; 00036 }; 00037 <span class="comment"></span> 00038 <span class="comment">//! <a href="http://www.weidai.com/scan-mirror/cs.html#SEAL-3.0-BE">SEAL</a></span> 00039 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> B = BigEndian> <a name="l00040"></a><a class="code" href="struct_s_e_a_l.html">00040</a> <span class="keyword">struct </span><a class="code" href="struct_s_e_a_l.html">SEAL</a> : <span class="keyword">public</span> <a class="code" href="struct_s_e_a_l___info.html">SEAL_Info</a><B>, <span class="keyword">public</span> <a class="code" href="struct_symmetric_cipher_documentation.html">SymmetricCipherDocumentation</a> 00041 { <a name="l00042"></a><a class="code" href="struct_s_e_a_l.html#_s_e_a_lw0">00042</a> <span class="keyword">typedef</span> <a class="code" href="class_symmetric_cipher_final.html">SymmetricCipherFinal<ConcretePolicyHolder<SEAL_Policy<B></a>, AdditiveCipherTemplate<> >, <a class="code" href="struct_s_e_a_l___info.html">SEAL_Info<B></a> > <a class="code" href="class_symmetric_cipher_final.html">Encryption</a>; <a name="l00043"></a><a class="code" href="struct_s_e_a_l.html#_s_e_a_lw1">00043</a> <span class="keyword">typedef</span> <a class="code" href="class_symmetric_cipher_final.html">Encryption</a> <a class="code" href="class_symmetric_cipher_final.html">Decryption</a>; 00044 }; 00045 00046 NAMESPACE_END 00047 00048 <span class="preprocessor">#endif</span> </div></pre><hr size="1"><address style="align: right;"><small>Generated on Sun Nov 7 08:23:59 2004 for Crypto++ by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address> </body> </html>