python (3.12.0)

(root)/
lib/
python3.12/
__pycache__/
hmac.cpython-312.pyc

ˑe%dZddlZ	ddlZej
ZeejZddlZe
dedDZe
dedDZdZGddZdd	Zd
Zy#e	$r
dZdZddl
mZYSwxYw)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
N)_compare_digestc#&K|]	}|dzyw)\N.0xs  8/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/hmac.py	<genexpr>r0!d(0c#&K|]	}|dzyw)6Nrrs  r
rrrr
cZeZdZdZdZdZddZdZdZe	dZ
d	Zd
ZdZ
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_sizedigest_sizeNclt|ttfs!tdt	|j
z|stdt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 parameter 'digestmod'.N)
isinstancebytes	bytearray	TypeErrortype__name___hashopensslstr	_functype
_init_hmacUnsupportedDigestmodError	_init_oldselfkeymsg	digestmods    r
__init__z
HMAC.__init__&s#y12JTRUYM_M__``EFFJy3	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
<lambda>z HMAC._init_old.<locals>.<lambda>KsY(Br.c&j|Sr1r4r5s r
r7z HMAC._init_old.<locals>.<lambda>Ms	

a(8r.rz:block_size of %d seems too small; using our default of %d.z<No block_size attribute on given digest object; Assuming %d.r.)callablerr!rrrrhasattrr	_warningswarn	blocksizeRuntimeWarninglendigestljustupdate	translatetrans_5Ctrans_36)r'r(r)r*digest_consrBs   `  r
r%zHMAC._init_oldGsWI#K
	3
'BK8K
!m!m;;224;;-..I2~ 03<dnn2M N-q2!NN	NN*-1^^=)1
.Is8ic"))+C$ii	5)3==233==23?KKr.cx|jr|jjSd|jjS)Nzhmac-)rnamer)r's r
rMz	HMAC.namens/::::??"4;;++,--r.cZ|jxs|j}|j|y)z,Feed data from msg into this hashing object.N)rrrG)r'r)insts   r
rGzHMAC.updateus zz(T[[Cr.cr|jj|j}|j|_|jr/|jj	|_dx|_|_|Sd|_|j
j	|_|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__rrcopyrr)r'others  r
rSz	HMAC.copyzs&&t~~6 ,,::**//+EK*..EL5<
EK;;++-EL;;++-ELr.c|jr|jS|jj}|j|jj|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )rrrSrGrrEr'hs  r
_currentz
HMAC._currentsE
::::  "A
HHT[['')*Hr.cB|j}|jS)zReturn 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.
        )rXrErVs  r
rEzHMAC.digests
MMOxxzr.cB|j}|jS)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rX	hexdigestrVs  r
r[zHMAC.hexdigests
MMO{{}r.N)r
__module____qualname____doc__rB	__slots__r+r#r%propertyrMrGrSrXrEr[rr.r
rrsRII080
%N..
"
r.rct|||S)aCreate 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*s   r
r4r4s"S)$$r.ct.tttfr	tj||St
r}nttrdfd	}ndfd	}|}|}t|dd}t||kDr||j}|d|t|z
zz}|j|jt|j|jt|j||j|j|jS#tj
$rYwxYw)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.
    c0tj|Sr1r2r6rEs r
r7zdigest.<locals>.<lambda>sHLL$;r.c&j|Sr1r9rfs r
r7zdigest.<locals>.<lambda>sFJJqMr.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
<module>rss
2#"00N\001I0U3Z000U3Z00JJX%( e<LI;<sA,,A>=A>