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

📄 luc_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<a name="l00046"></a><a class="code" href="class_l_u_c_function.html#ede72346e848ed00fd5f772e849b1655">00046</a>         <span class="keywordtype">void</span> SetPublicExponent(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;e) {m_e = e;}<a name="l00047"></a>00047 <a name="l00048"></a>00048 <span class="keyword">protected</span>:<a name="l00049"></a><a class="code" href="class_l_u_c_function.html#41b10646a07c3aacb8a444f83d39019a">00049</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> m_n, m_e;<a name="l00050"></a>00050 };<a name="l00051"></a>00051 <span class="comment"></span><a name="l00052"></a>00052 <span class="comment">//! _</span><a name="l00053"></a><a class="code" href="class_invertible_l_u_c_function.html">00053</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_invertible_l_u_c_function.html" title="_">InvertibleLUCFunction</a> : <span class="keyword">public</span> <a class="code" href="class_l_u_c_function.html" title="The LUC function.">LUCFunction</a>, <span class="keyword">public</span> <a class="code" href="class_trapdoor_function_inverse.html" title="_">TrapdoorFunctionInverse</a>, <span class="keyword">public</span> <a class="code" href="class_private_key.html" title="interface for private keys">PrivateKey</a><a name="l00054"></a>00054 {<a name="l00055"></a>00055         <span class="keyword">typedef</span> <a class="code" href="class_invertible_l_u_c_function.html" title="_">InvertibleLUCFunction</a> <a class="code" href="class_l_u_c_function.html" title="The LUC function.">ThisClass</a>;<a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="keyword">public</span>:<a name="l00058"></a>00058         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#ed7fd0c49f5703c4f041d2f265fa2de8">Initialize</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> modulusBits, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;eStart=17);<a name="l00059"></a><a class="code" href="class_invertible_l_u_c_function.html#9e44c5b8fbd909c18d5422436c14a505">00059</a>         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#ed7fd0c49f5703c4f041d2f265fa2de8">Initialize</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;e, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;p, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;q, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;u)<a name="l00060"></a>00060                 {<a class="code" href="class_l_u_c_function.html#41b10646a07c3aacb8a444f83d39019a">m_n</a> = n; <a class="code" href="class_l_u_c_function.html#aa3b521dfa4f330a1334e1ba6673a178">m_e</a> = e; <a class="code" href="class_invertible_l_u_c_function.html#99df901efd56a9f49071744649f99539">m_p</a> = p; <a class="code" href="class_invertible_l_u_c_function.html#282ee27e938e471f89a66fe743189e75">m_q</a> = q; <a class="code" href="class_invertible_l_u_c_function.html#3ae87b160da160f48298ef7ec1d2451e">m_u</a> = u;}<a name="l00061"></a>00061 <a name="l00062"></a>00062         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#13ccaed129529b72b293c93e83ad726f">BERDecode</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt);<a name="l00063"></a>00063         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#e6da11b6ee13f6c12fd95592bdda95ad">DEREncode</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt) <span class="keyword">const</span>;<a name="l00064"></a>00064 <a name="l00065"></a>00065         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_invertible_l_u_c_function.html#0b8820769716f340ad154a428b53907e">CalculateInverse</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;x) <span class="keyword">const</span>;<a name="l00066"></a>00066 <a name="l00067"></a>00067         <span class="keywordtype">bool</span> <a class="code" href="class_invertible_l_u_c_function.html#b5c7b3d5b5d0b9509f8180a43370533b" 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> &amp;rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level) <span class="keyword">const</span>;<a name="l00068"></a>00068         <span class="keywordtype">bool</span> <a class="code" href="class_invertible_l_u_c_function.html#882c26c94e15ecb1added6f3fafae021" 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 &amp;valueType, <span class="keywordtype">void</span> *pValue) <span class="keyword">const</span>;<a name="l00069"></a>00069         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#aaef1b335de1f76ec61079d1dfd78744" 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> &amp;source);<span class="comment"></span><a name="l00070"></a>00070 <span class="comment">        /*! parameters: (ModulusSize, PublicExponent (default 17)) */</span><a name="l00071"></a>00071         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#f846ecc0f5e8d17267544920bc39f233">GenerateRandom</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;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> &amp;alg);<a name="l00072"></a>00072 <a name="l00073"></a>00073         <span class="comment">// non-derived interface</span><a name="l00074"></a><a class="code" href="class_invertible_l_u_c_function.html#40576b8bde24017e158371132716ba6f">00074</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_invertible_l_u_c_function.html#40576b8bde24017e158371132716ba6f">GetPrime1</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_invertible_l_u_c_function.html#99df901efd56a9f49071744649f99539">m_p</a>;}<a name="l00075"></a><a class="code" href="class_invertible_l_u_c_function.html#e9a6b2033c92d98e85a9328dd7edabbb">00075</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_invertible_l_u_c_function.html#e9a6b2033c92d98e85a9328dd7edabbb">GetPrime2</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_invertible_l_u_c_function.html#282ee27e938e471f89a66fe743189e75">m_q</a>;}<a name="l00076"></a><a class="code" href="class_invertible_l_u_c_function.html#6d6802e807d74ee4b2219f0f69e8b316">00076</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_invertible_l_u_c_function.html#6d6802e807d74ee4b2219f0f69e8b316">GetMultiplicativeInverseOfPrime2ModPrime1</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_invertible_l_u_c_function.html#3ae87b160da160f48298ef7ec1d2451e">m_u</a>;}<a name="l00077"></a>00077 <a name="l00078"></a><a class="code" href="class_invertible_l_u_c_function.html#98b3037426c19d022934cea5a93ba3be">00078</a>         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#98b3037426c19d022934cea5a93ba3be">SetPrime1</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;p) {<a class="code" href="class_invertible_l_u_c_function.html#99df901efd56a9f49071744649f99539">m_p</a> = p;}<a name="l00079"></a><a class="code" href="class_invertible_l_u_c_function.html#f70680742bda980a7c2f72d83a0b76fa">00079</a>         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#f70680742bda980a7c2f72d83a0b76fa">SetPrime2</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;q) {<a class="code" href="class_invertible_l_u_c_function.html#282ee27e938e471f89a66fe743189e75">m_q</a> = q;}<a name="l00080"></a><a class="code" href="class_invertible_l_u_c_function.html#e0590ceaebd839e8e1badd0d6f60a33a">00080</a>         <span class="keywordtype">void</span> <a class="code" href="class_invertible_l_u_c_function.html#e0590ceaebd839e8e1badd0d6f60a33a">SetMultiplicativeInverseOfPrime2ModPrime1</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;u) {<a class="code" href="class_invertible_l_u_c_function.html#3ae87b160da160f48298ef7ec1d2451e">m_u</a> = u;}<a name="l00081"></a>00081 <a name="l00082"></a>00082 <span class="keyword">protected</span>:<a name="l00083"></a><a class="code" href="class_invertible_l_u_c_function.html#3ae87b160da160f48298ef7ec1d2451e">00083</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_invertible_l_u_c_function.html#99df901efd56a9f49071744649f99539">m_p</a>, <a class="code" href="class_invertible_l_u_c_function.html#282ee27e938e471f89a66fe743189e75">m_q</a>, <a class="code" href="class_invertible_l_u_c_function.html#3ae87b160da160f48298ef7ec1d2451e">m_u</a>;<a name="l00084"></a>00084 };<a name="l00085"></a>00085 <a name="l00086"></a><a class="code" href="struct_l_u_c.html">00086</a> <span class="keyword">struct </span><a class="code" href="struct_l_u_c.html">LUC</a><a name="l00087"></a>00087 {<a name="l00088"></a><a class="code" href="struct_l_u_c.html#cd500e86ed4e72906f66fc424cb81a81">00088</a>         <span class="keyword">static</span> std::string <a class="code" href="struct_l_u_c.html#cd500e86ed4e72906f66fc424cb81a81">StaticAlgorithmName</a>() {<span class="keywordflow">return</span> <span class="stringliteral">"LUC"</span>;}<a name="l00089"></a><a class="code" href="struct_l_u_c.html#00c58dc85304fd8c2e9fe7294abf4061">00089</a>         <span class="keyword">typedef</span> <a class="code" href="class_l_u_c_function.html" title="The LUC function.">LUCFunction</a> <a class="code" href="class_l_u_c_function.html" title="The LUC function.">PublicKey</a>;<a name="l00090"></a><a class="code" href="struct_l_u_c.html#762ef7ddb96c7d9f52bcde021a67b9dd">00090</a>         <span class="keyword">typedef</span> <a class="code" href="class_invertible_l_u_c_function.html" title="_">InvertibleLUCFunction</a> <a class="code" href="class_invertible_l_u_c_function.html" title="_">PrivateKey</a>;<a name="l00091"></a>00091 };<a name="l00092"></a>00092 <span class="comment"></span><a name="l00093"></a>00093 <span class="comment">//! LUC cryptosystem</span><a name="l00094"></a>00094 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> STANDARD&gt;<a name="l00095"></a><a class="code" href="struct_l_u_c_e_s.html">00095</a> <span class="keyword">struct </span><a class="code" href="struct_l_u_c_e_s.html" title="LUC cryptosystem.">LUCES</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>&lt;STANDARD, LUC&gt;<a name="l00096"></a>00096 {<a name="l00097"></a>00097 };<a name="l00098"></a>00098 <span class="comment"></span><a name="l00099"></a>00099 <span class="comment">//! LUC signature scheme with appendix</span><a name="l00100"></a>00100 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> STANDARD, <span class="keyword">class</span> H&gt;<a name="l00101"></a><a class="code" href="struct_l_u_c_s_s.html">00101</a> <span class="keyword">struct </span><a class="code" href="struct_l_u_c_s_s.html" title="LUC signature scheme with appendix.">LUCSS</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>&lt;STANDARD, H, LUC&gt;<a name="l00102"></a>00102 {<a name="l00103"></a>00103 };<a name="l00104"></a>00104 <a name="l00105"></a>00105 <span class="comment">// analagous to the RSA schemes defined in PKCS #1 v2.0</span><a name="l00106"></a><a class="code" href="luc_8h.html#42df8fd94e8c1ce546b9f98bca62e285">00106</a> <span class="keyword">typedef</span> <a class="code" href="struct_l_u_c_e_s.html" title="LUC cryptosystem.">LUCES&lt;OAEP&lt;SHA&gt;</a> &gt;::Decryptor <a class="code" href="class_p_k___final_template.html" title="A template implementing constructors for public key algorithm classes.">LUCES_OAEP_SHA_Decryptor</a>;<a name="l00107"></a><a class="code" href="luc_8h.html#1e72cc190df2bc9fc836b48470aca2f3">00107</a> <span class="keyword">typedef</span> <a class="code" href="struct_l_u_c_e_s.html" title="LUC cryptosystem.">LUCES&lt;OAEP&lt;SHA&gt;</a> &gt;::Encryptor <a class="code" href="class_p_k___final_template.html" title="A template implementing constructors for public key algorithm classes.">LUCES_OAEP_SHA_Encryptor</a>;<a name="l00108"></a>00108 <a name="l00109"></a><a class="code" href="luc_8h.html#d72a50d14c2a3d491091a26cd79a5671">00109</a> <span class="keyword">typedef</span> <a class="code" href="struct_l_u_c_s_s.html" title="LUC signature scheme with appendix.">LUCSS&lt;PKCS1v15, SHA&gt;::Signer</a> <a class="code" href="class_p_k___final_template.html" title="A template implementing constructors for public key algorithm classes.">LUCSSA_PKCS1v15_SHA_Signer</a>;<a name="l00110"></a><a class="code" href="luc_8h.html#10ad7c43303744917d62b1ca6e9bbb20">00110</a> <span class="keyword">typedef</span> <a class="code" href="struct_l_u_c_s_s.html" title="LUC signature scheme with appendix.">LUCSS&lt;PKCS1v15, SHA&gt;::Verifier</a> <a class="code" href="class_p_k___final_template.html" title="A template implementing constructors for public key algorithm classes.">LUCSSA_PKCS1v15_SHA_Verifier</a>;<a name="l00111"></a>00111 

⌨️ 快捷键说明

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