grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|j%ã@s¬dZddlZzddlZWneydZdZddlmZ Yn wej Z e ej ƒZddl Ze dd„edƒDƒƒZe dd„edƒDƒƒZdZGdd „d ƒZdd d „Zd d„ZdS)zqHMAC (Keyed-Hashing for Message Authentication) module. Implements the HMAC algorithm as described by RFC 2104. éN)Ú_compare_digestccó�|]}|dAVqdS)é\N©©Ú.0Úxrrú+/opt/alt/python310/lib64/python3.10/hmac.pyÚ ó€r éccr)é6Nrrrrr r r c@sfeZdZdZdZdZddd„Zdd „Zd d „Ze d d „ƒZ dd„Z dd„Z dd„Z dd„Zdd„ZdS)ÚHMACz~RFC 2104 HMAC class. Also complies with RFC 4231. This supports the API for Cryptographic Hash Functions (PEP 247). é@)Ú_hmacÚ_innerÚ_outerÚ block_sizeÚ digest_sizeNÚcCsŠt|ttfƒstdt|ƒjƒ‚|stdƒ‚trKó z HMAC._init_old..có ˆ |¡Sr+©r.r/r(rr r1Mó réz:block_size of %d seems too small; using our default of %d.ézrr(r r!GsD   ÿþ€ÿþ   ÿzHMAC._init_oldcCs|jr|jjSd|jj›�S)Nzhmac-)rÚnamer)r#rrr rHnsz HMAC.namecCs|jp|j}| |¡dS)z,Feed data from msg into this hashing object.N)rrrC)r#r%Úinstrrr rCus z HMAC.updatecCsZ|j |j¡}|j|_|jr|j ¡|_d|_|_|Sd|_|j ¡|_|j ¡|_|S)zyReturn a separate copy of this hashing object. An update to this copy won't affect the original object. N)Ú __class__Ú__new__rrÚcopyrr)r#Úotherrrr rLzs  ý  z HMAC.copycCs*|jr|jS|j ¡}| |j ¡¡|S)zwReturn a hash object for the current state. To be used only internally with digest() and hexdigest(). )rrrLrCrrA©r#Úhrrr Ú_current‹s  z HMAC._currentcCó| ¡}| ¡S)zïReturn the hash value of this hashing object. This returns the hmac value as bytes. The object is not altered in any way by this function; you can continue updating the object after calling this function. )rPrArNrrr rA—sz HMAC.digestcCrQ)zKLike digest(), but returns a string of hexadecimal digits instead. )rPÚ hexdigestrNrrr rR¡szHMAC.hexdigest©Nr)rÚ __module__Ú __qualname__Ú__doc__r>Ú __slots__r'rr!ÚpropertyrHrCrLrPrArRrrrr rs '  rrcCs t|||ƒS)aáCreate a new hashing object and return it. key: bytes or buffer, The starting key for the hash. 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. You can now feed arbitrary bytes into the object using its update() method, and can ask for the hash value at any time by calling its digest() or hexdigest() methods. )r)r$r%r&rrr r.§s r.csötdurtˆttfƒrzt ||ˆ¡WStjyYnwtˆƒr%ˆ}ntˆtƒr2d ‡fdd„ }nd ‡fdd„ }|ƒ}|ƒ}t|ddƒ}t|ƒ|krQ||ƒ  ¡}|d|t|ƒ}|  |  t ¡¡|  |  t ¡¡|  |¡|  |  ¡¡|  ¡S) aJFast inline implementation of HMAC. key: bytes or buffer, The key for the keyed hash object. msg: bytes or buffer, Input message. digest: A hash name suitable for hashlib.new() for best performance. *OR* A hashlib constructor returning a new hash object. *OR* A module supporting PEP 247. Nr)cr*r+r,r/©rArr r1Ír2zdigest..cr3r+r4r/rYrr r1Ïr5rrr8r9)rrrrZ hmac_digestr r:Úgetattrr@rArCrDrFrE)r$r%rArGÚinnerZouterr>rrYr rA»s, ÿ     rArS)rVÚwarningsr<r-rÚ ImportErrorrÚ _operatorrZcompare_digestrZopenssl_sha256ZhashlibrÚrangerErFrrr.rArrrr Ús&  ý