Your IP : 18.118.10.75


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/hmac.cpython-310.opt-2.pyc

o

6��f%�@s�	ddlZzddlZWneydZdZddlmZYn	wejZe	ej
�ZddlZedd�e
d�D��Zedd�e
d�D��ZdZGdd�d�Zdd
d�Zdd
�ZdS)�N)�_compare_digestcc��|]}|dAVqdS)�\N���.0�xrr�+/opt/alt/python310/lib64/python3.10/hmac.py�	<genexpr>��r
�ccr)�6Nrrrrr	r
rc@sdeZdZ	dZdZddd�Zdd�Zd	d
�Zedd��Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)�HMAC�@)�_hmac�_inner�_outer�
block_size�digest_sizeN�cCs�	t|ttf�stdt|�j��|std��tr=t|ttf�r=z
|�	|||�WdStj
y<|�|||�YdSw|�|||�dS)Nz,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.)�
isinstance�bytes�	bytearray�	TypeError�type�__name__�_hashopenssl�str�	_functype�
_init_hmac�UnsupportedDigestmodError�	_init_old��self�key�msg�	digestmodrrr	�__init__&s
�z
HMAC.__init__cCs*tj|||d�|_|jj|_|jj|_dS)N�r&)rZhmac_newrrrr"rrr	rBs
zHMAC._init_hmaccst��r�}nt�t�rd�fdd�	}nd�fdd�	}d|_|�|_|�|_|jj|_t|jd�rI|jj}|dkrHt	�
d||jftd�|j}n
t	�
d	|jtd�|j}t
|�|krb||���}||_|�|d
�}|j�|�t��|j�|�t��|dur�|�|�dSdS)N�c�t��|�S�N��_hashlib�new��dr(rr	�<lambda>K�z HMAC._init_old.<locals>.<lambda>c�
��|�Sr+�r.r/r(rr	r1M�
r�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))�callablerrrrrr�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)r#r$r%r&�digest_consr>rr(r	r!GsD

������zHMAC._init_oldcCs|jr|jjSd|jj��S)Nzhmac-)r�namer)r#rrr	rHnsz	HMAC.namecCs	|jp|j}|�|�dSr+)rrrC)r#r%�instrrr	rCuszHMAC.updatecCs\	|j�|j�}|j|_|jr|j��|_d|_|_|Sd|_|j��|_|j��|_|Sr+)�	__class__�__new__rr�copyrr)r#�otherrrr	rLzs�z	HMAC.copycCs,	|jr|jS|j��}|�|j���|Sr+)rrrLrCrrA�r#�hrrr	�_current�s
z
HMAC._currentcC�	|��}|��Sr+)rPrArNrrr	rA�szHMAC.digestcCrQr+)rP�	hexdigestrNrrr	rR�szHMAC.hexdigest�Nr)r�
__module__�__qualname__r>�	__slots__r'rr!�propertyrHrCrLrPrArRrrrr	rs
'

rrcCs	t|||�Sr+)r)r$r%r&rrr	r.�sr.cs�	tdurt�ttf�rzt�||��WStjyYnwt��r&�}nt�t�r3d�fdd�	}nd�fdd�	}|�}|�}t|dd�}t|�|krR||��	�}|d|t|�}|�
|�t��|�
|�t
��|�
|�|�
|�	��|�	�S)	Nr)cr*r+r,r/�rArr	r1�r2zdigest.<locals>.<lambda>cr3r+r4r/rXrr	r1�r5rrr8r9)rrrrZhmac_digestr r:�getattrr@rArCrDrFrE)r$r%rArG�innerZouterr>rrXr	rA�s.�

rArS)�warningsr<r-r�ImportErrorr�	_operatorrZcompare_digestrZopenssl_sha256Zhashlibr�rangerErFrrr.rArrrr	�<module>s&�




?>