Your IP : 3.15.188.75


Current Path : /proc/thread-self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python37/lib64/python3.7/__pycache__/hmac.cpython-37.opt-2.pyc

B

YI~du�@s�ddlZddlmZyddlZWnek
r<dZdZYnXe	ej
�ZddlZedd�e
d�D��Zedd�e
d�D��ZdZGdd�d�Zd
d	d
�Zdd�ZdS)�N)�_compare_digestccs|]}|dAVqdS)�\N�)�.0�xrr�)/opt/alt/python37/lib64/python3.7/hmac.py�	<genexpr>sr�ccs|]}|dAVqdS)�6Nr)rrrrrrsc@sNeZdZdZddd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�HMAC�@NcsVt|ttf�s tdt|�j���dkr<t�dtd�t	j
�t��rL�|_n,t�t
�rhd
�fdd�	|_nd�fdd�	|_|��|_|��|_|jj|_t|jd�r�|jj}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�|���}|�|d�}|j�|�t��|j�|�t��|dk	�rR|�|�dS)Nz,key: expected bytes or bytearray, but got %rzhHMAC() without an explicit digestmod argument is deprecated since Python 3.4, and will be removed in 3.8��cst��|�S)N)�_hashlib�new)�d)�	digestmodrr�<lambda>=rzHMAC.__init__.<locals>.<lambda>cs
��|�S)N)r)r)rrrr?r�
block_size�z:block_size of %d seems too small; using our default of %d.z<No block_size attribute on given digest object; Assuming %d.�)r)r)�
isinstance�bytes�	bytearray�	TypeError�type�__name__�	_warnings�warn�DeprecationWarningrZmd5�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr'r)rr�__init__!sB





z
HMAC.__init__cCsd|jjS)Nzhmac-)r$�name)r0rrrr4_sz	HMAC.namecCs|j�|�dS)N)r$r,)r0r2rrrr,cszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|S)N)�	__class__�__new__r!r%r$�copyr#)r0�otherrrrr7hsz	HMAC.copycCs|j��}|�|j���|S)N)r#r7r,r$r*)r0�hrrr�_currentus
z
HMAC._currentcCs|��}|��S)N)r:r*)r0r9rrrr*~szHMAC.digestcCs|��}|��S)N)r:�	hexdigest)r0r9rrrr;�szHMAC.hexdigest)NN)r�
__module__�__qualname__r'r3�propertyr4r,r7r:r*r;rrrrrs
>
	
rcCst|||�S)N)r)r1r2rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd�fdd�	}nd	�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)
Nrcst��|�S)N)rr)r)r*rrr�rzdigest.<locals>.<lambda>cs
��|�S)N)r)r)r*rrr�rrrr)r)r)
�_hashopensslrr"�_openssl_md_methsZhmac_digestr �getattrr)r*r,r-r/r.)r1r2r*r!r$r#r'r)r*rr*�s&

r*)NN)�warningsr�	_operatorrZcompare_digestrr?�ImportErrorr@�	frozensetZopenssl_md_meth_namesZhashlibr�ranger.r/r%rrr*rrrr�<module>s

t


?>