[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.141.19.115: ~ $
�

1�Dg=��x�ddlmZddlmZmZmZddlmZddlm	Z	m
Z
ddl	mZmZm
Z
Gd�de��Zd	�Zd
S)�)�	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
d	S)
�	KMAC_Hashz[A KMAC hash object.
    Do not instantiate directly.
    Use the :func:`new` function.
    c��d|z|_||_d|_tt	t|����|��}|�||d��|_|r|j�|��dSdS)Nz2.16.840.1.101.3.4.2.sKMAC)	�oid�digest_size�_macrrr�_new�_cshake�update)	�self�data�key�mac_len�custom�oid_variant�cshake�rate�partial_newXs	         �u/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/KMAC128.py�__init__zKMAC_Hash.__init__.s���+�[�8���"�����	���G�C�L�L� 9� 9�4�@�@���{�{�<���A�A����	&��L����%�%�%�%�%�	&�	&�c�f�|jrtd���|j�|��|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=s9���9�	X��V�W�W�W�����D�!�!�!��r"c���|jsS|j�t|jdz����|j�|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.digestKsV���y�	<��L���
�d�.>��.B� C� C�D�D�D���)�)�$�*:�;�;�D�I��y�r"c�~�d�d�t|�����D����S)z�Return the **printable** MAC tag of the message.

        :return: The MAC tag. Hexadecimal encoded.
        :rtype: string
        �c�2�g|]}dt|��z��S)z%02x)r)�.0�xs  r �
<listcomp>z'KMAC_Hash.hexdigest.<locals>.<listcomp>_s#��G�G�G�Q���a���(�G�G�Gr")�join�tupler)r(s r �	hexdigestzKMAC_Hash.hexdigestXs5���w�w�G�G�%����
�
�2F�2F�G�G�G�H�H�Hr"c��td��}tj||z��}tj||���z��}|���|���krt	d���dS)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.verifyass��"�"�%�%���|�F�W�,�-�-���|�F�T�[�[�]�]�2�3�3���;�;�=�=�D�K�K�M�M�)�)��/�0�0�0�*�)r"c�d�|�tt|������dS)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)r;rr)r�hex_mac_tags  r �	hexverifyzKMAC_Hash.hexverifyus,��	
���I�g�k�2�2�3�3�4�4�4�4�4r"c�6�d|vr
|j|d<tdi|��S)zNReturn a new instance of a KMAC hash object.
        See :func:`new`.
        r�)rr5)r�kwargss  r r5z
KMAC_Hash.new�s,��
�F�"�"� $� 0�F�9���}�}�V�}�}�r"N)�__name__�
__module__�__qualname__�__doc__r!rr)r2r;r>r5r@r"r rr(s���������

&�
&�
&�������I�I�I�1�1�1�(5�5�5�����r"rc	���|�dd��}t|��std���t|��dkrt	d���|�dd��}|�dd��}|d	krt	d
���|�dd��}|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 KMAC128r4z1The 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$�lenr6�strrr	)rArrrrs     r r5r5�s���(�*�*�U�D�
!�
!�C��C�=�=�:��8�9�9�9�
�3�x�x�"�}�}��L�M�M�M��:�:�f�d�#�#�D��j�j��B�'�'�G���{�{��<�=�=�=�
�Z�Z��#�
&�
&�F�
�>��.��V���<�=�=�=��T�3����y�#�F�F�Fr"N)�binasciir�Crypto.Util.py3compatrrr�
Crypto.Randomrr+r	r
rrr
�objectrr5r@r"r �<module>rQs���>������9�9�9�9�9�9�9�9�9�9�*�*�*�*�*�*�!�!�!�!�!�!�!�!�;�;�;�;�;�;�;�;�;�;�c�c�c�c�c��c�c�c�L%G�%G�%G�%G�%Gr"

Filemanager

Name Type Size Permission Actions
BLAKE2b.cpython-311.pyc File 10.06 KB 0644
BLAKE2s.cpython-311.pyc File 10.07 KB 0644
CMAC.cpython-311.pyc File 11.67 KB 0644
HMAC.cpython-311.pyc File 7.71 KB 0644
KMAC128.cpython-311.pyc File 6.98 KB 0644
KMAC256.cpython-311.pyc File 2.13 KB 0644
KangarooTwelve.cpython-311.pyc File 9.55 KB 0644
MD2.cpython-311.pyc File 6.2 KB 0644
MD4.cpython-311.pyc File 6.68 KB 0644
MD5.cpython-311.pyc File 7.49 KB 0644
Poly1305.cpython-311.pyc File 9.63 KB 0644
RIPEMD.cpython-311.pyc File 410 B 0644
RIPEMD160.cpython-311.pyc File 6.45 KB 0644
SHA.cpython-311.pyc File 362 B 0644
SHA1.cpython-311.pyc File 7.53 KB 0644
SHA224.cpython-311.pyc File 7.79 KB 0644
SHA256.cpython-311.pyc File 7.78 KB 0644
SHA384.cpython-311.pyc File 7.78 KB 0644
SHA3_224.cpython-311.pyc File 6.92 KB 0644
SHA3_256.cpython-311.pyc File 6.92 KB 0644
SHA3_384.cpython-311.pyc File 7.14 KB 0644
SHA3_512.cpython-311.pyc File 6.93 KB 0644
SHA512.cpython-311.pyc File 8.58 KB 0644
SHAKE128.cpython-311.pyc File 4.53 KB 0644
SHAKE256.cpython-311.pyc File 4.53 KB 0644
TupleHash128.cpython-311.pyc File 4.91 KB 0644
TupleHash256.cpython-311.pyc File 1.84 KB 0644
__init__.cpython-311.pyc File 424 B 0644
cSHAKE128.cpython-311.pyc File 6.59 KB 0644
cSHAKE256.cpython-311.pyc File 1.11 KB 0644
keccak.cpython-311.pyc File 7.67 KB 0644