⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blumshub_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>Crypto++: blumshub.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="namespaces.html"><span>Namespaces</span></a></li>    <li><a href="classes.html"><span>Classes</span></a></li>    <li class="current"><a href="files.html"><span>Files</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="files.html"><span>File&nbsp;List</span></a></li>    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>  </ul></div><h1>blumshub.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_BLUMSHUB_H</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLUMSHUB_H</span><a name="l00003"></a>00003 <span class="preprocessor"></span><a name="l00004"></a>00004 <span class="preprocessor">#include "modarith.h"</span><a name="l00005"></a>00005 <a name="l00006"></a>00006 NAMESPACE_BEGIN(CryptoPP)<a name="l00007"></a>00007 <a name="l00008"></a>00008 class BlumGoldwasserPublicKey;<a name="l00009"></a>00009 class BlumGoldwasserPrivateKey;<a name="l00010"></a>00010 <span class="comment"></span><a name="l00011"></a>00011 <span class="comment">//! BlumBlumShub without factorization of the modulus</span><a name="l00012"></a><a class="code" href="class_public_blum_blum_shub.html">00012</a> <span class="comment"></span>class <a class="code" href="class_public_blum_blum_shub.html" title="BlumBlumShub without factorization of the modulus.">PublicBlumBlumShub</a> : public <a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a>,<a name="l00013"></a>00013                                                    public <a class="code" href="class_stream_transformation.html" title="interface for the data processing part of stream ciphers">StreamTransformation</a><a name="l00014"></a>00014 {<a name="l00015"></a>00015 <span class="keyword">public</span>:<a name="l00016"></a>00016         <a class="code" href="class_public_blum_blum_shub.html" title="BlumBlumShub without factorization of the modulus.">PublicBlumBlumShub</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;n, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;seed);<a name="l00017"></a>00017 <a name="l00018"></a>00018         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GenerateBit();<a name="l00019"></a>00019         byte GenerateByte();<a name="l00020"></a>00020         <span class="keywordtype">void</span> GenerateBlock(byte *output, <span class="keywordtype">size_t</span> size);<a name="l00021"></a>00021         <span class="keywordtype">void</span> ProcessData(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00022"></a>00022 <a name="l00023"></a><a class="code" href="class_public_blum_blum_shub.html#c322c5980509bc4e8075f28c4425ac3f">00023</a>         <span class="keywordtype">bool</span> IsSelfInverting()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00024"></a><a class="code" href="class_public_blum_blum_shub.html#0ad21fce7f3113ab25ea05e47773a786">00024</a>         <span class="keywordtype">bool</span> IsForwardTransformation()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">protected</span>:<a name="l00027"></a><a class="code" href="class_public_blum_blum_shub.html#60712ac102ff230738ea09fe7e141d89">00027</a>         <a class="code" href="class_modular_arithmetic.html" title="ring of congruence classes modulo n">ModularArithmetic</a> modn;<a name="l00028"></a><a class="code" href="class_public_blum_blum_shub.html#45e5b885b73eef60d42220504e151701">00028</a>         word maxBits, bitsLeft;<a name="l00029"></a><a class="code" href="class_public_blum_blum_shub.html#060f64661986ffee95b4ec13107cb363">00029</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> current;<a name="l00030"></a>00030 <a name="l00031"></a><a class="code" href="class_public_blum_blum_shub.html#64155f59c06572d6d5ebc0246f80fefd">00031</a>         <span class="keyword">friend</span> <span class="keyword">class </span>BlumGoldwasserPublicKey;<a name="l00032"></a><a class="code" href="class_public_blum_blum_shub.html#31aabf892ac3430c6e63d71acee8a373">00032</a>         <span class="keyword">friend</span> <span class="keyword">class </span>BlumGoldwasserPrivateKey;<a name="l00033"></a>00033 };<a name="l00034"></a>00034 <span class="comment"></span><a name="l00035"></a>00035 <span class="comment">//! BlumBlumShub with factorization of the modulus</span><a name="l00036"></a><a class="code" href="class_blum_blum_shub.html">00036</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_blum_blum_shub.html" title="BlumBlumShub with factorization of the modulus.">BlumBlumShub</a> : <span class="keyword">public</span> <a class="code" href="class_public_blum_blum_shub.html" title="BlumBlumShub without factorization of the modulus.">PublicBlumBlumShub</a><a name="l00037"></a>00037 {<a name="l00038"></a>00038 <span class="keyword">public</span>:<a name="l00039"></a>00039         <span class="comment">// Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long,</span><a name="l00040"></a>00040         <span class="comment">// seed is the secret key and should be about as big as p*q</span><a name="l00041"></a>00041         <a class="code" href="class_blum_blum_shub.html#b53b99f246235429694719d41e00b658">BlumBlumShub</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;<a class="code" href="class_blum_blum_shub.html#ea41f47a0b2fc6c05a80b3a59857e70b">p</a>, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;<a class="code" href="class_blum_blum_shub.html#ec0407cb51a5edac638ad7acc8380577">q</a>, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;seed);<a name="l00042"></a>00042         <a name="l00043"></a><a class="code" href="class_blum_blum_shub.html#dca1fd77ec8f237fa8eeaf6fb22a6412">00043</a>         <span class="keywordtype">bool</span> <a class="code" href="class_blum_blum_shub.html#dca1fd77ec8f237fa8eeaf6fb22a6412" title="returns whether this cipher supports random access">IsRandomAccess</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00044"></a>00044         <span class="keywordtype">void</span> <a class="code" href="class_blum_blum_shub.html#e29af38d625e72bc5e503db157a84c5f" title="for random access ciphers, seek to an absolute position">Seek</a>(lword index);<a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="keyword">protected</span>:<a name="l00047"></a><a class="code" href="class_blum_blum_shub.html#ec0407cb51a5edac638ad7acc8380577">00047</a>         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_blum_blum_shub.html#ea41f47a0b2fc6c05a80b3a59857e70b">p</a>, <a class="code" href="class_blum_blum_shub.html#ec0407cb51a5edac638ad7acc8380577">q</a>;<a name="l00048"></a><a class="code" href="class_blum_blum_shub.html#3a402876633f8a93a59eb862a6e1f6ee">00048</a>         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_blum_blum_shub.html#3a402876633f8a93a59eb862a6e1f6ee">x0</a>;<a name="l00049"></a>00049 };<a name="l00050"></a>00050 <a name="l00051"></a>00051 NAMESPACE_END<a name="l00052"></a>00052 <a name="l00053"></a>00053 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:19 2007 for Crypto++ by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -