Qf$dZddlZ ddlZej ZeejZddl Ze dedDZe dedDZdZGddZd d Zd Zy#e $r dZdZddl m ZYSwxYw) zqHMAC (Keyed-Hashing for Message Authentication) module. Implements the HMAC algorithm as described by RFC 2104. N)_compare_digestc#&K|] }|dz  yw)\N.0xs +/opt/alt/python312/lib64/python3.12/hmac.py r 0Z!d(Zc#&K|] }|dz  yw)6Nrrs r r r r r cZeZdZdZdZdZddZdZdZe dZ d Z d Z d Z d Zd Zy)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_sizeNclt|ttfs!tdt |j z|s tdt r+t|ttfr |j|||y|j|||y#t j$r|j|||YywxYw)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 argument 'digestmod'.N) isinstancebytes bytearray TypeErrortype__name__ _hashopensslstr _functype _init_hmacUnsupportedDigestmodError _init_oldselfkeymsg digestmods r __init__z HMAC.__init__&s#y12JTRUYM_M__` `DE E Jy3 2BC 4S)4 NN3Y / 99 4sC3 4s"B &B32B3ctj||||_|jj|_|jj|_y)N)r*)r hmac_newrrrr&s r r#zHMAC._init_hmacBs;!**3yI ::11**//cbtr}nttrd fd }nd fd }d|_||_||_|j j |_t|j drR|j j}|dkrktjd||jfztd|j}n4tjd|jztd|j}t||kDr||j}||_|j|d}|jj!|j#t$|j j!|j#t&||j!|yy) Nc0tj|SN_hashlibnewdr*s r z HMAC._init_old..Ks Y(Br.c&j|Sr1r4r5s r r7z HMAC._init_old..Ms a(8r.rz:block_size of %d seems too small; using our default of %d.z.sHLL$;r.c&j|Sr1r9rfs r r7zdigest..s FJJqMr.rrr<r=)r rr!r" hmac_digestr$r>getattrrDrErGrHrJrI)r(r)rErKinnerouterrBs ` r rErEsJvY7G$H ++Cf= = FC ; 1 ME ME|R0I 3x)#%%' 9s3x/0 0C LLx() LLx() LL LL <<>)55   sD<<EEr\)r`warningsr@r3r compare_digestropenssl_sha256r" ImportError _operatorrhashlibrrangerIrJrrr4rErr.r rss 2# "00N\001I 0U3Z0 0 0U3Z0 0 JJX%( e<LI;=A>