a
XC?h[ ã @ s¬ d Z ddlZzddlZW n& ey> dZdZddlmZ Y n0 e
ejƒZej Z ddlZe
dd„ edƒD ƒƒZe
dd„ edƒD ƒƒZdZG dd „ d ƒZddd„Zd
d„ ZdS )zqHMAC (Keyed-Hashing for Message Authentication) module.
Implements the HMAC algorithm as described by RFC 2104.
é N)Ú_compare_digestc c s | ]}|d A V qdS )é\ N© ©Ú.0Úxr r ú)/opt/alt/python39/lib64/python3.9/hmac.pyÚ ó r é c c s | ]}|d A V qdS )é6 Nr r r r r r r
c @ sz e Zd ZdZdZdZddd„Zedd „ ƒZed
d„ ƒZ edd
„ ƒZ
edd„ ƒZdd„ Zdd„ Z
dd„ Zdd„ Zdd„ ZdS )ÚHMACz~RFC 2104 HMAC class. Also complies with RFC 4231.
This supports the API for Cryptographic Hash Functions (PEP 247).
é@ )Ú_digest_consÚ_innerÚ_outerÚ
block_sizeÚdigest_sizeNÚ c sF t |ttfƒs tdt|ƒj ƒ‚ˆ s,tdƒ‚tˆ ƒr<ˆ | _n,t ˆ tƒrXd‡ fdd„ | _nd‡ fdd„ | _| ¡ | _ | ¡ | _
| j
j| _t| j
dƒrÂ| j
j
}|dk rÜt d || jf td
¡ | j}nt d| j td
¡ | j}|| _
t|ƒ|k rþ| |¡ ¡ }| |d¡}| j | t¡¡ | j
| t¡¡ |d
urB| |¡ d
S )a? Create a new HMAC object.
key: bytes or buffer, key for the keyed hash object.
msg: bytes or buffer, Initial input for the hash or None.
digestmod: A hash name suitable for hashlib.new(). *OR*
A hashlib constructor returning a new hash object. *OR*
A module supporting PEP 247.
Required as of 3.8, despite its position after the optional
msg argument. Passing it as a keyword argument is
recommended, though not required for legacy API reasons.
z,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.r
c s t ˆ | ¡S ©N©Ú_hashlibÚnew©Úd©Ú digestmodr r Ú= r
zHMAC.__init__..c s
ˆ | ¡S r ©r r r r r r ? r
r é z:block_size of %d seems too small; using our default of %d.é z