ó
«F\c           @   s,   d  Z  d d l m Z d „  Z d „  Z d S(   s*   
PRNG management routines, thin wrappers.
iÿÿÿÿ(   t   libc         C   sY   t  |  t ƒ s t d ƒ ‚ n  t  | t ƒ s< t d ƒ ‚ n  t j |  t |  ƒ | ƒ d S(   sò  
    Mix bytes from *string* into the PRNG state.

    The *entropy* argument is (the lower bound of) an estimate of how much
    randomness is contained in *string*, measured in bytes.

    For more information, see e.g. :rfc:`1750`.

    This function is only relevant if you are forking Python processes and
    need to reseed the CSPRNG after fork.

    :param buffer: Buffer with random data.
    :param entropy: The entropy (in bytes) measurement of the buffer.

    :return: :obj:`None`
    s   buffer must be a byte strings   entropy must be an integerN(   t
   isinstancet   bytest	   TypeErrort   intt   _libt   RAND_addt   len(   t   buffert   entropy(    (    s+   lib/python2.7/site-packages/OpenSSL/rand.pyt   add   s
    c           C   s
   t  j ƒ  S(   s}   
    Check whether the PRNG has been seeded with enough data.

    :return: 1 if the PRNG is seeded enough, 0 otherwise.
    (   R   t   RAND_status(    (    (    s+   lib/python2.7/site-packages/OpenSSL/rand.pyt   status"   s    N(   t   __doc__t   OpenSSL._utilR    R   R
   R   (    (    (    s+   lib/python2.7/site-packages/OpenSSL/rand.pyt   <module>   s   	