403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/Cryptodome/Hash/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/Cryptodome/Hash/__pycache__/Poly1305.cpython-312.pyc
�

��e����ddlmZddlmZmZmZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZmZedd�ZGd�d	e�Zd
�Zy)�)�	unhexlify)�bord�tobytes�_copy_bytes)�BLAKE2s)�get_random_bytes)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCryptodome.Hash._poly1305a�
                        int poly1305_init(void **state,
                                          const uint8_t *r,
                                          size_t r_len,
                                          const uint8_t *s,
                                          size_t s_len);
                        int poly1305_destroy(void *state);
                        int poly1305_update(void *state,
                                            const uint8_t *in,
                                            size_t len);
                        int poly1305_digest(const void *state,
                                            uint8_t *digest,
                                            size_t len);
                        c�>�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�Poly1305_MACz�An Poly1305 MAC object.
    Do not instantiate directly. Use the :func:`new` function.

    :ivar digest_size: the size in bytes of the resulting MAC tag
    :vartype digest_size: integer
    �c���t|�dk7rtd��t|�dk7rtd��d|_t�}tj|j
�t|�tt|��t|�tt|���}|rtd|z��t|j�tj�|_|r|j|�yy)Nrz Parameter r is not 16 bytes longz Parameter s is not 16 bytes longz%Error %d while instantiating Poly1305)�len�
ValueError�_mac_tagr
�
_raw_poly1305�
poly1305_init�
address_ofrrr�get�poly1305_destroy�_state�update)�self�r�s�data�state�results      �:/usr/lib/python3/dist-packages/Cryptodome/Hash/Poly1305.py�__init__zPoly1305_MAC.__init__?s����q�6�R�<��?�@�@��q�6�R�<��?�@�@���
��
���,�,�U�-=�-=�-?�-8��^�-5�c�!�f�-=�-8��^�-5�c�!�f�-=�	/����D�v�M�N�N�"�5�9�9�;�#0�#A�#A�C�����K�K����c	���|jrtd��tj|jj�t
|�tt|���}|rtd|z��|S)z�Authenticate the next chunk of message.

        Args:
            data (byte string/byte array/memoryview): The next chunk of data
        z8You can only call 'digest' or 'hexdigest' on this objectz$Error %d while hashing Poly1305 data)
r�	TypeErrorr�poly1305_updaterrrrrr)rr!r#s   r$rzPoly1305_MAC.updateVsd���=�=��V�W�W��.�.�t�{�{���/@�/:�4�/@�/7��D�	�/B�D����C�f�L�M�M��r&c��t��)N)�NotImplementedError)rs r$�copyzPoly1305_MAC.copygs��!�#�#r&c	�"�|jr|jStd�}tj|jj�|t
t|���}|rtd|z��t|�|_|jS)z�Return the **binary** (non-printable) MAC tag of the message
        authenticated so far.

        :return: The MAC tag digest, computed over the data processed so far.
                 Binary form.
        :rtype: byte string
        rz'Error %d while creating Poly1305 digest)
rrr�poly1305_digestrrrrrr
)r�bfrr#s   r$�digestzPoly1305_MAC.digestjsx���=�=��=�=� �"�2�&���.�.�t�{�{���/@�/2�/7��C��/A�C����F��O�P�P�&�s�+��
��}�}�r&c	��djt|j��D�cgc]}dt|�z��c}�Scc}w)z�Return the **printable** MAC tag of the message authenticated so far.

        :return: The MAC tag, computed over the data processed so far.
                 Hexadecimal encoded.
        :rtype: string
        �z%02x)�join�tupler0r)r�xs  r$�	hexdigestzPoly1305_MAC.hexdigest�sD���w�w�!&�t�{�{�}�!5�7����a��(�7�8�	8��7s�Ac���td�}tjd||��}tjd||j���}|j�|j�k7rt	d��y)ahVerify that a given **binary** MAC (computed by another party)
        is valid.

        Args:
          mac_tag (byte string/byte string/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.
        r�)�digest_bits�keyr!zMAC check failedN)rr�newr0r)r�mac_tag�secret�mac1�mac2s     r$�verifyzPoly1305_MAC.verify�s]��"�"�%���{�{�s��W�E���{�{�s��T�[�[�]�K���;�;�=�D�K�K�M�)��/�0�0�*r&c�J�|jtt|���y)a~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)r@rr)r�hex_mac_tags  r$�	hexverifyzPoly1305_MAC.hexverify�s��	
���I�g�k�2�3�4r&N)�__name__�
__module__�__qualname__�__doc__�digest_sizer%rr,r0r6r@rC�r&r$rr5s1����K��.�"$��,	8�1�(
5r&rc�z�|jdd�}t|d�std��|jdd�}|�td��|jdd�}|jdd�}|rtd	t	|�z��|j||�\}}}t
|||�}tdd|�|_|S)
a�Create a new Poly1305 MAC object.

    Args:
        key (bytes/bytearray/memoryview):
            The 32-byte key for the Poly1305 object.
        cipher (module from ``Cryptodome.Cipher``):
            The cipher algorithm to use for deriving the Poly1305
            key pair *(r, s)*.
            It can only be ``Cryptodome.Cipher.AES`` or ``Cryptodome.Cipher.ChaCha20``.
        nonce (bytes/bytearray/memoryview):
            Optional. The non-repeatable value to use for the MAC of this message.
            It must be 16 bytes long for ``AES`` and 8 or 12 bytes for ``ChaCha20``.
            If not passed, a random nonce is created; you will find it in the
            ``nonce`` attribute of the new object.
        data (bytes/bytearray/memoryview):
            Optional. The very first chunk of the message to authenticate.
            It is equivalent to an early call to ``update()``.

    Returns:
        A :class:`Poly1305_MAC` object
    �cipherN�_derive_Poly1305_key_pairz*Parameter 'cipher' must be AES or ChaCha20r:zYou must pass a parameter 'key'�noncer!zUnknown parameters: )	�pop�hasattrrr(�strrLrrrM)�kwargsrK�
cipher_keyrMr!rr �new_macs        r$r;r;�s���.�Z�Z��$�
'�F��6�6�7��E�F�F����E�4�(�J����9�:�:��J�J�w��%�E��:�:�f�d�#�D�
��.��V��<�=�=��2�2�:�u�E�K�A�q�%��1�a��&�G���d�E�2�G�M��Nr&N)�binasciir�Cryptodome.Util.py3compatrrr�Cryptodome.Hashr�Cryptodome.Randomr�Cryptodome.Util._raw_apir	r
rrr
rrr�objectrr;rIr&r$�<module>rZsM��.�@�@�#�.�/�/�/�*�*E�
��
�"w5�6�w5�v)r&

Youez - 2016 - github.com/yon3zu
LinuXploit