+
    '(j=                     r    ^ RI Ht ^ RIHtHtHt ^ RIHt ^RIH	t	H
t
 ^RI	HtHtHt  ! R R]4      tR tR	# )
    )	unhexlify)bordtobytesis_bytes)get_random_bytes)	cSHAKE128SHA3_256)_bytepad_encode_str_right_encodec                   N   a  ] tR t^(t o RtR tR tR tR tR t	R t
R tR	tV tR
# )	KMAC_HashzOA KMAC hash object.
Do not instantiate directly.
Use the :func:`new` function.
c                    R V,           V n         W0n        RV n        \        \	        \        V4      4      V4      pVP                  WR4      V n        V'       d   V P                  P                  V4       R# R# )z2.16.840.1.101.3.4.2.Ns   KMAC)	oiddigest_size_macr
   r   r   _new_cshakeupdate)	selfdatakeymac_lencustomoid_variantcshakeratepartial_newXs	   &&&&&&&& H/home/ubuntu/cf-venv/lib/python3.14/site-packages/Crypto/Hash/KMAC128.py__init__KMAC_Hash.__init__.   s^     +[8"	GCL 94@{{<ALL%     c                v    V P                   '       d   \        R4      hV P                  P                  V4       V # )zAuthenticate 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   	TypeErrorr   r   )r   r   s   &&r   r   KMAC_Hash.update=   s0     999VWWD!r"   c                    V P                   '       g`   V P                  P                  \        V P                  ^,          4      4       V P                  P                  V P                  4      V n         V P                   # )zvReturn the **binary** (non-printable) MAC tag of the message.

:return: The MAC tag. Binary form.
:rtype: byte string
)r   r   r   r   r   read)r   s   &r   digestKMAC_Hash.digestK   sU     yyyLLd.>.>.B CD))$*:*:;DIyyr"   c           	         RP                  \        V P                  4       4       Uu. uF  pR\        V4      ,          NK  	  up4      # u upi )zlReturn the **printable** MAC tag of the message.

:return: The MAC tag. Hexadecimal encoded.
:rtype: string
 z%02x)jointupler(   r   )r   xs   & r   	hexdigestKMAC_Hash.hexdigestX   s>     ww%2FG2FQa((2FGHHGs   A	c                   \        ^4      p\        P                  ! W!,           4      p\        P                  ! W P                  4       ,           4      pVP                  4       VP                  4       8w  d   \	        R4      hR# )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.
zMAC check failedN)r   r	   newr(   
ValueError)r   mac_tagsecretmac1mac2s   &&   r   verifyKMAC_Hash.verifya   s[     ""%||F,-||F[[]23;;=DKKM)/00 *r"   c                L    V P                  \        \        V4      4      4       R# )a6  Verify 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)r8   r   r   )r   hex_mac_tags   &&r   	hexverifyKMAC_Hash.hexverifyu   s     	Igk234r"   c                D    RV9  d   V P                   VR&   \        R/ VB # )z>Return a new instance of a KMAC hash object.
See :func:`new`.
r    )r   r2   )r   kwargss   &,r   r2   KMAC_Hash.new   s(    
 F" $ 0 0F9}V}r"   )r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r    r   r(   r/   r8   r<   r2   __static_attributes____classdictcell__)__classdict__s   @r   r   r   (   s3     
&I1(5 r"   r   c            	        V P                  RR4      p\        V4      '       g   \        R4      h\        V4      ^8  d   \	        R4      hV P                  RR4      pV P                  R^@4      pV^8  d   \	        R4      hV P                  RR	4      pV '       d   \        R
\        V 4      ,           4      h\        W!W4R\        ^4      # )ay  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
r   NzYou must pass a key to KMAC128z1The key must be at least 128 bits long (16 bytes)r   r   z!'mac_len' must be 8 bytes or morer   r"   zUnknown parameters: 19)popr   r$   lenr3   strr   r   )r@   r   r   r   r   s   ,    r   r2   r2      s    ( **UD
!CC==899
3x"}LMM::fd#DjjB'G{<==ZZ#&F.V<==Ty#FFr"   N)binasciir   Crypto.Util.py3compatr   r   r   Crypto.Randomr   r+   r   r	   r
   r   r   objectr   r2   r?   r"   r   <module>rS      s1   >  9 9 * ! ; ;c cL%Gr"   