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

📄 pubkey_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00065"></a>00065 };<a name="l00066"></a>00066 <span class="comment"></span><a name="l00067"></a>00067 <span class="comment">//! _</span><a name="l00068"></a><a class="code" href="class_trapdoor_function.html">00068</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunction : <span class="keyword">public</span> <a class="code" href="class_randomized_trapdoor_function.html" title="_">RandomizedTrapdoorFunction</a><a name="l00069"></a>00069 {<a name="l00070"></a>00070 <span class="keyword">public</span>:<a name="l00071"></a><a class="code" href="class_trapdoor_function.html#132d71605a286f12b5167a0c3f18ffdf">00071</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> ApplyRandomizedFunction(<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="l00072"></a>00072 <span class="keyword">                </span>{<span class="keywordflow">return</span> ApplyFunction(x);}<a name="l00073"></a><a class="code" href="class_trapdoor_function.html#253eb5db8020326f869a4580e21bf5d8">00073</a>         <span class="keywordtype">bool</span> <a class="code" href="class_randomized_trapdoor_function.html#f5fcf44d157a391ccf4ae61c9940e95a">IsRandomized</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;}<a name="l00074"></a>00074 <a name="l00075"></a>00075         <span class="keyword">virtual</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> ApplyFunction(<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> =0;<a name="l00076"></a>00076 };<a name="l00077"></a>00077 <span class="comment"></span><a name="l00078"></a>00078 <span class="comment">//! _</span><a name="l00079"></a><a class="code" href="class_randomized_trapdoor_function_inverse.html">00079</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunctionInverse<a name="l00080"></a>00080 {<a name="l00081"></a>00081 <span class="keyword">public</span>:<a name="l00082"></a><a class="code" href="class_randomized_trapdoor_function_inverse.html#eada68bff06be69868303824880b67fb">00082</a>         <span class="keyword">virtual</span> ~RandomizedTrapdoorFunctionInverse() {}<a name="l00083"></a>00083 <a name="l00084"></a>00084         <span class="keyword">virtual</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> CalculateRandomizedInverse(<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> =0;<a name="l00085"></a><a class="code" href="class_randomized_trapdoor_function_inverse.html#c37368328021acf2d48d6aa9f6cb71c9">00085</a>         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> IsRandomized()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}<a name="l00086"></a>00086 };<a name="l00087"></a>00087 <span class="comment"></span><a name="l00088"></a>00088 <span class="comment">//! _</span><a name="l00089"></a><a class="code" href="class_trapdoor_function_inverse.html">00089</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionInverse : <span class="keyword">public</span> RandomizedTrapdoorFunctionInverse<a name="l00090"></a>00090 {<a name="l00091"></a>00091 <span class="keyword">public</span>:<a name="l00092"></a><a class="code" href="class_trapdoor_function_inverse.html#ca0073a6f99b0bed771eef5a4a83a4e2">00092</a>         <span class="keyword">virtual</span> ~TrapdoorFunctionInverse() {}<a name="l00093"></a>00093 <a name="l00094"></a><a class="code" href="class_trapdoor_function_inverse.html#676ce8748a1fbdde3cdeaa9d5e2a1c41">00094</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> CalculateRandomizedInverse(<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="l00095"></a>00095 <span class="keyword">                </span>{<span class="keywordflow">return</span> CalculateInverse(rng, x);}<a name="l00096"></a><a class="code" href="class_trapdoor_function_inverse.html#9b2cad45cb51609e3caedfa7bb44594e">00096</a>         <span class="keywordtype">bool</span> <a class="code" href="class_randomized_trapdoor_function_inverse.html#c37368328021acf2d48d6aa9f6cb71c9">IsRandomized</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;}<a name="l00097"></a>00097 <a name="l00098"></a>00098         <span class="keyword">virtual</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> CalculateInverse(<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> =0;<a name="l00099"></a>00099 };<a name="l00100"></a>00100 <a name="l00101"></a>00101 <span class="comment">// ********************************************************</span><a name="l00102"></a>00102 <span class="comment"></span><a name="l00103"></a>00103 <span class="comment">//! message encoding method for public key encryption</span><a name="l00104"></a><a class="code" href="class_p_k___encryption_message_encoding_method.html">00104</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_NO_VTABLE <a class="code" href="class_p_k___encryption_message_encoding_method.html" title="message encoding method for public key encryption">PK_EncryptionMessageEncodingMethod</a><a name="l00105"></a>00105 {<a name="l00106"></a>00106 <span class="keyword">public</span>:<a name="l00107"></a><a class="code" href="class_p_k___encryption_message_encoding_method.html#7fef18ea963b320120cfa275b4b90581">00107</a>         <span class="keyword">virtual</span> ~<a class="code" href="class_p_k___encryption_message_encoding_method.html" title="message encoding method for public key encryption">PK_EncryptionMessageEncodingMethod</a>() {}<a name="l00108"></a>00108 <a name="l00109"></a><a class="code" href="class_p_k___encryption_message_encoding_method.html#1225525a5023cd6a3f1bd1292bfa5559">00109</a>         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> ParameterSupported(<span class="keyword">const</span> <span class="keywordtype">char</span> *name)<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;}<a name="l00110"></a>00110 <span class="comment"></span><a name="l00111"></a>00111 <span class="comment">        //! max size of unpadded message in bytes, given max size of padded message in bits (1 less than size of modulus)</span><a name="l00112"></a>00112 <span class="comment"></span>        <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> MaxUnpaddedLength(<span class="keywordtype">size_t</span> paddedLength) <span class="keyword">const</span> =0;<a name="l00113"></a>00113 <a name="l00114"></a>00114         <span class="keyword">virtual</span> <span class="keywordtype">void</span> Pad(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> byte *raw, <span class="keywordtype">size_t</span> inputLength, byte *padded, <span class="keywordtype">size_t</span> paddedBitLength, <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;parameters) <span class="keyword">const</span> =0;<a name="l00115"></a>00115 <a name="l00116"></a>00116         <span class="keyword">virtual</span> <a class="code" href="struct_decoding_result.html" title="used to return decoding results">DecodingResult</a> Unpad(<span class="keyword">const</span> byte *padded, <span class="keywordtype">size_t</span> paddedBitLength, byte *raw, <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;parameters) <span class="keyword">const</span> =0;<a name="l00117"></a>00117 };<a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="comment">// ********************************************************</span><a name="l00120"></a>00120 <span class="comment"></span><a name="l00121"></a>00121 <span class="comment">//! _</span><a name="l00122"></a>00122 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> TFI, <span class="keyword">class</span> MEI&gt;<a name="l00123"></a><a class="code" href="class_t_f___base.html">00123</a> <span class="keyword">class </span>CRYPTOPP_NO_VTABLE TF_Base<a name="l00124"></a>00124 {<a name="l00125"></a>00125 <span class="keyword">protected</span>:<a name="l00126"></a>00126         <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="class_trapdoor_function_bounds.html" title="_">TrapdoorFunctionBounds</a> &amp; GetTrapdoorFunctionBounds() <span class="keyword">const</span> =0;<a name="l00127"></a>00127 <a name="l00128"></a><a class="code" href="class_t_f___base.html#33e2d6c0fbb715a5255edd5e84a849fb">00128</a>         <span class="keyword">typedef</span> TFI <a class="code" href="class_trapdoor_function.html" title="_">TrapdoorFunctionInterface</a>;<a name="l00129"></a>00129         <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="class_trapdoor_function.html" title="_">TrapdoorFunctionInterface</a> &amp; GetTrapdoorFunctionInterface() <span class="keyword">const</span> =0;<a name="l00130"></a>00130 <a name="l00131"></a><a class="code" href="class_t_f___base.html#06b4d20aa32c616a1d0d2b8bee909436">00131</a>         <span class="keyword">typedef</span> MEI <a class="code" href="class_p_k___signature_message_encoding_method.html" title="interface for message encoding method for public key signature schemes">MessageEncodingInterface</a>;<a name="l00132"></a>00132         <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="class_p_k___signature_message_encoding_method.html" title="interface for message encoding method for public key signature schemes">MessageEncodingInterface</a> &amp; GetMessageEncodingInterface() <span class="keyword">const</span> =0;<a name="l00133"></a>00133 };<a name="l00134"></a>00134 <a name="l00135"></a>00135 <span class="comment">// ********************************************************</span><a name="l00136"></a>00136 <span class="comment"></span><a name="l00137"></a>00137 <span class="comment">//! _</span><a name="l00138"></a>00138 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> BASE&gt;<a name="l00139"></a><a class="code" href="class_p_k___fixed_length_crypto_system_impl.html">00139</a> <span class="keyword">class </span>CRYPTOPP_NO_VTABLE PK_FixedLengthCryptoSystemImpl : <span class="keyword">public</span> BASE<a name="l00140"></a>00140 {<a name="l00141"></a>00141 <span class="keyword">public</span>:<a name="l00142"></a><a class="code" href="class_p_k___fixed_length_crypto_system_impl.html#a458766069b12b977e7483ab8dfbcba9">00142</a>         <span class="keywordtype">size_t</span> MaxPlaintextLength(<span class="keywordtype">size_t</span> ciphertextLength)<span class="keyword"> const</span><a name="l00143"></a>00143 <span class="keyword">                </span>{<span class="keywordflow">return</span> ciphertextLength == FixedCiphertextLength() ? FixedMaxPlaintextLength() : 0;}<a name="l00144"></a><a class="code" href="class_p_k___fixed_length_crypto_system_impl.html#4bdffbbeb046825f357331cbeb42956e">00144</a>         <span class="keywordtype">size_t</span> CiphertextLength(<span class="keywordtype">size_t</span> plaintextLength)<span class="keyword"> const</span><a name="l00145"></a>00145 <span class="keyword">                </span>{<span class="keywordflow">return</span> plaintextLength &lt;= FixedMaxPlaintextLength() ? FixedCiphertextLength() : 0;}<a name="l00146"></a>00146 <a name="l00147"></a>00147         <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> FixedMaxPlaintextLength() <span class="keyword">const</span> =0;<a name="l00148"></a>00148         <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> FixedCiphertextLength() <span class="keyword">const</span> =0;<a name="l00149"></a>00149 };

⌨️ 快捷键说明

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