<!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++: authenc.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>authenc.h</h1> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_AUTHENC_H</span> <a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_AUTHENC_H</span> <a name="l00003"></a>00003 <span class="preprocessor"></span> <a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="cryptlib_8h.html">cryptlib.h</a>"</span> <a name="l00005"></a>00005 <span class="preprocessor">#include "secblock.h"</span> <a name="l00006"></a>00006 <a name="l00007"></a>00007 NAMESPACE_BEGIN(CryptoPP) <a name="l00008"></a>00008 <a name="l00009"></a>00009 <span class="comment">//! .</span> <a name="l00010"></a><a class="code" href="class_authenticated_symmetric_cipher_base.html">00010</a> <span class="comment"></span>class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE <a class="code" href="class_authenticated_symmetric_cipher_base.html" title=".">AuthenticatedSymmetricCipherBase</a> : public <a class="code" href="class_authenticated_symmetric_cipher.html" title="interface for for one direction (encryption or decryption) of a stream cipher or block cipher mode wi...">AuthenticatedSymmetricCipher</a> <a name="l00011"></a>00011 { <a name="l00012"></a>00012 <span class="keyword">public</span>: <a name="l00013"></a>00013 <a class="code" href="class_authenticated_symmetric_cipher_base.html" title=".">AuthenticatedSymmetricCipherBase</a>() : m_state(State_Start) {} <a name="l00014"></a>00014 <a name="l00015"></a><a class="code" href="class_authenticated_symmetric_cipher_base.html#a0913986395f646216926c2febfcdb8b7">00015</a> <span class="keywordtype">bool</span> <a class="code" href="class_authenticated_symmetric_cipher_base.html#a0913986395f646216926c2febfcdb8b7" 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="l00016"></a><a class="code" href="class_authenticated_symmetric_cipher_base.html#a8a54f13c52f2ed9af9fa7123fd59b5d7">00016</a> <span class="keywordtype">bool</span> <a class="code" href="class_authenticated_symmetric_cipher_base.html#a8a54f13c52f2ed9af9fa7123fd59b5d7" 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">true</span>;} <a name="l00017"></a>00017 <span class="keywordtype">void</span> UncheckedSetKey(<span class="keyword">const</span> byte *,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>,<span class="keyword">const</span> CryptoPP::NameValuePairs &) {assert(<span class="keyword">false</span>);} <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="keywordtype">void</span> SetKey(<span class="keyword">const</span> byte *userKey, <span class="keywordtype">size_t</span> keylength, <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="l00020"></a><a class="code" href="class_authenticated_symmetric_cipher_base.html#a5c6a2964ef0bae2428347f180f76256e">00020</a> <span class="keywordtype">void</span> <a class="code" href="class_authenticated_symmetric_cipher_base.html#a5c6a2964ef0bae2428347f180f76256e" title="discard the current state, and restart with a new message">Restart</a>() {<span class="keywordflow">if</span> (m_state > State_KeySet) m_state = State_KeySet;} <a name="l00021"></a>00021 <span class="keywordtype">void</span> Resynchronize(<span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> length=-1); <a name="l00022"></a>00022 <span class="keywordtype">void</span> Update(<span class="keyword">const</span> byte *input, <span class="keywordtype">size_t</span> length); <a name="l00023"></a>00023 <span class="keywordtype">void</span> ProcessData(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length); <a name="l00024"></a>00024 <span class="keywordtype">void</span> TruncatedFinal(byte *mac, <span class="keywordtype">size_t</span> macSize); <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">protected</span>: <a name="l00027"></a>00027 <span class="keywordtype">void</span> AuthenticateData(<span class="keyword">const</span> byte *data, <span class="keywordtype">size_t</span> len); <a name="l00028"></a>00028 <span class="keyword">const</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> & GetSymmetricCipher()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">const_cast<</span><a class="code" href="class_authenticated_symmetric_cipher_base.html" title=".">AuthenticatedSymmetricCipherBase</a> *<span class="keyword">></span>(<span class="keyword">this</span>)->AccessSymmetricCipher();}; <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="keyword">virtual</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> & AccessSymmetricCipher() =0; <a name="l00031"></a>00031 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AuthenticationIsOnPlaintext() <span class="keyword">const</span> =0; <a name="l00032"></a>00032 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> AuthenticationBlockSize() <span class="keyword">const</span> =0; <a name="l00033"></a>00033 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetKeyWithoutResync(<span class="keyword">const</span> byte *userKey, <span class="keywordtype">size_t</span> keylength, <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) =0; <a name="l00034"></a>00034 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Resync(<span class="keyword">const</span> byte *iv, <span class="keywordtype">size_t</span> len) =0; <a name="l00035"></a>00035 <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> AuthenticateBlocks(<span class="keyword">const</span> byte *data, <span class="keywordtype">size_t</span> len) =0; <a name="l00036"></a>00036 <span class="keyword">virtual</span> <span class="keywordtype">void</span> AuthenticateLastHeaderBlock() =0; <a name="l00037"></a>00037 <span class="keyword">virtual</span> <span class="keywordtype">void</span> AuthenticateLastConfidentialBlock() {} <a name="l00038"></a>00038 <span class="keyword">virtual</span> <span class="keywordtype">void</span> AuthenticateLastFooterBlock(byte *mac, <span class="keywordtype">size_t</span> macSize) =0; <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="keyword">enum</span> State {State_Start, State_KeySet, State_IVSet, State_AuthUntransformed, State_AuthTransformed, State_AuthFooter}; <a name="l00041"></a>00041 State m_state; <a name="l00042"></a>00042 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_bufferedDataLength; <a name="l00043"></a>00043 lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength; <a name="l00044"></a>00044 <a class="code" href="class_sec_block.html">AlignedSecByteBlock</a> m_buffer; <a name="l00045"></a>00045 }; <a name="l00046"></a>00046 <a name="l00047"></a>00047 NAMESPACE_END <a name="l00048"></a>00048 <a name="l00049"></a>00049 <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>