Ńň
BwLc           @   s*   d  Z  d d k Td e f d     YZ d S(   s   $Id$i˙˙˙˙(   t   *t   BaseRNGc           B   se   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d d  Z	 d	   Z
 d
   Z RS(   c         C   s   t  |  _ |  i   d  S(   N(   t   Falset   closedt	   _selftest(   t   self(    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyt   __init__   s    	c         C   s   |  i    d  S(   N(   t   close(   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyt   __del__"   s    c         C   sb   |  i  d  } t |  d j o t d   n |  i  d  } | | j o t d   n d  S(   Ni   s   read truncateds   OS RNG returned duplicate data(   t   readt   lent   AssertionError(   R   t   datat   data2(    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyR   %   s    c         C   s   d  S(   N(    (   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyt	   __enter__2   s    c         C   s   |  i    d S(   s   PEP 343 supportN(   R   (   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyt   __exit__4   s    c         C   s%   |  i  p |  i   n t |  _  d  S(   N(   R   t   _closet   True(   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyR   8   s    
c         C   s   d  S(   N(    (   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyt   flush=   s    i˙˙˙˙c         C   sť   |  i  o t d   n t | t t f  p t d   n | d j  o t d   n | d j o d S|  i |  } t |  | j o& t d |  i	 | t |  f   n | S(   s   Return N bytes from the RNG.s   I/O operation on closed files   an integer is requiredi    s%   cannot read to end of infinite streamt    s3   %s produced truncated output (requested %d, got %d)(
   R   t
   ValueErrort
   isinstancet   longt   intt	   TypeErrort   _readR
   R   t   name(   R   t   NR   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyR	   @   s    
&c         C   s   t  d   d  S(   Ns   child class must implement this(   t   NotImplementedError(   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyR   O   s    c         C   s   t  d   d  S(   Ns   child class must implement this(   R   (   R   R   (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyR   R   s    (   t   __name__t
   __module__R   R   R   R   R   R   R   R	   R   R   (    (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyR      s   								N(   t   __revision__t   Crypto.Util.python_compatt   objectR   (    (    (    s[   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Random\OSRNG\rng_base.pyt   <module>   s   
