o
    Â/¾OÐ
  ã                   @   s2   d Z ddlmZ ddlZddlZG dd„ dƒZdS )z$Id$é    )ÚRandomPool_DeprecationWarningNc                   @   sn   e Zd ZdZddd„Zdd„ Zdd	„ Zddd„Zddd„Zddd„Z	d dd„Z
ddd„Zdd„ Zddd„ZdS )!Ú
RandomPoolz\Deprecated.  Use Random.new() instead.

    See http://www.pycrypto.org/randpool-broken
    é    Nc                 C   s6   t  dt¡ tj ¡ | _|| _| jd | _| j| _	d S )NzqThis application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-brokené   )
ÚwarningsÚwarnr   ÚCryptoÚRandomÚnewÚ_RandomPool__rngÚbytesÚbitsÚentropy)ÚselfÚnumbytesÚcipherÚhashÚfile© r   úF/var/www/html/env/lib/python3.10/site-packages/Crypto/Util/randpool.pyÚ__init__&   s   ÿzRandomPool.__init__c                 C   s   | j  |¡S )N)r   Úread©r   ÚNr   r   r   Ú	get_bytes.   s   zRandomPool.get_bytesc                 C   s>   |  j |7  _ | j dk rd| _ d S | j | jkr| j| _ d S d S )Nr   )r   r   )r   Únbitsr   r   r   Ú_updateEntropyEstimate1   s   

ÿz!RandomPool._updateEntropyEstimater   ú/dev/urandomc                 C   ó   | j  ¡  dS )zDummy _randomize() functionN©r   Úflush)r   r   Údevnamer   r   r   Ú
_randomize8   ó   zRandomPool._randomizec                 C   r   )zDummy randomize() functionNr   r   r   r   r   Ú	randomize<   r#   zRandomPool.randomizeÚ c                 C   r   )zDummy stir() functionNr   ©r   Úsr   r   r   Ústir@   r#   zRandomPool.stiré   c                 C   r   )zDummy stir_n() functionNr   r   r   r   r   Ústir_nD   r#   zRandomPool.stir_nc                 C   r   )zDummy add_event() functionNr   r&   r   r   r   Ú	add_eventH   r#   zRandomPool.add_eventc                 C   s
   |   |¡S )zDummy getBytes() function)r   r   r   r   r   ÚgetBytesL   s   
zRandomPool.getBytesc                 C   s   |   ¡ S )zDummy addEvent() function)r+   )r   Úeventr'   r   r   r   ÚaddEventP   s   zRandomPool.addEvent)r   NNN)r   r   )r   )r%   )r)   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r"   r$   r(   r*   r+   r,   r.   r   r   r   r   r   !   s    





r   )Ú__revision__ÚCrypto.pct_warningsr   ÚCrypto.Randomr   r   r   r   r   r   r   Ú<module>   s
   