Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/Crypto/Random/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyc


T:Nc@sMdZddlZejddkrEejddkrEddlTnddlZddlZddlZddlZddlm	Z	ddl
mZdd	lm
Z
d
efdYZdefd
YZdefdYZdefdYZdefdYZejZdadZdZdZdZdS(s$Id$iNiii(t*(tfloor(tOSRNG(tFortunaAccumulatort_EntropySourcecBseZdZdZRS(cCs||_||_d|_dS(Ni(t_fortunat_src_numt	_pool_num(tselftaccumulatortsrc_num((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyt__init__)s		cCs4|jj|j|j||jdd@|_dS(Nii(Rtadd_random_eventRR(Rtdata((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pytfeed.s(t__name__t
__module__RR(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR(s	t_EntropyCollectorcBs#eZdZdZdZRS(cCsItj|_t|d|_t|d|_t|d|_dS(Niii(Rtnewt_osrngRt	_osrng_est_time_est	_clock_es(RR	((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR4scCszxftdD]X}|jjd}x7tdD])}|jj||d|dd!q2Wd}q
W|jjdS(Nii ii(trangeRtreadRRtNonetflush(Rtitblocktp((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pytreinit:s'
cCs|jj|jjdtj}|jjtjdtd|t	|tj
}|jjtjdtd|t	|dS(Nis@Iiii@i@(RRRRttimeRtstructtpacktintRtclockR(Rtt((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pytcollectDs
0(RRRRR%(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR2s		
t_UserFriendlyRNGcBs>eZdZdZdZdZdZdZRS(cCs8t|_tj|_t|j|_|jdS(N(tFalsetclosedRt_faRt_ecR(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRSs	cCs tj|_|jjdS(skInitialize the random number generator and seed it with entropy from
        the operating system.
        N(tostgetpidt_pidR*R(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRYscCst|_d|_d|_dS(N(tTrueR(RRR)(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pytclose`s		cCsdS(N((R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRescCs|jrtdnt|ttfs<tdn|dkrWtdn|jj|jj	|}|j
|S(sReturn N bytes from the RNG.sI/O operation on closed filesan integer is requiredis%cannot read to end of infinite stream(R(t
ValueErrort
isinstancetlongR"t	TypeErrorR*R%R)trandom_datat
_check_pid(RtNtretval((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRhs	

cCs(tj|jkr$tdndS(NsTPID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()(R+R,R-tAssertionError(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR5s
(RRRRR/RRR5(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR&Qs					t_LockingUserFriendlyRNGcBs,eZdZdZdZdZRS(cCs tj|_tj|dS(N(t	threadingtLockt_lockR&R(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRscCs3|jjztj|SWd|jjXdS(N(R<tacquireR&R/trelease(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR/s
cCs3|jjztj|SWd|jjXdS(N(R<R=R&RR>(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRs
cCs6|jjztj||SWd|jjXdS(N(R<R=R&RR>(Rtbytes((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRs
(RRRR/RR(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR9s			tRNGFilecBs>eZdZdZdZdZdZdZRS(cCst|_||_dS(N(R'R(t
_singleton(Rt	singleton((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRs	cCsdS(sPEP 343 supportN((R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyt	__enter__scCs|jdS(sPEP 343 supportN(R/(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyt__exit__scCst|_d|_dS(N(R.R(RRA(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR/s	cCs(|jrtdn|jj|S(NsI/O operation on closed file(R(R0RAR(RR?((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRs	cCs|jrtdndS(NsI/O operation on closed file(R(R0(R((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRs	(RRRRCRDR/RR(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyR@s					cCs<tjz tdkr%tantSWdtjXdS(N(t_singleton_lockR=RARR9R>(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyt_get_singletons
cCs
ttS(N(R@RF(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRscCstjdS(N(RFR(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyRscCstj|S(sEReturn the specified number of cryptographically-strong random bytes.(RFR(tn((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pytget_random_bytess(t__revision__tsystversion_infotCrypto.Util.py21compatR+R:R RtmathRt
Crypto.RandomRtCrypto.Random.FortunaRtobjectRRR&R9R@R;RERRARFRRRH(((sB/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.pyt<module>s*&

<