Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 9601c7beb4ff23e834bfa171795ed560 > files > 677

vidalia-0.2.9-1mdv2010.1.i586.rpm

<!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>Vidalia: crypto.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <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="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</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>
  <div class="navpath"><a class="el" href="dir_b47abd1aad201a152869566145babb61.html">src</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_3459d97d61361c9d41d467fba45f9c61.html">common</a>
  </div>
</div>
<div class="contents">
<h1>crypto.h File Reference</h1><code>#include &lt;QByteArray&gt;</code><br/>
<code>#include &lt;QString&gt;</code><br/>

<p><a href="crypto_8h_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QByteArray&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#af199e3bfee1379c8a84f61681e41526c">crypto_rand_bytes</a> (int len)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">quint32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#a52d18a5e7e38f96cfc2a1c9cbcbf2e6c">crypto_rand_quint32</a> (quint32 max)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ad16013efda05090adfc906af39e91b41">crypto_rand_string</a> (int len)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QByteArray&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="crypto_8h.html#ac51151077f12ea463acd49abe58870a2">crypto_secret_to_key</a> (const QString &amp;secret, const QByteArray &amp;salt, quint8 c)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="af199e3bfee1379c8a84f61681e41526c"></a><!-- doxytag: member="crypto.h::crypto_rand_bytes" ref="af199e3bfee1379c8a84f61681e41526c" args="(int len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QByteArray crypto_rand_bytes </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>len</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <b>len</b> bytes of pseudorandom data on success, or an empty QByteArray on failure. This function is based on crypto_seed_rng() from Tor's crypto.c. See LICENSE for details on Tor's license.</p>
<p>Returns up to <b>len</b> bytes of pseudorandom data on success, or an empty QByteArray on failure. The caller should verify that the returned QByteArray contains the requested number of bytes. This function is based on crypto_seed_rng() from Tor's crypto.c. See LICENSE for details on Tor's license. </p>

<p>Definition at line <a class="el" href="crypto_8cpp_source.html#l00072">72</a> of file <a class="el" href="crypto_8cpp_source.html">crypto.cpp</a>.</p>

<p>Referenced by <a class="el" href="crypto_8cpp_source.html#l00129">crypto_rand_quint32()</a>, and <a class="el" href="_tor_settings_8cpp_source.html#l00365">TorSettings::hashPassword()</a>.</p>

</div>
</div>
<a class="anchor" id="a52d18a5e7e38f96cfc2a1c9cbcbf2e6c"></a><!-- doxytag: member="crypto.h::crypto_rand_quint32" ref="a52d18a5e7e38f96cfc2a1c9cbcbf2e6c" args="(quint32 max)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">quint32 crypto_rand_quint32 </td>
          <td>(</td>
          <td class="paramtype">quint32&nbsp;</td>
          <td class="paramname"> <em>max</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a pseudorandom integer, chosen uniformly from the the values in the range [0, max). This function is based on crypto_rand_int() from Tor's crypto.c. See LICENSE for details on Tor's license. </p>

<p>Definition at line <a class="el" href="crypto_8cpp_source.html#l00129">129</a> of file <a class="el" href="crypto_8cpp_source.html">crypto.cpp</a>.</p>

<p>References <a class="el" href="crypto_8cpp_source.html#l00072">crypto_rand_bytes()</a>.</p>

<p>Referenced by <a class="el" href="crypto_8cpp_source.html#l00151">crypto_rand_string()</a>.</p>

</div>
</div>
<a class="anchor" id="ad16013efda05090adfc906af39e91b41"></a><!-- doxytag: member="crypto.h::crypto_rand_string" ref="ad16013efda05090adfc906af39e91b41" args="(int len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QString crypto_rand_string </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>len</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Generates a pseudorandom string of length <b>len</b> containing printable ASCII characters from the range '!' (0x21) to '~' (0x7e). </p>

<p>Definition at line <a class="el" href="crypto_8cpp_source.html#l00151">151</a> of file <a class="el" href="crypto_8cpp_source.html">crypto.cpp</a>.</p>

<p>References <a class="el" href="crypto_8cpp_source.html#l00129">crypto_rand_quint32()</a>, and <a class="el" href="html_8cpp_source.html#l00033">i()</a>.</p>

<p>Referenced by <a class="el" href="_tor_settings_8cpp_source.html#l00357">TorSettings::randomPassword()</a>.</p>

</div>
</div>
<a class="anchor" id="ac51151077f12ea463acd49abe58870a2"></a><!-- doxytag: member="crypto.h::crypto_secret_to_key" ref="ac51151077f12ea463acd49abe58870a2" args="(const QString &amp;secret, const QByteArray &amp;salt, quint8 c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QByteArray crypto_secret_to_key </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&nbsp;</td>
          <td class="paramname"> <em>secret</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QByteArray &amp;&nbsp;</td>
          <td class="paramname"> <em>salt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">quint8&nbsp;</td>
          <td class="paramname"> <em>c</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Generates a salted hash of <b>secret</b> using the random <b>salt</b> according to the iterated and salted S2K algorithm in RFC 2440. <b>c</b> is the one-octet coded count value that specifies how much data to hash. <b>salt</b> must contain at least 8 bytes, otherwise this method will return a default-constructed QByteArray. </p>

<p>Definition at line <a class="el" href="crypto_8cpp_source.html#l00167">167</a> of file <a class="el" href="crypto_8cpp_source.html">crypto.cpp</a>.</p>

<p>References <a class="el" href="crypto_8cpp.html#a39676b4d6d931bd28997b56f54f2c104">EXPBIAS</a>.</p>

<p>Referenced by <a class="el" href="_tor_settings_8cpp_source.html#l00365">TorSettings::hashPassword()</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:55 2010 for Vidalia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>