Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/Crypto/Util/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/Crypto/Util/__pycache__/_number_new.cpython-35.pyc



���^��@s�dZdddddgZddlZejddkrWejd	d	krWdd
lTdd�Zdd�Zd
d�Zdd�Zddd�Z	dS)z$Id$�
ceil_shift�ceil_div�	floor_div�
exact_log2�	exact_div�N��)�*cCs�t|t�s t|t�rHtdt|�jt|�jf��|dkr`|dksft�d|>d}||@r�||?dS||?SdS)z�Return ceil(n / 2**b) without performing any floating-point or division operations.

    This is done by right-shifting n by b bits and incrementing the result by 1
    if any '1' bits were shifted out.
    z&unsupported operand type(s): %r and %rrrN)�
isinstance�int�	TypeError�type�__name__�AssertionError)�n�b�mask�r�J/opt/alt/python35/lib64/python3.5/site-packages/Crypto/Util/_number_new.pyr"s (
cCsst|t�s t|t�rHtdt|�jt|�jf��t||�\}}|rk|dS|SdS)zDReturn ceil(a / b) without performing any floating-point operations.z&unsupported operand type(s): %r and %rrN)r
rrr
r�divmod)�ar�q�rrrrr2s (cCsat|t�s t|t�rHtdt|�jt|�jf��t||�\}}|S)Nz&unsupported operand type(s): %r and %r)r
rrr
rr)rrrrrrrr>s (cCs�t|t�s+tdt|�jf��t|�}|dkrOtd��d}xF|dkr�|d@r�|dkr�td��|d7}|dL}qXW|d8}|d|>ks�t�|S)z~Find and return an integer i >= 0 such that num == 2**i.

    If no such integer exists, this function raises ValueError.
    zunsupported operand type: %rrz/cannot compute logarithm of non-positive numberrzNo solution could be found)r
rrr
r�
ValueErrorr)�numr�irrrrEs

FcCs�t|t�s t|t�rHtdt|�jt|�jf��|dkr|rd}|||kr�td��n-t||�\}}|dkr�td��|||ks�t�|S)aFind and return an integer n such that p == n * d

    If no such integer exists, this function raises ValueError.

    Both operands must be integers.

    If the second operand is zero, this function will raise ZeroDivisionError
    unless allow_divzero is true (default: False).
    z&unsupported operand type(s): %r and %rrzNo solution could be found)r
rrr
rrrr)�p�dZ
allow_divzerorrrrrr]s ()
�__revision__�__all__�sys�version_infoZCrypto.Util.py21compatrrrrrrrrr�<module>s&