<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>PolarSSL: polarssl/rsa.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.7.4 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">PolarSSL</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li id="searchli"> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">polarssl/rsa.h</div> </div> </div> <div class="contents"> <a href="rsa_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00025"></a>00025 <span class="preprocessor">#ifndef POLARSSL_RSA_H</span> <a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_RSA_H</span> <a name="l00027"></a>00027 <span class="preprocessor"></span> <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="bignum_8h.html">polarssl/bignum.h</a>"</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="comment">/*</span> <a name="l00031"></a>00031 <span class="comment"> * RSA Error codes</span> <a name="l00032"></a>00032 <span class="comment"> */</span> <a name="l00033"></a>00033 <span class="preprocessor">#define POLARSSL_ERR_RSA_BAD_INPUT_DATA -0x0400</span> <a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_INVALID_PADDING -0x0410</span> <a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_KEY_GEN_FAILED -0x0420</span> <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED -0x0430</span> <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_PUBLIC_FAILED -0x0440</span> <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_PRIVATE_FAILED -0x0450</span> <a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_VERIFY_FAILED -0x0460</span> <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE -0x0470</span> <a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define POLARSSL_ERR_RSA_RNG_FAILED -0x0480</span> <a name="l00042"></a>00042 <span class="preprocessor"></span> <a name="l00043"></a>00043 <span class="comment">/*</span> <a name="l00044"></a>00044 <span class="comment"> * PKCS#1 constants</span> <a name="l00045"></a>00045 <span class="comment"> */</span> <a name="l00046"></a>00046 <span class="preprocessor">#define SIG_RSA_RAW 0</span> <a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_MD2 2</span> <a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_MD4 3</span> <a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_MD5 4</span> <a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_SHA1 5</span> <a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_SHA224 14</span> <a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_SHA256 11</span> <a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_SHA384 12</span> <a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define SIG_RSA_SHA512 13</span> <a name="l00055"></a>00055 <span class="preprocessor"></span> <a name="l00056"></a>00056 <span class="preprocessor">#define RSA_PUBLIC 0</span> <a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define RSA_PRIVATE 1</span> <a name="l00058"></a>00058 <span class="preprocessor"></span> <a name="l00059"></a>00059 <span class="preprocessor">#define RSA_PKCS_V15 0</span> <a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define RSA_PKCS_V21 1</span> <a name="l00061"></a>00061 <span class="preprocessor"></span> <a name="l00062"></a>00062 <span class="preprocessor">#define RSA_SIGN 1</span> <a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define RSA_CRYPT 2</span> <a name="l00064"></a>00064 <span class="preprocessor"></span> <a name="l00065"></a>00065 <span class="preprocessor">#define ASN1_STR_CONSTRUCTED_SEQUENCE "\x30"</span> <a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define ASN1_STR_NULL "\x05"</span> <a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define ASN1_STR_OID "\x06"</span> <a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#define ASN1_STR_OCTET_STRING "\x04"</span> <a name="l00069"></a>00069 <span class="preprocessor"></span> <a name="l00070"></a>00070 <span class="preprocessor">#define OID_DIGEST_ALG_MDX "\x2A\x86\x48\x86\xF7\x0D\x02\x00"</span> <a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define OID_HASH_ALG_SHA1 "\x2b\x0e\x03\x02\x1a"</span> <a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define OID_HASH_ALG_SHA2X "\x60\x86\x48\x01\x65\x03\x04\x02\x00"</span> <a name="l00073"></a>00073 <span class="preprocessor"></span> <a name="l00074"></a>00074 <span class="preprocessor">#define OID_ISO_MEMBER_BODIES "\x2a"</span> <a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define OID_ISO_IDENTIFIED_ORG "\x2b"</span> <a name="l00076"></a>00076 <span class="preprocessor"></span> <a name="l00077"></a>00077 <span class="comment">/*</span> <a name="l00078"></a>00078 <span class="comment"> * ISO Member bodies OID parts</span> <a name="l00079"></a>00079 <span class="comment"> */</span> <a name="l00080"></a>00080 <span class="preprocessor">#define OID_COUNTRY_US "\x86\x48"</span> <a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define OID_RSA_DATA_SECURITY "\x86\xf7\x0d"</span> <a name="l00082"></a>00082 <span class="preprocessor"></span> <a name="l00083"></a>00083 <span class="comment">/*</span> <a name="l00084"></a>00084 <span class="comment"> * ISO Identified organization OID parts</span> <a name="l00085"></a>00085 <span class="comment"> */</span> <a name="l00086"></a>00086 <span class="preprocessor">#define OID_OIW_SECSIG_SHA1 "\x0e\x03\x02\x1a"</span> <a name="l00087"></a>00087 <span class="preprocessor"></span> <a name="l00088"></a>00088 <span class="comment">/*</span> <a name="l00089"></a>00089 <span class="comment"> * DigestInfo ::= SEQUENCE {</span> <a name="l00090"></a>00090 <span class="comment"> * digestAlgorithm DigestAlgorithmIdentifier,</span> <a name="l00091"></a>00091 <span class="comment"> * digest Digest }</span> <a name="l00092"></a>00092 <span class="comment"> *</span> <a name="l00093"></a>00093 <span class="comment"> * DigestAlgorithmIdentifier ::= AlgorithmIdentifier</span> <a name="l00094"></a>00094 <span class="comment"> *</span> <a name="l00095"></a>00095 <span class="comment"> * Digest ::= OCTET STRING</span> <a name="l00096"></a>00096 <span class="comment"> */</span> <a name="l00097"></a>00097 <span class="preprocessor">#define ASN1_HASH_MDX \</span> <a name="l00098"></a>00098 <span class="preprocessor">( \</span> <a name="l00099"></a>00099 <span class="preprocessor"> ASN1_STR_CONSTRUCTED_SEQUENCE "\x20" \</span> <a name="l00100"></a>00100 <span class="preprocessor"> ASN1_STR_CONSTRUCTED_SEQUENCE "\x0C" \</span> <a name="l00101"></a>00101 <span class="preprocessor"> ASN1_STR_OID "\x08" \</span> <a name="l00102"></a>00102 <span class="preprocessor"> OID_DIGEST_ALG_MDX \</span> <a name="l00103"></a>00103 <span class="preprocessor"> ASN1_STR_NULL "\x00" \</span> <a name="l00104"></a>00104 <span class="preprocessor"> ASN1_STR_OCTET_STRING "\x10" \</span> <a name="l00105"></a>00105 <span class="preprocessor">)</span> <a name="l00106"></a>00106 <span class="preprocessor"></span> <a name="l00107"></a>00107 <span class="preprocessor">#define ASN1_HASH_SHA1 \</span> <a name="l00108"></a>00108 <span class="preprocessor"> ASN1_STR_CONSTRUCTED_SEQUENCE "\x21" \</span> <a name="l00109"></a>00109 <span class="preprocessor"> ASN1_STR_CONSTRUCTED_SEQUENCE "\x09" \</span> <a name="l00110"></a>00110 <span class="preprocessor"> ASN1_STR_OID "\x05" \</span> <a name="l00111"></a>00111 <span class="preprocessor"> OID_HASH_ALG_SHA1 \</span> <a name="l00112"></a>00112 <span class="preprocessor"> ASN1_STR_NULL "\x00" \</span> <a name="l00113"></a>00113 <span class="preprocessor"> ASN1_STR_OCTET_STRING "\x14"</span> <a name="l00114"></a>00114 <span class="preprocessor"></span> <a name="l00115"></a>00115 <span class="preprocessor">#define ASN1_HASH_SHA2X \</span> <a name="l00116"></a>00116 <span class="preprocessor"> ASN1_STR_CONSTRUCTED_SEQUENCE "\x11" \</span> <a name="l00117"></a>00117 <span class="preprocessor"> ASN1_STR_CONSTRUCTED_SEQUENCE "\x0d" \</span> <a name="l00118"></a>00118 <span class="preprocessor"> ASN1_STR_OID "\x09" \</span> <a name="l00119"></a>00119 <span class="preprocessor"> OID_HASH_ALG_SHA2X \</span> <a name="l00120"></a>00120 <span class="preprocessor"> ASN1_STR_NULL "\x00" \</span> <a name="l00121"></a>00121 <span class="preprocessor"> ASN1_STR_OCTET_STRING "\x00"</span> <a name="l00122"></a>00122 <span class="preprocessor"></span> <a name="l00126"></a><a class="code" href="structrsa__context.html">00126</a> <span class="keyword">typedef</span> <span class="keyword">struct</span> <a name="l00127"></a>00127 { <a name="l00128"></a><a class="code" href="structrsa__context.html#aa5db43b7b8614eb7233ce57aa2031d40">00128</a> <span class="keywordtype">int</span> <a class="code" href="structrsa__context.html#aa5db43b7b8614eb7233ce57aa2031d40">ver</a>; <a name="l00129"></a><a class="code" href="structrsa__context.html#ad7cfe15a30f515633ad3172a9720b220">00129</a> <span class="keywordtype">int</span> <a class="code" href="structrsa__context.html#ad7cfe15a30f515633ad3172a9720b220">len</a>; <a name="l00131"></a><a class="code" href="structrsa__context.html#a2f44f168531d8470e7831fd49aea9ae0">00131</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a2f44f168531d8470e7831fd49aea9ae0">N</a>; <a name="l00132"></a><a class="code" href="structrsa__context.html#aa28db934350d34ac8537abb7ec8d519d">00132</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#aa28db934350d34ac8537abb7ec8d519d">E</a>; <a name="l00134"></a><a class="code" href="structrsa__context.html#af3078ae226d6b5aa335af77a6d46317e">00134</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#af3078ae226d6b5aa335af77a6d46317e">D</a>; <a name="l00135"></a><a class="code" href="structrsa__context.html#a352c64edb7488633ddbca88d1a9966c9">00135</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a352c64edb7488633ddbca88d1a9966c9">P</a>; <a name="l00136"></a><a class="code" href="structrsa__context.html#a94bb2c66e84581a0d854f1fc7f6672d8">00136</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a94bb2c66e84581a0d854f1fc7f6672d8">Q</a>; <a name="l00137"></a><a class="code" href="structrsa__context.html#ad3a4b21e847d540a9bf1b680f0c05880">00137</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#ad3a4b21e847d540a9bf1b680f0c05880">DP</a>; <a name="l00138"></a><a class="code" href="structrsa__context.html#a42fb604a95bea6fc9640715babb8d415">00138</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a42fb604a95bea6fc9640715babb8d415">DQ</a>; <a name="l00139"></a><a class="code" href="structrsa__context.html#a364bfb0ef6d240c39053f603ee1cbeca">00139</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a364bfb0ef6d240c39053f603ee1cbeca">QP</a>; <a name="l00141"></a><a class="code" href="structrsa__context.html#a9d76414e85030ddf011b24d8a8bc4f9f">00141</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a9d76414e85030ddf011b24d8a8bc4f9f">RN</a>; <a name="l00142"></a><a class="code" href="structrsa__context.html#ad00a9b5de055f5cf9d109dd4382b3105">00142</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#ad00a9b5de055f5cf9d109dd4382b3105">RP</a>; <a name="l00143"></a><a class="code" href="structrsa__context.html#a286dcd56958215be3d8e6195456952a2">00143</a> <a class="code" href="structmpi.html" title="MPI structure.">mpi</a> <a class="code" href="structrsa__context.html#a286dcd56958215be3d8e6195456952a2">RQ</a>; <a name="l00145"></a><a class="code" href="structrsa__context.html#ac2599f716413534b2925670d5523c6bf">00145</a> <span class="keywordtype">int</span> <a class="code" href="structrsa__context.html#ac2599f716413534b2925670d5523c6bf">padding</a>; <a name="l00146"></a><a class="code" href="structrsa__context.html#a735bfa601f5fe16e563da0cab79fdb7b">00146</a> <span class="keywordtype">int</span> <a class="code" href="structrsa__context.html#a735bfa601f5fe16e563da0cab79fdb7b">hash_id</a>; <a name="l00147"></a>00147 } <a name="l00148"></a>00148 <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a>; <a name="l00149"></a>00149 <a name="l00150"></a>00150 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00151"></a>00151 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00152"></a>00152 <span class="preprocessor">#endif</span> <a name="l00153"></a>00153 <span class="preprocessor"></span> <a name="l00167"></a>00167 <span class="keywordtype">void</span> <a class="code" href="rsa_8h.html#a79875c9f9d5831aecf5ea095905a5b64" title="Initialize an RSA context.">rsa_init</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00168"></a>00168 <span class="keywordtype">int</span> padding, <a name="l00169"></a>00169 <span class="keywordtype">int</span> hash_id); <a name="l00170"></a>00170 <a name="l00185"></a>00185 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a6d0bb4ec8c16e181065e4664f6dbd3ee" title="Generate an RSA keypair.">rsa_gen_key</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00186"></a>00186 <span class="keywordtype">int</span> (*f_rng)(<span class="keywordtype">void</span> *), <a name="l00187"></a>00187 <span class="keywordtype">void</span> *p_rng, <a name="l00188"></a>00188 <span class="keywordtype">int</span> nbits, <span class="keywordtype">int</span> exponent ); <a name="l00189"></a>00189 <a name="l00197"></a>00197 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#ae8208f2c3741564581ec745b27524c45" title="Check a public RSA key.">rsa_check_pubkey</a>( <span class="keyword">const</span> <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx ); <a name="l00198"></a>00198 <a name="l00206"></a>00206 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a0fe904ec611cd6b53c72b7308f3ed3db" title="Check a private RSA key.">rsa_check_privkey</a>( <span class="keyword">const</span> <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx ); <a name="l00207"></a>00207 <a name="l00224"></a>00224 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a29709d2f3d05d833b28081b743f9815f" title="Do an RSA public key operation.">rsa_public</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00225"></a>00225 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *input, <a name="l00226"></a>00226 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output ); <a name="l00227"></a>00227 <a name="l00240"></a>00240 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a14b35bc11521151b55a28f64d39cd776" title="Do an RSA private key operation.">rsa_private</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00241"></a>00241 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *input, <a name="l00242"></a>00242 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output ); <a name="l00243"></a>00243 <a name="l00260"></a>00260 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#acf422a8f269e001804d2bbcb78a25c64" title="Add the message padding, then do an RSA operation.">rsa_pkcs1_encrypt</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00261"></a>00261 <span class="keywordtype">int</span> (*f_rng)(<span class="keywordtype">void</span> *), <a name="l00262"></a>00262 <span class="keywordtype">void</span> *p_rng, <a name="l00263"></a>00263 <span class="keywordtype">int</span> mode, <span class="keywordtype">int</span> ilen, <a name="l00264"></a>00264 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *input, <a name="l00265"></a>00265 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output ); <a name="l00266"></a>00266 <a name="l00283"></a>00283 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a912c26404661e52922076f21a558fc2b" title="Do an RSA operation, then remove the message padding.">rsa_pkcs1_decrypt</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00284"></a>00284 <span class="keywordtype">int</span> mode, <span class="keywordtype">int</span> *olen, <a name="l00285"></a>00285 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *input, <a name="l00286"></a>00286 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output, <a name="l00287"></a>00287 <span class="keywordtype">int</span> output_max_len ); <a name="l00288"></a>00288 <a name="l00305"></a>00305 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#af4e36c6b80f03e668505d2892e570c5b" title="Do a private RSA to sign a message digest.">rsa_pkcs1_sign</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00306"></a>00306 <span class="keywordtype">int</span> mode, <a name="l00307"></a>00307 <span class="keywordtype">int</span> hash_id, <a name="l00308"></a>00308 <span class="keywordtype">int</span> hashlen, <a name="l00309"></a>00309 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *hash, <a name="l00310"></a>00310 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *sig ); <a name="l00311"></a>00311 <a name="l00328"></a>00328 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a0d205476542d3a06558ffecfab4340eb" title="Do a public RSA and check the message digest.">rsa_pkcs1_verify</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx, <a name="l00329"></a>00329 <span class="keywordtype">int</span> mode, <a name="l00330"></a>00330 <span class="keywordtype">int</span> hash_id, <a name="l00331"></a>00331 <span class="keywordtype">int</span> hashlen, <a name="l00332"></a>00332 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *hash, <a name="l00333"></a>00333 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *sig ); <a name="l00334"></a>00334 <a name="l00340"></a>00340 <span class="keywordtype">void</span> <a class="code" href="rsa_8h.html#abb5d26b09e183c8a885eaee270c38fc7" title="Free the components of an RSA key.">rsa_free</a>( <a class="code" href="structrsa__context.html" title="RSA context structure.">rsa_context</a> *ctx ); <a name="l00341"></a>00341 <a name="l00347"></a>00347 <span class="keywordtype">int</span> <a class="code" href="rsa_8h.html#a118d1ea38ffeaef3ebfdfb418d2c42dd" title="Checkup routine.">rsa_self_test</a>( <span class="keywordtype">int</span> verbose ); <a name="l00348"></a>00348 <a name="l00349"></a>00349 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00350"></a>00350 <span class="preprocessor"></span>} <a name="l00351"></a>00351 <span class="preprocessor">#endif</span> <a name="l00352"></a>00352 <span class="preprocessor"></span> <a name="l00353"></a>00353 <span class="preprocessor">#endif </span><span class="comment">/* rsa.h */</span> </pre></div></div> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address class="footer"><small>Generated on Mon May 16 2011 for PolarSSL by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>