ó =OXc@sudZddlZddlmZddlmZmZddlmZddl Td„Z de fd „ƒYZ dS( s, Utility functions for dealing with primes. i˙˙˙˙N(tutil(t byte_masktlong(t SSHException(t*cCs¤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/usr/lib/python2.7/site-packages/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/usr/lib/python2.7/site-packages/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 |fƒdS| |jkr=g|j| |D]3}||kr™||kr™||kr™|}q™q™Wn|dkr|d}||kr|d}qntt|j|ƒƒ}|j||S(Nisno moduli availablei˙˙˙˙(tsortedRtkeysR(RR(RtmintprefertmaxtbitsizestgoodtbR ((s3/usr/lib/python2.7/site-packages/paramiko/primes.pyt get_modulusms" 0   $   (t__name__t __module__t__doc__RR#R+R4(((s3/usr/lib/python2.7/site-packages/paramiko/primes.pyR5s    ( R7RtparamikoRtparamiko.py3compatRRtparamiko.ssh_exceptionRtparamiko.commonRtobjectR(((s3/usr/lib/python2.7/site-packages/paramiko/primes.pyts