aboutsummaryrefslogtreecommitdiff
path: root/docs/paramiko.primes-pysrc.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/paramiko.primes-pysrc.html')
-rw-r--r--docs/paramiko.primes-pysrc.html82
1 files changed, 41 insertions, 41 deletions
diff --git a/docs/paramiko.primes-pysrc.html b/docs/paramiko.primes-pysrc.html
index 41800d7..dee92dc 100644
--- a/docs/paramiko.primes-pysrc.html
+++ b/docs/paramiko.primes-pysrc.html
@@ -54,24 +54,24 @@
</table>
<h1 class="epydoc">Source Code for <a href="paramiko.primes-module.html" onclick="show_private();">Module paramiko.primes</a></h1>
<pre class="py-src">
-<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># Copyright (C) 2003-2007 Robey Pointer &lt;robey@lag.net&gt;</tt> </tt>
-<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
-<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This file is part of paramiko.</tt> </tt>
-<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
-<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Paramiko is free software; you can redistribute it and/or modify it under the</tt> </tt>
-<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># terms of the GNU Lesser General Public License as published by the Free</tt> </tt>
-<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Software Foundation; either version 2.1 of the License, or (at your option)</tt> </tt>
-<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># any later version.</tt> </tt>
-<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
-<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY</tt> </tt>
-<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR</tt> </tt>
-<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more</tt> </tt>
-<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># details.</tt> </tt>
-<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
-<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You should have received a copy of the GNU Lesser General Public License</tt> </tt>
-<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># along with Paramiko; if not, write to the Free Software Foundation, Inc.,</tt> </tt>
-<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</tt> </tt>
-<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># Copyright (C) 2003-2007 Robey Pointer &lt;robeypointer@gmail.com&gt;</tt> </tt>
+<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
+<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"># This file is part of paramiko.</tt> </tt>
+<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
+<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"># Paramiko is free software; you can redistribute it and/or modify it under the</tt> </tt>
+<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"># terms of the GNU Lesser General Public License as published by the Free</tt> </tt>
+<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"># Software Foundation; either version 2.1 of the License, or (at your option)</tt> </tt>
+<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"># any later version.</tt> </tt>
+<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
+<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment"># Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY</tt> </tt>
+<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"># WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR</tt> </tt>
+<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"># A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more</tt> </tt>
+<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment"># details.</tt> </tt>
+<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
+<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-comment"># You should have received a copy of the GNU Lesser General Public License</tt> </tt>
+<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment"># along with Paramiko; if not, write to the Free Software Foundation, Inc.,</tt> </tt>
+<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"># 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</tt> </tt>
+<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"><tt class="py-docstring">Utility functions for dealing with primes.</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
@@ -87,7 +87,7 @@
<a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"> <tt class="py-name">hbyte_mask</tt> <tt class="py-op">=</tt> <tt class="py-name">pow</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">bits</tt> <tt class="py-op">%</tt> <tt class="py-number">8</tt><tt class="py-op">)</tt> <tt class="py-op">-</tt> <tt class="py-number">1</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"> <tt class="py-comment"># loop catches the case where we increment n into a higher bit-range</tt> </tt>
-<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name" targets="Variable paramiko.auth_handler.randpool=paramiko.auth_handler-module.html#randpool,Variable paramiko.channel.randpool=paramiko.channel-module.html#randpool,Variable paramiko.client.randpool=paramiko.client-module.html#randpool,Variable paramiko.common.randpool=paramiko.common-module.html#randpool,Variable paramiko.dsskey.randpool=paramiko.dsskey-module.html#randpool,Variable paramiko.hostkeys.randpool=paramiko.hostkeys-module.html#randpool,Variable paramiko.kex_gex.randpool=paramiko.kex_gex-module.html#randpool,Variable paramiko.kex_group1.randpool=paramiko.kex_group1-module.html#randpool,Variable paramiko.packet.randpool=paramiko.packet-module.html#randpool,Variable paramiko.pkey.randpool=paramiko.pkey-module.html#randpool,Variable paramiko.rsakey.randpool=paramiko.rsakey-module.html#randpool,Variable paramiko.server.randpool=paramiko.server-module.html#randpool,Variable paramiko.sftp.randpool=paramiko.sftp-module.html#randpool,Variable paramiko.sftp_attr.randpool=paramiko.sftp_attr-module.html#randpool,Variable paramiko.sftp_client.randpool=paramiko.sftp_client-module.html#randpool,Variable paramiko.sftp_file.randpool=paramiko.sftp_file-module.html#randpool,Variable paramiko.sftp_handle.randpool=paramiko.sftp_handle-module.html#randpool,Variable paramiko.sftp_server.randpool=paramiko.sftp_server-module.html#randpool,Variable paramiko.sftp_si.randpool=paramiko.sftp_si-module.html#randpool,Variable paramiko.transport.randpool=paramiko.transport-module.html#randpool,Variable paramiko.util.randpool=paramiko.util-module.html#randpool"><a title="paramiko.auth_handler.randpool
+<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name" targets="Variable paramiko.auth_handler.randpool=paramiko.auth_handler-module.html#randpool,Variable paramiko.channel.randpool=paramiko.channel-module.html#randpool,Variable paramiko.client.randpool=paramiko.client-module.html#randpool,Variable paramiko.common.randpool=paramiko.common-module.html#randpool,Variable paramiko.dsskey.randpool=paramiko.dsskey-module.html#randpool,Variable paramiko.hostkeys.randpool=paramiko.hostkeys-module.html#randpool,Variable paramiko.kex_gex.randpool=paramiko.kex_gex-module.html#randpool,Variable paramiko.kex_group1.randpool=paramiko.kex_group1-module.html#randpool,Variable paramiko.packet.randpool=paramiko.packet-module.html#randpool,Variable paramiko.pkey.randpool=paramiko.pkey-module.html#randpool,Variable paramiko.rsakey.randpool=paramiko.rsakey-module.html#randpool,Variable paramiko.server.randpool=paramiko.server-module.html#randpool,Variable paramiko.sftp.randpool=paramiko.sftp-module.html#randpool,Variable paramiko.sftp_attr.randpool=paramiko.sftp_attr-module.html#randpool,Variable paramiko.sftp_client.randpool=paramiko.sftp_client-module.html#randpool,Variable paramiko.sftp_file.randpool=paramiko.sftp_file-module.html#randpool,Variable paramiko.sftp_handle.randpool=paramiko.sftp_handle-module.html#randpool,Variable paramiko.sftp_server.randpool=paramiko.sftp_server-module.html#randpool,Variable paramiko.sftp_si.randpool=paramiko.sftp_si-module.html#randpool,Variable paramiko.transport.randpool=paramiko.transport-module.html#randpool,Variable paramiko.util.randpool=paramiko.util-module.html#randpool"><a title="paramiko.auth_handler.randpool
paramiko.channel.randpool
paramiko.client.randpool
paramiko.common.randpool
@@ -127,12 +127,12 @@ paramiko.rng.StrongLockingRandomPool.get_bytes" class="py-name" href="#" onclick
<a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"> <tt class="py-name">hbyte_mask</tt> <tt class="py-op">=</tt> <tt class="py-name">pow</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">bits</tt> <tt class="py-op">%</tt> <tt class="py-number">8</tt><tt class="py-op">)</tt> <tt class="py-op">-</tt> <tt class="py-number">1</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt> <tt class="py-line"> <tt class="py-comment"># so here's the plan:</tt> </tt>
-<a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># we fetch as many random bits as we'd need to fit N-1, and if the</tt> </tt>
-<a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># generated number is &gt;= N, we try again. in the worst case (N-1 is a</tt> </tt>
-<a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># power of 2), we have slightly better than 50% odds of getting one that</tt> </tt>
-<a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># fits, so i can't guarantee that this loop will ever finish, but the odds</tt> </tt>
-<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># of it looping forever should be infinitesimal.</tt> </tt>
-<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
+<a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"> <tt class="py-comment"># we fetch as many random bits as we'd need to fit N-1, and if the</tt> </tt>
+<a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"> <tt class="py-comment"># generated number is &gt;= N, we try again. in the worst case (N-1 is a</tt> </tt>
+<a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"> <tt class="py-comment"># power of 2), we have slightly better than 50% odds of getting one that</tt> </tt>
+<a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"> <tt class="py-comment"># fits, so i can't guarantee that this loop will ever finish, but the odds</tt> </tt>
+<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"> <tt class="py-comment"># of it looping forever should be infinitesimal.</tt> </tt>
+<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">rpool</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="paramiko.Message.get_bytes
paramiko.rng.StrongLockingRandomPool.get_bytes" class="py-name" href="#" onclick="return doclink('link-13', 'get_bytes', 'link-6');">get_bytes</a></tt><tt class="py-op">(</tt><tt class="py-name">bytes</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">hbyte_mask</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
@@ -151,7 +151,7 @@ paramiko.rng.StrongLockingRandomPool.get_bytes" class="py-name" href="#" onclick
<a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"> </tt>
<a name="ModulusPack.__init__"></a><div id="ModulusPack.__init__-def"><a name="L74"></a><tt class="py-lineno"> 74</tt> <a class="py-toggle" href="#" id="ModulusPack.__init__-toggle" onclick="return toggle('ModulusPack.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.primes.ModulusPack-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">rpool</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModulusPack.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ModulusPack.__init__-expanded"><a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"> <tt class="py-comment"># pack is a hash of: bits -&gt; [ (generator, modulus) ... ]</tt> </tt>
-<a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">pack</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
+<a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">pack</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">discarded</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="paramiko.auth_handler.randpool
paramiko.channel.randpool
@@ -185,19 +185,19 @@ paramiko.util.randpool" class="py-name" href="#" onclick="return doclink('link-1
<a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> <tt class="py-name">modulus</tt> <tt class="py-op">=</tt> <tt class="py-name">long</tt><tt class="py-op">(</tt><tt class="py-name">modulus</tt><tt class="py-op">,</tt> <tt class="py-number">16</tt><tt class="py-op">)</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-comment"># weed out primes that aren't at least:</tt> </tt>
-<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># type 2 (meets basic structural requirements)</tt> </tt>
-<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># test 4 (more than just a small-prime sieve)</tt> </tt>
-<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># tries &lt; 100 if test &amp; 4 (at least 100 tries of miller-rabin)</tt> </tt>
-<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">mod_type</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-name">tests</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">tests</tt> <tt class="py-op">&amp;</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">tests</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">8</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">tries</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">100</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> <tt class="py-comment"># type 2 (meets basic structural requirements)</tt> </tt>
+<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"> <tt class="py-comment"># test 4 (more than just a small-prime sieve)</tt> </tt>
+<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-comment"># tries &lt; 100 if test &amp; 4 (at least 100 tries of miller-rabin)</tt> </tt>
+<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">mod_type</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-name">tests</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">tests</tt> <tt class="py-op">&amp;</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">tests</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">8</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">tries</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">100</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">discarded</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">modulus</tt><tt class="py-op">,</tt> <tt class="py-string">'does not meet basic requirements'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">generator</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-name">generator</tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> <tt class="py-comment"># there's a bug in the ssh "moduli" file (yeah, i know: shock! dismay!</tt> </tt>
-<a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># call cnn!) where it understates the bit lengths of these primes by 1.</tt> </tt>
-<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># this is okay.</tt> </tt>
-<a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">bl</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="paramiko.util" class="py-name" href="#" onclick="return doclink('link-17', 'util', 'link-1');">util</a></tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="paramiko.util.bit_length" class="py-name" href="#" onclick="return doclink('link-18', 'bit_length', 'link-10');">bit_length</a></tt><tt class="py-op">(</tt><tt class="py-name">modulus</tt><tt class="py-op">)</tt> </tt>
+<a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> <tt class="py-comment"># call cnn!) where it understates the bit lengths of these primes by 1.</tt> </tt>
+<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"> <tt class="py-comment"># this is okay.</tt> </tt>
+<a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> <tt class="py-name">bl</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="paramiko.util" class="py-name" href="#" onclick="return doclink('link-17', 'util', 'link-1');">util</a></tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="paramiko.util.bit_length" class="py-name" href="#" onclick="return doclink('link-18', 'bit_length', 'link-10');">bit_length</a></tt><tt class="py-op">(</tt><tt class="py-name">modulus</tt><tt class="py-op">)</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">bl</tt> <tt class="py-op">!=</tt> <tt class="py-name">size</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">bl</tt> <tt class="py-op">!=</tt> <tt class="py-name">size</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">discarded</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">modulus</tt><tt class="py-op">,</tt> <tt class="py-string">'incorrectly reported bit length %d'</tt> <tt class="py-op">%</tt> <tt class="py-name">size</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> </tt>
@@ -239,24 +239,24 @@ paramiko.win_pageant.PageantConnection.close" class="py-name" href="#" onclick="
<a name="L130"></a><tt class="py-lineno">130</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt id="link-22" class="py-name"><a title="paramiko.SSHException" class="py-name" href="#" onclick="return doclink('link-22', 'SSHException', 'link-4');">SSHException</a></tt><tt class="py-op">(</tt><tt class="py-string">'no moduli available'</tt><tt class="py-op">)</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt> <tt class="py-line"> <tt class="py-name">good</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt> <tt class="py-line"> <tt class="py-comment"># find nearest bitsize &gt;= preferred</tt> </tt>
-<a name="L133"></a><tt class="py-lineno">133</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">for</tt> <tt class="py-name">b</tt> <tt class="py-keyword">in</tt> <tt class="py-name">bitsizes</tt><tt class="py-op">:</tt> </tt>
+<a name="L133"></a><tt class="py-lineno">133</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">b</tt> <tt class="py-keyword">in</tt> <tt class="py-name">bitsizes</tt><tt class="py-op">:</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">&gt;=</tt> <tt class="py-name">prefer</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">max</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">good</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-name">good</tt> <tt class="py-op">==</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt> <tt class="py-line"> <tt class="py-name">good</tt> <tt class="py-op">=</tt> <tt class="py-name">b</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt> <tt class="py-line"> <tt class="py-comment"># if that failed, find greatest bitsize &gt;= min</tt> </tt>
-<a name="L137"></a><tt class="py-lineno">137</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-name">good</tt> <tt class="py-op">==</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
+<a name="L137"></a><tt class="py-lineno">137</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">good</tt> <tt class="py-op">==</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">b</tt> <tt class="py-keyword">in</tt> <tt class="py-name">bitsizes</tt><tt class="py-op">:</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">&gt;=</tt> <tt class="py-name">min</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">max</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">&gt;</tt> <tt class="py-name">good</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt> <tt class="py-line"> <tt class="py-name">good</tt> <tt class="py-op">=</tt> <tt class="py-name">b</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">good</tt> <tt class="py-op">==</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt> <tt class="py-line"> <tt class="py-comment"># their entire (min, max) range has no intersection with our range.</tt> </tt>
-<a name="L143"></a><tt class="py-lineno">143</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># if their range is below ours, pick the smallest. otherwise pick</tt> </tt>
-<a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># the largest. it'll be out of their range requirement either way,</tt> </tt>
-<a name="L145"></a><tt class="py-lineno">145</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># but we'll be sending them the closest one we have.</tt> </tt>
-<a name="L146"></a><tt class="py-lineno">146</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">good</tt> <tt class="py-op">=</tt> <tt class="py-name">bitsizes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
+<a name="L143"></a><tt class="py-lineno">143</tt> <tt class="py-line"> <tt class="py-comment"># if their range is below ours, pick the smallest. otherwise pick</tt> </tt>
+<a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"> <tt class="py-comment"># the largest. it'll be out of their range requirement either way,</tt> </tt>
+<a name="L145"></a><tt class="py-lineno">145</tt> <tt class="py-line"> <tt class="py-comment"># but we'll be sending them the closest one we have.</tt> </tt>
+<a name="L146"></a><tt class="py-lineno">146</tt> <tt class="py-line"> <tt class="py-name">good</tt> <tt class="py-op">=</tt> <tt class="py-name">bitsizes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">min</tt> <tt class="py-op">&gt;</tt> <tt class="py-name">good</tt><tt class="py-op">:</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt> <tt class="py-line"> <tt class="py-name">good</tt> <tt class="py-op">=</tt> <tt class="py-name">bitsizes</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt> <tt class="py-line"> <tt class="py-comment"># now pick a random modulus of this bitsize</tt> </tt>
-<a name="L150"></a><tt class="py-lineno">150</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">_roll_random</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="paramiko.auth_handler.randpool
+<a name="L150"></a><tt class="py-lineno">150</tt> <tt class="py-line"> <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">_roll_random</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="paramiko.auth_handler.randpool
paramiko.channel.randpool
paramiko.client.randpool
paramiko.common.randpool
@@ -311,7 +311,7 @@ expandto(location.href);
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
- Generated by Epydoc 3.0.1 on Sun Jul 6 18:30:37 2008
+ Generated by Epydoc 3.0.1 on Sun Nov 1 22:14:18 2009
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"