ó õùPc@sNdZdgZddlZddlmZdefd„ƒYZd„ZdS(s$Id$t WindowsRNGiÿÿÿÿN(tBaseRNGcBs2eZdZd„Zd„Zd„Zd„ZRS(scCs tjƒ|_tj|ƒdS(N(t winrandomtnewt_WindowsRNG__winrandRt__init__(tself((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyR#scCsS|jrtdƒ‚n|jjdƒ}t|ƒdksBt‚tj|ƒdS(s*Work around weakness in Windows RNG. The CryptGenRandom mechanism in some versions of Windows allows an attacker to learn 128 KiB of past and future output. As a workaround, this function reads 128 KiB of 'random' data from Windows and discards it. For more information about the weaknesses in CryptGenRandom, see _Cryptanalysis of the Random Number Generator of the Windows Operating System_, by Leo Dorrendorf and Zvi Gutterman and Benny Pinkas http://eprint.iacr.org/2007/419 sI/O operation on closed filei€iNii(tclosedt ValueErrorRt get_bytestlentAssertionErrorRtflush(Rtdata((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyR 's cCs d|_dS(N(tNoneR(R((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyt_close:scCs*|jƒ|jj|ƒ}|jƒ|S(N(R RR (RtNR ((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyt_read=s  (t__name__t __module__tnameRR RR(((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyRs    cOs t||ŽS(N(R(targstkwargs((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyRGs(t __revision__t__all__Rtrng_baseRRR(((s1..\python\site-packages\Crypto\Random\OSRNG\nt.pyts   (