📄 rabin_8h-source.html
字号:
<a name="l00047"></a>00047 {<a name="l00048"></a>00048 <span class="keyword">typedef</span> <a class="code" href="class_invertible_rabin_function.html" title="_">InvertibleRabinFunction</a> <a class="code" href="class_rabin_function.html" title="_">ThisClass</a>;<a name="l00049"></a>00049 <a name="l00050"></a>00050 <span class="keyword">public</span>:<a name="l00051"></a><a class="code" href="class_invertible_rabin_function.html#348e688b3a648defa9ca96bf16cc14d2">00051</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#348e688b3a648defa9ca96bf16cc14d2">Initialize</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &n, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &r, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &s,<a name="l00052"></a>00052 <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &p, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &q, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &u)<a name="l00053"></a>00053 {<a class="code" href="class_rabin_function.html#f361185b5962701c78c410945f6280bc">m_n</a> = n; <a class="code" href="class_rabin_function.html#c98a931385ae02de294a7a7da66fddfd">m_r</a> = r; <a class="code" href="class_rabin_function.html#601264d1c703941468aaaa7c1918dec2">m_s</a> = s; <a class="code" href="class_invertible_rabin_function.html#7265f1577c7c60962100bf048c532b65">m_p</a> = p; <a class="code" href="class_invertible_rabin_function.html#6f7f68cf7b9299b85da9df3241aa8096">m_q</a> = q; <a class="code" href="class_invertible_rabin_function.html#39d937e65da2073ea867b8a93f8b25e7">m_u</a> = u;}<a name="l00054"></a><a class="code" href="class_invertible_rabin_function.html#5097cd1653af359888c21b793c2d645a">00054</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#348e688b3a648defa9ca96bf16cc14d2">Initialize</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> keybits)<a name="l00055"></a>00055 {<a class="code" href="class_generatable_crypto_material.html#38d492343c32e530a5c2781b5797f755" title="calls the above function with a NameValuePairs object that just specifies "KeySize"...">GenerateRandomWithKeySize</a>(rng, keybits);}<a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#d770bc9e03d2f5b812655b6d8dd1d796">BERDecode</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &bt);<a name="l00058"></a>00058 <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#e7296b7b97da157a6cb0dc193174aa2d">DEREncode</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &bt) <span class="keyword">const</span>;<a name="l00059"></a>00059 <a name="l00060"></a>00060 <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_invertible_rabin_function.html#15788f2fb0225297f665e30044661dfd">CalculateInverse</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &x) <span class="keyword">const</span>;<a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keywordtype">bool</span> <a class="code" href="class_invertible_rabin_function.html#8f654d654bf7e833c9c48351346d3cb9" title="check this object for errors">Validate</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level) <span class="keyword">const</span>;<a name="l00063"></a>00063 <span class="keywordtype">bool</span> <a class="code" href="class_invertible_rabin_function.html#52931eba7e69b47a1b9307dc92721e0f" title="to be implemented by derived classes, users should use one of the above functions...">GetVoidValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> std::type_info &valueType, <span class="keywordtype">void</span> *pValue) <span class="keyword">const</span>;<a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#66594bb7f369e4ecc30bbe6ae62527ea" title="assign values from source to this object">AssignFrom</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> &source);<span class="comment"></span><a name="l00065"></a>00065 <span class="comment"> /*! parameters: (ModulusSize) */</span><a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#571737380b956b4add10c855484af670">GenerateRandom</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &alg);<a name="l00067"></a>00067 <a name="l00068"></a><a class="code" href="class_invertible_rabin_function.html#52f57e827225090d46ce091bc5a8c95f">00068</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_invertible_rabin_function.html#52f57e827225090d46ce091bc5a8c95f">GetPrime1</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_invertible_rabin_function.html#7265f1577c7c60962100bf048c532b65">m_p</a>;}<a name="l00069"></a><a class="code" href="class_invertible_rabin_function.html#9b4823bee8b9f438f87cd7cfaa9057af">00069</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_invertible_rabin_function.html#9b4823bee8b9f438f87cd7cfaa9057af">GetPrime2</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_invertible_rabin_function.html#6f7f68cf7b9299b85da9df3241aa8096">m_q</a>;}<a name="l00070"></a><a class="code" href="class_invertible_rabin_function.html#ac153f609582d2cb6b7aecb0fc119c52">00070</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_invertible_rabin_function.html#ac153f609582d2cb6b7aecb0fc119c52">GetMultiplicativeInverseOfPrime2ModPrime1</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_invertible_rabin_function.html#39d937e65da2073ea867b8a93f8b25e7">m_u</a>;}<a name="l00071"></a>00071 <a name="l00072"></a><a class="code" href="class_invertible_rabin_function.html#3a89d8a8849e931881e88218fa386335">00072</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#3a89d8a8849e931881e88218fa386335">SetPrime1</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &p) {<a class="code" href="class_invertible_rabin_function.html#7265f1577c7c60962100bf048c532b65">m_p</a> = p;}<a name="l00073"></a><a class="code" href="class_invertible_rabin_function.html#cd5b2db35c82d1005b3c7aa45417f495">00073</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#cd5b2db35c82d1005b3c7aa45417f495">SetPrime2</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &q) {<a class="code" href="class_invertible_rabin_function.html#6f7f68cf7b9299b85da9df3241aa8096">m_q</a> = q;}<a name="l00074"></a><a class="code" href="class_invertible_rabin_function.html#0690a524ac386cac8a69dcbb02292a44">00074</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_rabin_function.html#0690a524ac386cac8a69dcbb02292a44">SetMultiplicativeInverseOfPrime2ModPrime1</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &u) {<a class="code" href="class_invertible_rabin_function.html#39d937e65da2073ea867b8a93f8b25e7">m_u</a> = u;}<a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keyword">protected</span>:<a name="l00077"></a><a class="code" href="class_invertible_rabin_function.html#39d937e65da2073ea867b8a93f8b25e7">00077</a> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_invertible_rabin_function.html#7265f1577c7c60962100bf048c532b65">m_p</a>, <a class="code" href="class_invertible_rabin_function.html#6f7f68cf7b9299b85da9df3241aa8096">m_q</a>, <a class="code" href="class_invertible_rabin_function.html#39d937e65da2073ea867b8a93f8b25e7">m_u</a>;<a name="l00078"></a>00078 };<a name="l00079"></a>00079 <span class="comment"></span><a name="l00080"></a>00080 <span class="comment">//! Rabin</span><a name="l00081"></a><a class="code" href="struct_rabin.html">00081</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_rabin.html" title="Rabin.">Rabin</a><a name="l00082"></a>00082 {<a name="l00083"></a><a class="code" href="struct_rabin.html#7da814788fe2bc6f5d9c6c1db9537271">00083</a> <span class="keyword">static</span> std::string <a class="code" href="struct_rabin.html#7da814788fe2bc6f5d9c6c1db9537271">StaticAlgorithmName</a>() {<span class="keywordflow">return</span> <span class="stringliteral">"Rabin-Crypto++Variant"</span>;}<a name="l00084"></a><a class="code" href="struct_rabin.html#4b84a017e3f14bdc59b9333667008bd9">00084</a> <span class="keyword">typedef</span> <a class="code" href="class_rabin_function.html" title="_">RabinFunction</a> <a class="code" href="class_rabin_function.html" title="_">PublicKey</a>;<a name="l00085"></a><a class="code" href="struct_rabin.html#242457b3f0d9b07ca2cd32bf008e262e">00085</a> <span class="keyword">typedef</span> <a class="code" href="class_invertible_rabin_function.html" title="_">InvertibleRabinFunction</a> <a class="code" href="class_invertible_rabin_function.html" title="_">PrivateKey</a>;<a name="l00086"></a>00086 };<a name="l00087"></a>00087 <span class="comment"></span><a name="l00088"></a>00088 <span class="comment">//! Rabin encryption</span><a name="l00089"></a>00089 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> STANDARD><a name="l00090"></a><a class="code" href="struct_rabin_e_s.html">00090</a> <span class="keyword">struct </span><a class="code" href="struct_rabin_e_s.html" title="Rabin encryption.">RabinES</a> : <span class="keyword">public</span> <a class="code" href="class_t_f___e_s.html" title="Trapdoor Function Based Encryption Scheme.">TF_ES</a><STANDARD, Rabin><a name="l00091"></a>00091 {<a name="l00092"></a>00092 };<a name="l00093"></a>00093 <span class="comment"></span><a name="l00094"></a>00094 <span class="comment">//! Rabin signature</span><a name="l00095"></a>00095 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> STANDARD, <span class="keyword">class</span> H><a name="l00096"></a><a class="code" href="struct_rabin_s_s.html">00096</a> <span class="keyword">struct </span><a class="code" href="struct_rabin_s_s.html" title="Rabin signature.">RabinSS</a> : <span class="keyword">public</span> <a class="code" href="class_t_f___s_s.html" title="Trapdoor Function Based Signature Scheme.">TF_SS</a><STANDARD, H, Rabin><a name="l00097"></a>00097 {<a name="l00098"></a>00098 };<a name="l00099"></a>00099 <a name="l00100"></a>00100 <span class="comment">// More typedefs for backwards compatibility</span><a name="l00101"></a><a class="code" href="rabin_8h.html#f96a557628c1e1d8c5e6d0ee9d7f4147">00101</a> <span class="keyword">class </span><a class="code" href="class_s_h_a1.html" title="SHA-1">SHA1</a>;<a name="l00102"></a>00102 <span class="keyword">typedef</span> <a class="code" href="struct_rabin_e_s.html" title="Rabin encryption.">RabinES<OAEP<SHA1></a> >::Decryptor <a class="code" href="class_p_k___final_template.html" title="A template implementing constructors for public key algorithm classes.">RabinDecryptor</a>;<a name="l00103"></a><a class="code" href="rabin_8h.html#b74ebaa9cbe0e2072def356429111545">00103</a> <span class="keyword">typedef</span> <a class="code" href="struct_rabin_e_s.html" title="Rabin encryption.">RabinES<OAEP<SHA1></a> >::Encryptor <a class="code" href="class_p_k___final_template.html" title="A template implementing constructors for public key algorithm classes.">RabinEncryptor</a>;<a name="l00104"></a>00104 <a name="l00105"></a>00105 NAMESPACE_END<a name="l00106"></a>00106 <a name="l00107"></a>00107 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:23 2007 for Crypto++ by <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 + -