Files
952-11/env/python/dll/Python312/Lib/__pycache__/hmac.cpython-312.pyc
T

102 lines
10 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åfÿãó—dZddlZ ddlZej
Zeej«Zddl Ze
d„ed«D««Ze
d„ed«D««ZdZGd„d«Zd d „Zd
„Zy#e $r
dZdZddl
m ZYŒSwxYw) zqHMAC (Keyed-Hashing for Message Authentication) module.
Implements the HMAC algorithm as described by RFC 2104.
éN)Ú_compare_digestc#ó&K—|] }|dz –—Œ y­w)é\N©©Ú.0Úxs ú@C:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\hmac.pyú <genexpr>r óèø€Ò0 �!�d•(Ñ0ùó‚éc#ó&K—|] }|dz –—Œ y­w)é6Nrrs r
r r r r
cóZ—eZdZdZdZdZdd„Zd„Zd„Ze d„«Z
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_sizeNcól—t|ttf«s!tdt |«j
z«‚|s td«‚t r+t|ttf«r |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) Ú
isinstanceÚbytesÚ bytearrayÚ TypeErrorÚtypeÚ__name__Ú _hashopensslÚstrÚ _functypeÚ
_init_hmacÚUnsupportedDigestmodErrorÚ _init_old©ÚselfÚkeyÚmsgÚ digestmods r
Ú__init__z
HMAC.__init__&s�€ô˜#¤¤yÐ1Ô2ÜÐJÌTÐRUËY×M_ÑM_Ñ_Ó`Ð `áÜÐDÓEÐ Eå œJ y´3¼ Ð2BÔCð
4Ø—‘  S¨)Õ4ð
�N‰N˜3  YÕ /øô ×9Ñ9ò
4Ø—‘˜s C¨Ö3ð
4úsÁ"B
Â
&B3Â2B3cóª—tj|||¬«|_|jj|_|jj|_y)N)r*)r Úhmac_newrrrr&s r
r#zHMAC._init_hmacBs;€Ü!×*Ñ*¨3°¸yÔIˆŒ
ØŸ:™:×1Ñ1ˆÔØŸ*™*×/Ñ/ˆ�ócób‡—t‰«r‰}nt‰t«rd ˆfd„ }nd ˆfd„ }d|_|«|_|«|_|j
j |_t|j
d«rR|j
j}|dkrktjd||jfztd«|j}n4tjd|jztd«|j}t|«|kDr||«j«}||_|j|d«}|jj!|j#t$««|j
j!|j#t&««|�|j!|«yy)
Ncó0•—tj‰|«S©N©Ú_hashlibÚnew©Údr*s €r
ú<lambda>z HMAC._init_old.<locals>.<lambda>Ksø€¬¯ © °YÀÓ(B€r.có&•—‰j|«Sr1©r4r5s €r
r7z HMAC._init_old.<locals>.<lambda>Msø€¨ ¯
©
°aÓ(8€r.réz: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!rrrrÚhasattrrÚ _warningsÚwarnÚ blocksizeÚRuntimeWarningÚlenÚdigestÚljustÚupdateÚ translateÚtrans_5CÚtrans_36)r'r(r)r*Ú digest_consrBs ` r
r%zHMAC._init_oldGsWø€Ü �IÔ Ø#‰KÜ
˜ ¤3Ô
'ÜB‰Kä8ˆKàˆŒ
Ù!“mˆŒ Ù!“mˆŒ ØŸ;™;×2Ñ2ˆÔä �4—;‘;  Ô -ØŸ ™ ×.Ñ.ˆIؘ2Š~Ü—‘ð 0Ø3<¸d¿n¹nÐ2Mñ Nä-¨qô2ð!ŸN™N‘ ä �N‰Nð*Ø-1¯^©^ñ=ä)¨1ô
.🙈Iä ˆs‹8�iÒ Ù˜cÓ"×)Ñ)Ó+ˆCð$ˆŒà�i‰i˜  5Ó)ˆØ � ‰ ×ј3Ÿ=™=¬Ó2Ô3Ø � ‰ ×ј3Ÿ=™=¬Ó2Ô3Ø ˆ?Ø �K‰K˜Õ ð r.cóx—|jr|jjSd|jj›�S)Nzhmac-)rÚnamer)r's r
rMz HMAC.namens/€à �:Š:Ø—:‘:—?‘?Ð "à˜4Ÿ;™;×+Ñ+Ð,Ð-Ð -r.cóZ—|jxs |j}|j|«y)z,Feed data from msg into this hashing object.N)rrrG)r'r)Úinsts r
rGz HMAC.updateus €à�z‰zÒ(˜TŸ[™[ˆØ � ‰ �CÕr.cór—|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__rrÚcopyrr)r'Úothers r
rSz HMAC.copyzsŽ€ð —‘×&Ñ& t§~¡~Ó6ˆØ ×,Ñ,ˆÔØ �:Š:ØŸ*™*Ÿ/™/Ó+ˆEŒKØ*.Ð .ˆEŒL˜5œ<ð
ˆ ðˆEŒKØŸ;™;×+Ñ+Ó-ˆEŒLØŸ;™;×+Ñ+Ó-ˆEŒL؈ 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().
)rrrSrGrrE©r'Úhs r
Ú_currentz
HMAC._current‹sE€ð
�:Š:Ø—:‘:Ð à— ‘ × Ñ Ó"ˆAØ
�H‰H�T—[‘[×'Ñ'Ó)Ô *؈Hr.cóB—|j«}|j«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.
)rXrErVs r
rEz HMAC.digest—s€ð
�M‰M‹OˆØ�x‰x‹zÐr.cóB—|j«}|j«S)zKLike digest(), but returns a string of hexadecimal digits instead.
)rXÚ hexdigestrVs r
r[zHMAC.hexdigest¡s€ð
�M‰M‹OˆØ�{‰{‹}Ðr.©NÚ)rÚ
__module__Ú __qualname__Ú__doc__rBÚ __slots__r+r#r%ÚpropertyrMrGrSrXrEr[rr.r
rrsR„ñð€Ið€Ió0ò80ò
%ðNñ.óð.ò ò
ò"
òór.rcó—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()