hyb
2026-01-30 15bc7727b58bf9ca0c8f21702fa893daac232b8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Ë
ž¬`iðãóp—ddlmZddlmZmZmZddlmZddlm    Z    m
Z
ddl    m Z m Z m Z Gd„de«Zd    „Zy
) é)Ú    unhexlify)ÚbordÚtobytesÚis_bytes)Úget_random_bytesé)Ú    cSHAKE128ÚSHA3_256)Ú_bytepadÚ _encode_strÚ _right_encodecó:—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
y    )
Ú    KMAC_Hashz[A KMAC hash object.
    Do not instantiate directly.
    Use the :func:`new` function.
    cóܗd|z|_||_d|_tt    t |««|«}|j ||d«|_|r|jj|«yy)Nz2.16.840.1.101.3.4.2.sKMAC)    ÚoidÚ digest_sizeÚ_macr r rÚ_newÚ_cshakeÚupdate)    ÚselfÚdataÚkeyÚmac_lenÚcustomÚ oid_variantÚcshakeÚrateÚ partial_newXs             õfH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\Crypto/Hash/KMAC128.pyÚ__init__zKMAC_Hash.__init__.sb€ð+¨[Ñ8ˆŒØ"ˆÔàˆŒ    ä¤ ¬G°C«LÓ 9¸4Ó@ˆ Ø—{‘{ <°¸ÓAˆŒ á Ø L‰L× Ñ  Õ %ð ócój—|jr td«‚|jj|«|S)z©Authenticate the next chunk of message.
 
        Args:
            data (bytes/bytearray/memoryview): The next chunk of the message to
            authenticate.
        z8You can only call 'digest' or 'hexdigest' on this object)rÚ    TypeErrorrr)rrs  r rzKMAC_Hash.update=s.€ð 9Š9ÜÐVÓWÐ Wà  ‰ ×јDÔ!؈ r"cóè—|js[|jjt|jdz««|jj |j«|_|jS)zŽReturn the **binary** (non-printable) MAC tag of the message.
 
        :return: The MAC tag. Binary form.
        :rtype: byte string
        é)rrrr rÚread)rs r ÚdigestzKMAC_Hash.digestKsS€ðyŠyØ L‰L× Ñ ¤ ¨d×.>Ñ.>ÀÑ.BÓ CÔ DØŸ ™ ×)Ñ)¨$×*:Ñ*:Ó;ˆDŒIày‰yÐr"c    ó—djt|j««Dcgc]}dt|«z‘Œc}«Scc}w)z„Return the **printable** MAC tag of the message.
 
        :return: The MAC tag. Hexadecimal encoded.
        :rtype: string
        Úz%02x)ÚjoinÚtupler(r)rÚxs  r Ú    hexdigestzKMAC_Hash.hexdigestXs5€ðw‰w´%¸¿ ¹ » Ó2FÖG¨Q˜¤ a£Ó(ÒGÓHÐHùÒGs§Acóî—td«}tj||z«}tj||j«z«}|j«|j«k7r t    d«‚y)a`Verify that a given **binary** MAC (computed by another party)
        is valid.
 
        Args:
          mac_tag (bytes/bytearray/memoryview): the expected MAC of the message.
 
        Raises:
            ValueError: if the MAC does not match. It means that the message
                has been tampered with or that the MAC key is incorrect.
        ézMAC check failedN)rr
Únewr(Ú
ValueError)rÚmac_tagÚsecretÚmac1Úmac2s     r ÚverifyzKMAC_Hash.verifyas_€ô" "Ó%ˆä|‰|˜F WÑ,Ó-ˆÜ|‰|˜F T§[¡[£]Ñ2Ó3ˆà ;‰;‹=˜DŸK™K›MÒ )ÜÐ/Ó0Ð 0ð *r"cóJ—|jtt|«««y)anVerify that a given **printable** MAC (computed by another party)
        is valid.
 
        Args:
            hex_mac_tag (string): the expected MAC of the message, as a hexadecimal string.
 
        Raises:
            ValueError: if the MAC does not match. It means that the message
                has been tampered with or that the MAC key is incorrect.
        N)r7rr)rÚ hex_mac_tags  r Ú    hexverifyzKMAC_Hash.hexverifyus€ð      ‰ ”Iœg kÓ2Ó3Õ4r"c ó>—d|vr|j|d<tdi|¤ŽS)zNReturn a new instance of a KMAC hash object.
        See :func:`new`.
        r©)rr1)rÚkwargss  r r1z KMAC_Hash.newƒs(€ð
˜FÑ "Ø $× 0Ñ 0ˆF9Ñ ä‰}V‰}Ðr"N) Ú__name__Ú
__module__Ú __qualname__Ú__doc__r!rr(r.r7r:r1r<r"r rr(s+„ñò
&ò ò òIò1ò( 5ór"rc     ól—|jdd«}t|«s td«‚t|«dkr t    d«‚|jdd«}|jdd«}|d    kr t    d
«‚|jd d «}|rtd t |«z«‚t ||||dtd«S)aµCreate a new KMAC128 object.
 
    Args:
        key (bytes/bytearray/memoryview):
            The key to use to compute the MAC.
            It must be at least 128 bits long (16 bytes).
        data (bytes/bytearray/memoryview):
            Optional. The very first chunk of the message to authenticate.
            It is equivalent to an early call to :meth:`KMAC_Hash.update`.
        mac_len (integer):
            Optional. The size of the authentication tag, in bytes.
            Default is 64. Minimum is 8.
        custom (bytes/bytearray/memoryview):
            Optional. A customization byte string (``S`` in SP 800-185).
 
    Returns:
        A :class:`KMAC_Hash` hash object
    rNzYou must pass a key to KMAC128r0z1The key must be at least 128 bits long (16 bytes)rré@r&z!'mac_len' must be 8 bytes or morerr"zUnknown parameters: Ú19é¨)Úpoprr$Úlenr2Ústrrr    )r=rrrrs     r r1r1Žs°€ð( *‰*U˜DÓ
!€CÜ CŒ=ÜÐ8Ó9Ð9Ü
ˆ3ƒx"‚}ÜÐLÓMÐMà :‰:f˜dÓ #€Dàj‰j˜ BÓ'€Gؐ‚{ÜÐ<Ó=Ð=à Z‰Z˜ #Ó &€Fá ÜÐ.´°V³Ñ<Ó=Ð=ä T˜3 ¨°´yÀ#Ó FÐFr"N)ÚbinasciirÚCrypto.Util.py3compatrrrÚ Crypto.Randomrr*r    r
r r r Úobjectrr1r<r"r ú<module>rMs1ðõ>ç9Ñ9Ý*ç!ß;Ñ;ôcôcóL%Gr"