File: //proc/2/root/usr/lib/python2.4/site-packages/dns/entropy.pyc
mò
!`Nc @ ss d k Z d k Z y
d k Z Wn e j
o d k Z n Xd e f d „ ƒ YZ e ƒ Z d „ Z d „ Z
d S( Nt EntropyPoolc B sM t Z d d „ Z e d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
RS( Nc C sí d | _ d | _ d | _ t i ƒ | _ y% d k } | i ƒ | _
d | _ WnW y% d k } | i
ƒ | _
d | _ Wq© d k } | i
ƒ | _
d | _ q© Xn Xd | i | _ | d j o | i | ƒ t | _ n
t | _ d S( Ni i i t ( t selft
pool_indext Nonet digestt next_bytet
_threadingt Lockt lockt hashlibt sha1t hasht hash_lent shat newt md5t poolt seedt stirt Truet seededt False( R R R
R R ( ( t/ /usr/lib/python2.4/site-packages/dns/entropy.pyt __init__ s,
c C sü | p | i i ƒ n zÄ g } | i D] } | t | ƒ q) ~ } x` | D]X } | i
| i j o
d | _
n t | ƒ d @} | | i
c | N<| i
d 7_
qL Wd i
g } | D] } | t | ƒ q¹ ~ ƒ | _ Wd | p | i i ƒ n Xd S( Ni iÿ i t ( t already_lockedR R t acquiret _[1]R t ct ordt bytest entropyR R
t bt joint chrt release( R R R R R! R R ( ( R R 1 s *
7 c C s› | i p y t i d ƒ } WnZ y7 t d d d ƒ } z | i d ƒ } Wd | i ƒ XWqz t t
i
ƒ ƒ } qz Xn Xt | _ | i | t ƒ n d S( Ni s /dev/urandomt ri (
R R t ost urandomR t fileR% t readt closet strt timeR R ( R R% R ( ( R t _maybe_seedA s
c C s½ | i i ƒ | i ƒ z‘ | i d j p | i | i j oE | i i | i
ƒ | i i ƒ | _ | i | i t ƒ d | _ n t
| i | i ƒ } | i d 7_ Wd | i i ƒ X| S( Ni i ( R R R R- R R R R
R t updateR R R R t valueR$ ( R R/ ( ( R t random_8Q s
#
c C s | i ƒ d | i ƒ S( Ni ( R R0 ( R ( ( R t random_16` s c C s | i ƒ d | i ƒ S( Ni ( R R1 ( R ( ( R t random_32c s c C s‘ | | d } | d j o t d ƒ ‚ n | d j o | i } d } n0 | d j o | i } d } n | i } d } | | | ƒ | d S( Ni l s too bigi l ÿÿ i iÿÿ iÿ (
t lastt firstt sizet
ValueErrorR R2 t randt maxR1 R0 ( R R4 R3 R7 R8 R5 ( ( R t random_betweenf s
( t __name__t
__module__R R R R R- R0 R1 R2 R9 ( ( ( R R s c C s
t i ƒ S( N( R R1 ( ( ( R R1 w s c C s t i | | ƒ S( N( R R9 R4 R3 ( R4 R3 ( ( R t betweenz s ( R&