ó Ú_e[c@skdZddlZddlmZddlmZmZddlmZd„Z de fd„ƒYZ dS( s, Utility functions for dealing with primes. i˙˙˙˙N(tutil(t byte_masktlong(t SSHExceptioncCs¤tj|dƒ}|dd}td|dƒd}xetrŸtj|ƒ}|dkrzt|d|ƒ|d}ntj|dƒ}||kr;Pq;q;W|S(s returns a random # from 0 to N-1iiiii(Rt bit_lengthtpowtTruetosturandomRt inflate_long(tntbitst byte_countt hbyte_masktxtnum((s3/tmp/pip-install-KP2Jbq/paramiko/paramiko/primes.pyt _roll_randoms   t ModulusPackcBs2eZdZd„Zd„Zd„Zd„ZRS(sx convenience object for holding the contents of the /etc/ssh/moduli file, on systems that have such a file. cCsi|_g|_dS(N(tpackt discarded(tself((s3/tmp/pip-install-KP2Jbq/paramiko/paramiko/primes.pyt__init__:s c Cs`|jƒ\}}}}}}}t|ƒ}t|ƒ}t|ƒ}t|ƒ}t|ƒ}t|dƒ}|dksŚ|dksŚ|d@rŔ|dkrŔ|dkrŔ|jj|dfƒdS|dkrŐd}ntj|ƒ} | |kr#| |dkr#|jj|d j|ƒfƒdS| |jkrBg|j| |D]3}||kr™||kr™||kr™|}q™q™Wn|dkr|d}||kr|d}qntt|j|ƒƒ}|j||S(Nisno moduli availablei˙˙˙˙(tsortedRtkeysR(RR(RtmintprefertmaxtbitsizestgoodtbR ((s3/tmp/pip-install-KP2Jbq/paramiko/paramiko/primes.pyt get_modulusss" 0   $   (t__name__t __module__t__doc__RR#R+R4(((s3/tmp/pip-install-KP2Jbq/paramiko/paramiko/primes.pyR4s   % ( R7RtparamikoRtparamiko.py3compatRRtparamiko.ssh_exceptionRRtobjectR(((s3/tmp/pip-install-KP2Jbq/paramiko/paramiko/primes.pyts