o =?h%@s ddlZzddlZWneydZdZddlmZYn wejZe ej Zddl Ze dde dDZe dde dDZdZGdddZdd d Zd d ZdS)N)_compare_digestcc|]}|dAVqdS)\N.0xrr+/opt/alt/python310/lib64/python3.10/hmac.py r ccr)6Nrrrrr r r c@sdeZdZ dZdZdddZddZd d Zed d Z d dZ ddZ ddZ ddZ ddZdS)HMAC@)_hmac_inner_outer block_size digest_sizeNcCs t|ttfstdt|j|stdtr=t|ttfr=z | |||WdStj y<| |||YdSw| |||dS)Nz,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.) isinstancebytes bytearray TypeErrortype__name__ _hashopensslstr _functype _init_hmacUnsupportedDigestmodError _init_oldselfkeymsg digestmodrrr __init__&s z HMAC.__init__cCs*tj|||d|_|jj|_|jj|_dS)Nr&)rZhmac_newrrrr"rrr rBs zHMAC._init_hmaccstr}nttrd fdd }nd fdd }d|_||_||_|jj|_t|jdrI|jj}|dkrHt d||j ft d|j }n t d |j t d|j }t ||krb||}||_||d }|j|t|j|t|dur||dSdS) Nc t|SN_hashlibnewdr(rr K z HMAC._init_old..c |Sr+r.r/r(rr r1M rz:block_size of %d seems too small; using our default of %d.zrr(r r!GsD      zHMAC._init_oldcCs|jr|jjSd|jjS)Nzhmac-)rnamer)r#rrr rHnsz HMAC.namecCs |jp|j}||dSr+)rrrC)r#r%instrrr rCus z HMAC.updatecCs\ |j|j}|j|_|jr|j|_d|_|_|Sd|_|j|_|j|_|Sr+) __class____new__rrcopyrr)r#otherrrr rLzs    z HMAC.copycCs, |jr|jS|j}||j|Sr+)rrrLrCrrAr#hrrr _currents  z HMAC._currentcC |}|Sr+)rPrArNrrr rAsz HMAC.digestcCrQr+)rP hexdigestrNrrr rRszHMAC.hexdigestNr)r __module__ __qualname__r> __slots__r'rr!propertyrHrCrLrPrArRrrrr rs '  rrcCs t|||Sr+)r)r$r%r&rrr r.s r.cs tdurtttfrzt||WStjyYnwtr&}nttr3dfdd }ndfdd }|}|}t|dd}t||krR|| }|d|t|}| | t | | t | || | | S) Nr)cr*r+r,r/rArr r1r2zdigest..cr3r+r4r/rXrr r1r5rrr8r9)rrrrZ hmac_digestr r:getattrr@rArCrDrFrE)r$r%rArGinnerZouterr>rrXr rAs.     rArS)warningsr<r-r ImportErrorr _operatorrZcompare_digestrZopenssl_sha256ZhashlibrrangerErFrrr.rArrrr s&