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__/BLAKE2b.cpython-312.pyc
�

��e�$��~�ddlmZddlmZmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZedd�ZGd�de�Zd	�Zy
)�)�	unhexlify)�bord�tobytes)�get_random_bytes)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCryptodome.Hash._BLAKE2ba�
                        int blake2b_init(void **state,
                                         const uint8_t *key,
                                         size_t key_size,
                                         size_t digest_size);
                        int blake2b_destroy(void *state);
                        int blake2b_update(void *state,
                                           const uint8_t *buf,
                                           size_t len);
                        int blake2b_digest(const void *state,
                                           uint8_t digest[64]);
                        int blake2b_copy(const void *src, void *dst);
                        c�>�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�BLAKE2b_Hasha�A BLAKE2b hash object.
    Do not instantiate directly. Use the :func:`new` function.

    :ivar oid: ASN.1 Object ID
    :vartype oid: string

    :ivar block_size: the size in bytes of the internal message block,
                      input to the compression function
    :vartype block_size: integer

    :ivar digest_size: the size in bytes of the resulting hash
    :vartype digest_size: integer
    �@c	��||_||_d|_|dvr|sdt|�z|_t�}tj|j�t|�tt|��t|��}|rtd|z��t|j�tj�|_|r|j#|�yy)NF)�� �0rz1.3.6.1.4.1.1722.12.2.1.z$Error %d while instantiating BLAKE2b)�digest_size�_update_after_digest�_digest_done�str�oidr�_raw_blake2b_lib�blake2b_init�
address_ofr
r�len�
ValueErrorr	�get�blake2b_destroy�_state�update)�self�data�key�digest_bytes�update_after_digest�state�results       �9/usr/lib/python3/dist-packages/Cryptodome/Hash/BLAKE2b.py�__init__zBLAKE2b_Hash.__init__Ls���(���$7��!�!����+�+�C�1�C��4E�E�D�H��
��!�.�.�u�/?�/?�/A�/:�3�/?�/7��C��/A�/7��/E�1��
��C�f�L�M�M�"�5�9�9�;�#3�#C�#C�E�����K�K����c	��|jr|jstd��tj	|j
j
�t|�tt|���}|rtd|z��|S)z�Continue hashing of a message by consuming the next chunk of data.

        Args:
            data (bytes/bytearray/memoryview): The next chunk of the message being hashed.
        z8You can only call 'digest' or 'hexdigest' on this objectz#Error %d while hashing BLAKE2b data)rr�	TypeErrorr�blake2b_updater!rr
rrr)r#r$r)s   r*r"zBLAKE2b_Hash.updatefsn�����T�%>�%>��V�W�W�!�0�0������1B�1<�T�1B�19�#�d�)�1D�F����B�V�K�L�L��r,c���td�}tj|jj	�|�}|rtd|z��d|_t|�d|jS)z�Return the **binary** (non-printable) digest of the message that has been hashed so far.

        :return: The hash digest, computed over the data processed so far.
                 Binary form.
        :rtype: byte string
        rz&Error %d while creating BLAKE2b digestTN)	r
r�blake2b_digestr!rrrrr)r#�bfrr)s   r*�digestzBLAKE2b_Hash.digestxsc��#�2�&��!�0�0������1B�14�6����E��N�O�O� ����c�"�#4�D�$4�$4�5�5r,c	��djt|j��D�cgc]}dt|�z��c}�Scc}w)z�Return the **printable** digest of the message that has been hashed so far.

        :return: The hash digest, computed over the data processed so far.
                 Hexadecimal encoded.
        :rtype: string
        �z%02x)�join�tupler3r)r#�xs  r*�	hexdigestzBLAKE2b_Hash.hexdigest�s5���w�w�%����
�2F�G�Q���a��(�G�H�H��Gs�Ac���td�}td||��}td||j���}|j�|j�k7rtd��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.
        ��)�digest_bitsr%r$zMAC check failedN)r�newr3r)r#�mac_tag�secret�mac1�mac2s     r*�verifyzBLAKE2b_Hash.verify�sU��"�"�%���s��W�=���s��T�[�[�]�C���;�;�=�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)rCrr)r#�hex_mac_tags  r*�	hexverifyzBLAKE2b_Hash.hexverify�s��	
���I�g�k�2�3�4r,c�F�d|vrd|vr|j|d<tdi|��S)zQReturn a new instance of a BLAKE2b hash object.
        See :func:`new`.
        r&r=�)rr>)r#�kwargss  r*r>zBLAKE2b_Hash.new�s/��
��'�M��,G�%)�%5�%5�F�>�"��}�V�}�r,N)�__name__�
__module__�__qualname__�__doc__�
block_sizer+r"r3r9rCrFr>rHr,r*rr:s2����J��4�$6�&I�1�*5�r,rc��|jdd�}|jdd�}|jdd�}|jdd�}d||fvrtd��d||fk(rd	}|�"d
|cxkrd	ksDtd��td��d|cxkrd
krntd��|dzrtd��|dz}|jdd�}t|�d	kDrtd��|rtdt	|�z��t||||�S)a�Create a new hash object.

    Args:
        data (bytes/bytearray/memoryview):
            Optional. The very first chunk of the message to hash.
            It is equivalent to an early call to :meth:`BLAKE2b_Hash.update`.
        digest_bytes (integer):
            Optional. The size of the digest, in bytes (1 to 64). Default is 64.
        digest_bits (integer):
            Optional and alternative to ``digest_bytes``.
            The size of the digest, in bits (8 to 512, in steps of 8).
            Default is 512.
        key (bytes/bytearray/memoryview):
            Optional. The key to use to compute the MAC (1 to 64 bytes).
            If not specified, no key will be used.
        update_after_digest (boolean):
            Optional. By default, a hash object cannot be updated anymore after
            the digest is computed. When this flag is ``True``, such check
            is no longer enforced.

    Returns:
        A :class:`BLAKE2b_Hash` hash object
    r$Nr'Fr&r=z*Only one digest parameter must be provided)NNr�z!'digest_bytes' not in range 1..64�iz2'digest_bits' not in range 8..512, with steps of 8r%r,z"BLAKE2b key cannot exceed 64 byteszUnknown parameters: )�popr.rrrr)rIr$r'r&r=r%s      r*r>r>�s6��2�:�:�f�d�#�D� �*�*�%:�E�B���:�:�n�d�3�L��*�*�]�D�1�K��L�+�.�.��D�E�E���k�2�2������\�'�R�'��@�A�A�(��@�A�A��[�'�C�'��/�0�
0�.9�1�_��/�0�
0�"�a�'��
�*�*�U�C�
 �C�
�3�x�"�}��=�>�>�
��.��V��<�=�=���c�<�1D�E�Er,N)�binasciir�Cryptodome.Util.py3compatrr�Cryptodome.Randomr�Cryptodome.Util._raw_apirrr	r
rrr
r�objectrr>rHr,r*�<module>rXsI��>�3�.�/�/�/�-�-G��
�� H�6�H�V2Fr,

Youez - 2016 - github.com/yon3zu
LinuXploit