https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/nacl/bindings/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/nacl/bindings/__pycache__/crypto_generichash.cpython-310.pyc
o

��a�"�
@s�UddlmZmZddlmZddlmZmZddl	m
Z
e��Ze
ed<e��Ze
ed<e��Ze
ed<e��Ze
ed<e��Ze
ed	<e��Ze
ed
<e��Ze
ed<e��Ze
ed<e��Ze
ed
<dZdZ de
de!de!de!ddf
dd�Z"edddfde!de
de!de!de!de!fdd�Z#eddd�Z$Gdd�d�Z%dddefde!de!de!de
de%f
d d!�Z&d"e%de!ddfd#d$�Z'd"e%de!fd%d&�Z(dS)'�)�NoReturn�TypeVar)�
exceptions)�ffi�lib)�ensure�crypto_generichash_BYTES�crypto_generichash_BYTES_MIN�crypto_generichash_BYTES_MAX�crypto_generichash_KEYBYTES�crypto_generichash_KEYBYTES_MIN�crypto_generichash_KEYBYTES_MAX�crypto_generichash_SALTBYTES� crypto_generichash_PERSONALBYTES�crypto_generichash_STATEBYTESz!{0} length greater than {1} bytesz{0} greater than {1}�digest_size�key�salt�person�returnNcCs�tt|t�dtjd�tt|t�dtjd�tt|t�dtjd�tt|t�dtjd�t|tkt�dt�tj	d�tt
|�tkt�dt�tj	d�tt
|�t
kt�dt
�tj	d�tt
|�tkt�d	t�tj	d�d
S)zCheck hash parameterszKey must be a bytes sequence��raisingzSalt must be a bytes sequencezPerson must be a bytes sequencez%Digest size must be an integer number�Digest_size�Key�Salt�PersonN)r�
isinstance�bytes�exc�	TypeError�intr
�_TOOBIG�format�
ValueError�lenr
�	_OVERLONGrr)rrrr�r&�B/usr/lib/python3/dist-packages/nacl/bindings/crypto_generichash.py�_checkparams)sP����
�

�

�


�r(��datac	
Cs�t||||�tt|t�dtjd�t�d|�}t�dt�}t�dt	�}t�
||t|��t�
||t|��t�
|||t|�|t|�||�}t|dkdtjd�t�||�dd�S)abOne shot hash interface

    :param data: the input data to the hash function
    :type data: bytes
    :param digest_size: must be at most
                        :py:data:`.crypto_generichash_BYTES_MAX`;
                        the default digest size is
                        :py:data:`.crypto_generichash_BYTES`
    :type digest_size: int
    :param key: must be at most
                :py:data:`.crypto_generichash_KEYBYTES_MAX` long
    :type key: bytes
    :param salt: must be at most
                 :py:data:`.crypto_generichash_SALTBYTES` long;
                 will be zero-padded if needed
    :type salt: bytes
    :param person: must be at most
                   :py:data:`.crypto_generichash_PERSONALBYTES` long:
                   will be zero-padded if needed
    :type person: bytes
    :return: digest_size long digest
    :rtype: bytes
    �#Input data must be a bytes sequencer�unsigned char[]�unsigned char []r�Unexpected failureN)r(rrrrrr�newrr�memmover$r�(crypto_generichash_blake2b_salt_personal�RuntimeError�buffer)	r*rrrr�digest�_salt�_person�rcr&r&r'�!generichash_blake2b_salt_personal^s ��r8�_Blake2State�Blake2State)�boundc@sFeZdZdZddgZdefdd�Zdefdd�Zd	e	de	fd
d�Z
dS)
r:zN
    Python-level wrapper for the crypto_generichash_blake2b state buffer
    �	_statebufrcCst�dt�|_||_dS)Nr,)rr/rr<r)�selfrr&r&r'�__init__�s�
zBlake2State.__init__rcCstd�|jj���)zc
        Raise the same exception as hashlib's blake implementation
        on copy.copy()
        zcan't pickle {} objects)rr"�	__class__�__name__)r=r&r&r'�
__reduce__�s�zBlake2State.__reduce__r=cCs"|�|j�}t�|j|jt�|S)N)r?rrr0r<r)r=�_str&r&r'�copy�s

�zBlake2State.copyN)r@�
__module__�__qualname__�__doc__�	__slots__r r>rrAr9rCr&r&r&r'r:�s	cCs�t||||�t|�}t�dt�}t�dt�}t�||t|��t�||t|��t�	|j
|t|�|||�}t|dkdtj
d�|S)a@
    Create a new initialized blake2b hash state

    :param key: must be at most
                :py:data:`.crypto_generichash_KEYBYTES_MAX` long
    :type key: bytes
    :param salt: must be at most
                 :py:data:`.crypto_generichash_SALTBYTES` long;
                 will be zero-padded if needed
    :type salt: bytes
    :param person: must be at most
                   :py:data:`.crypto_generichash_PERSONALBYTES` long:
                   will be zero-padded if needed
    :type person: bytes
    :param digest_size: must be at most
                        :py:data:`.crypto_generichash_BYTES_MAX`;
                        the default digest size is
                        :py:data:`.crypto_generichash_BYTES`
    :type digest_size: int
    :return: a initialized :py:class:`.Blake2State`
    :rtype: object
    r-rr.r)r(r:rr/rrr0r$r�-crypto_generichash_blake2b_init_salt_personalr<rrr2)rrrr�stater5r6r7r&r&r'�generichash_blake2b_init�s�rJrIcCsXtt|t�dtjd�tt|t�dtjd�t�|j|t	|��}t|dkdtj
d�dS)z�Update the blake2b hash state

    :param state: a initialized Blake2bState object as returned from
                     :py:func:`.crypto_generichash_blake2b_init`
    :type state: :py:class:`.Blake2State`
    :param data:
    :type data: bytes
    �"State must be a Blake2State objectrr+rr.N)rrr:rrrr�!crypto_generichash_blake2b_updater<r$r2)rIr*r7r&r&r'�generichash_blake2b_update�s
���rMcCs^tt|t�dtjd�t�dt�}t�	|j
||j�}t|dkdtjd�t�
||j�dd�S)a:Finalize the blake2b hash state and return the digest.

    :param state: a initialized Blake2bState object as returned from
                     :py:func:`.crypto_generichash_blake2b_init`
    :type state: :py:class:`.Blake2State`
    :return: the blake2 digest of the passed-in data stream
    :rtype: bytes
    rKrr,rr.N)rrr:rrrr/r
r� crypto_generichash_blake2b_finalr<rr2r3)rI�_digestr7r&r&r'�generichash_blake2b_finals
�
�rP))�typingrr�naclrr�nacl._sodiumrr�nacl.exceptionsr� crypto_generichash_blake2b_bytesrr �__annotations__�$crypto_generichash_blake2b_bytes_minr	�$crypto_generichash_blake2b_bytes_maxr
�#crypto_generichash_blake2b_keybytesr�'crypto_generichash_blake2b_keybytes_minr�'crypto_generichash_blake2b_keybytes_maxr
�$crypto_generichash_blake2b_saltbytesr�(crypto_generichash_blake2b_personalbytesr�crypto_generichash_statebytesrr%r!rr(r8r9r:rJrMrPr&r&r&r'�<module>s�

�
�
�����
�7������
�8�����
�0

https://t.me/RX1948 - 2025