📄 class_sapphire_decryption.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Crypto++: SapphireDecryption class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><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">Compound 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">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>SapphireDecryption Class Reference</h1><code>#include <<a class="el" href="sapphire_8h-source.html">sapphire.h</a>></code><p><p>Inheritance diagram for SapphireDecryption:<p><center><img src="class_sapphire_decryption.png" usemap="#SapphireDecryption_map" border="0" alt=""></center><map name="SapphireDecryption_map"><area href="class_stream_transformation.html" alt="StreamTransformation" shape="rect" coords="0,112,204,136"><area href="class_sapphire_base.html" alt="SapphireBase" shape="rect" coords="214,112,418,136"><area href="class_algorithm.html" alt="Algorithm" shape="rect" coords="0,56,204,80"><area href="class_variable_key_length.html" alt="VariableKeyLength< 16, 1, 255 >" shape="rect" coords="214,56,418,80"><area href="class_clonable.html" alt="Clonable" shape="rect" coords="0,0,204,24"></map><a href="class_sapphire_decryption-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2><a href="http://www.weidai.com/scan-mirror/cs.html#Sapphire-II">Sapphire-II cipher</a> <p><p>Definition at line <a class="el" href="sapphire_8h-source.html#l00067">67</a> of file <a class="el" href="sapphire_8h-source.html">sapphire.h</a>.<table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_decryptiona0" doxytag="SapphireDecryption::SapphireDecryption"></a> </td><td class="memItemRight" valign=bottom><b>SapphireDecryption</b> (const byte *userKey, unsigned int keyLength=DEFAULT_KEYLENGTH)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_decryptiona1" doxytag="SapphireDecryption::ProcessByte"></a>byte </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_sapphire_decryptiona1">ProcessByte</a> (byte b)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">implemented as {ProcessData(&input, &input, 1); return input;} <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_decryptiona2" doxytag="SapphireDecryption::ProcessString"></a>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_sapphire_decryptiona2">ProcessString</a> (byte *outString, const byte *inString, unsigned int length)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">same as ProcessData(outString, inString, length) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_decryptiona3" doxytag="SapphireDecryption::ProcessString"></a>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_sapphire_decryptiona3">ProcessString</a> (byte *inoutString, unsigned int length)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">same as ProcessData(inoutString, inoutString, length) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_stream_transformation.html">StreamTransformation</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera0">Ref</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">return a reference to this object, </em> <a href="#_symmetric_ciphera0"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera1" doxytag="SapphireDecryption::MandatoryBlockSize"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera1">MandatoryBlockSize</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns block size, if input must be processed in blocks, otherwise 1 <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera2">OptimalBlockSize</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns the input block size that is most efficient for this cipher </em> <a href="#_symmetric_ciphera2"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera3" doxytag="SapphireDecryption::GetOptimalBlockSizeUsed"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera3">GetOptimalBlockSizeUsed</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns how much of the current block is used up <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera4" doxytag="SapphireDecryption::OptimalDataAlignment"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera4">OptimalDataAlignment</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns how input should be aligned for optimal performance <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera5">ProcessData</a> (byte *outString, const byte *inString, unsigned int length)=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">encrypt or decrypt an array of bytes of specified length </em> <a href="#_symmetric_ciphera5"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera6">ProcessLastBlock</a> (byte *outString, const byte *inString, unsigned int length)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">for ciphers where the last block of data is special, encrypt or decrypt the last block of data </em> <a href="#_symmetric_ciphera6"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera7" doxytag="SapphireDecryption::MinLastBlockSize"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera7">MinLastBlockSize</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns the minimum size of the last block, 0 indicating the last block is not special <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera11" doxytag="SapphireDecryption::IsRandomAccess"></a>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera11">IsRandomAccess</a> () const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns whether this cipher supports random access <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera12" doxytag="SapphireDecryption::Seek"></a>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera12">Seek</a> (dword n)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">for random access ciphers, seek to an absolute position <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera13" doxytag="SapphireDecryption::IsSelfInverting"></a>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera13">IsSelfInverting</a> () const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns whether this transformation is self-inverting (e.g. xor with a keystream) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_symmetric_ciphera14" doxytag="SapphireDecryption::IsForwardTransformation"></a>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_symmetric_ciphera14">IsForwardTransformation</a> () const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns whether this is an encryption object <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_zlib_decompressora17" doxytag="SapphireDecryption::AlgorithmName"></a>virtual std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_zlib_decompressora17">AlgorithmName</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns name of this algorithm, not universally implemented yet <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_zlib_decompressora18" doxytag="SapphireDecryption::Clone"></a>virtual <a class="el" href="class_clonable.html">Clonable</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="class_sapphire_decryption.html#_zlib_decompressora18">Clone</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">this is not implemented by most classes yet <br><br></td></tr><tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gd15" doxytag="SapphireDecryption::ShuffleCards"></a>void </td><td class="memItemRight" valign=bottom><b>ShuffleCards</b> ()</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gr0" doxytag="SapphireDecryption::cards"></a><a class="el" href="class_sec_block.html">SecByteBlock</a> </td><td class="memItemRight" valign=bottom><b>cards</b></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gr1" doxytag="SapphireDecryption::rotor"></a>byte </td><td class="memItemRight" valign=bottom><b>rotor</b></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gr2" doxytag="SapphireDecryption::ratchet"></a>byte </td><td class="memItemRight" valign=bottom><b>ratchet</b></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gr3" doxytag="SapphireDecryption::avalanche"></a>byte </td><td class="memItemRight" valign=bottom><b>avalanche</b></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gr4" doxytag="SapphireDecryption::last_plain"></a>byte </td><td class="memItemRight" valign=bottom><b>last_plain</b></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_sapphire_r_n_gr5" doxytag="SapphireDecryption::last_cipher"></a>byte </td><td class="memItemRight" valign=bottom><b>last_cipher</b></td></tr></table><hr><h2>Member Function Documentation</h2><a name="_symmetric_ciphera0" doxytag="SapphireDecryption::Ref"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="class_stream_transformation.html">StreamTransformation</a>& StreamTransformation::Ref </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline, inherited]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>return a reference to this object, <p>This function is useful for passing a temporary <a class="el" href="class_stream_transformation.html">StreamTransformation</a> object to a function that takes a non-const reference. <p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -