Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/nacl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/nacl/__pycache__/hashlib.cpython-38.pyc
U

O��g0�
@s�ddlZddlmZddlZddlmZejjZ	ejj
ZejjZ
ejjZejjZejjZejjZejjZejjZejjZejjZejjZGdd�d�Z de!e!e"e"e"e"e"e!d�d
d�Z#dS)�N)�NoReturn)�bytes_as_stringc@s�eZdZdZeZeZeZ	e
Zdedddfee
eeed�dd�Zee
d�dd��Zee
d�d	d
��Zeed�dd��Zed
d�dd�Zed�dd�Zed�dd�Zdd�dd�Zed�dd�Zd
S)�blake2bzK
    :py:mod:`hashlib` API compatible blake2b algorithm implementation
    �)�data�digest_size�key�salt�personcCs*t||||d�|_||_|r&|�|�dS)ab
        :py:class:`.blake2b` algorithm initializer

        :param data:
        :type data: bytes
        :param int digest_size: the requested digest size; must be
                                at most :py:attr:`.MAX_DIGEST_SIZE`;
                                the default digest size is :py:data:`.BYTES`
        :param key: the key to be set for keyed MAC/PRF usage; if set,
                    the key must be at most :py:data:`.KEYBYTES_MAX` long
        :type key: bytes
        :param salt: a initialization salt at most
                     :py:attr:`.SALT_SIZE` long; it will be zero-padded
                     if needed
        :type salt: bytes
        :param person: a personalization string at most
                       :py:attr:`.PERSONAL_SIZE` long; it will be zero-padded
                       if needed
        :type person: bytes
        )rr	r
rN)�	_b2b_init�_state�_digest_size�update)�selfrrrr	r
�r�9/opt/cppython/lib/python3.8/site-packages/nacl/hashlib.py�__init__0s�zblake2b.__init__)�returncCs|jS�N)r
�rrrrrUszblake2b.digest_sizecCsdS)N�rrrrr�
block_sizeYszblake2b.block_sizecCsdS)Nrrrrrr�name]szblake2b.nameN)rrcCst|j|�dSr)�_b2b_updater)rrrrrraszblake2b.updatecCs|j��}t|�Sr)r�copy�
_b2b_final)r�_strrr�digestds
zblake2b.digestcCstt�|����Sr)r�binascii�hexlifyrrrrr�	hexdigesthszblake2b.hexdigestcCs$t|�|jd�}|j��}||_|S)N)r)�typerrr)rZ_cprrrrrks
zblake2b.copycCstd�|jj���dS)zc
        Raise the same exception as hashlib's blake implementation
        on copy.copy()
        zcan't pickle {} objectsN)�	TypeError�format�	__class__�__name__rrrr�
__reduce__qs�zblake2b.__reduce__)r%�
__module__�__qualname__�__doc__�BYTES�MAX_DIGEST_SIZE�KEYBYTES_MAX�MAX_KEY_SIZE�
PERSONALBYTES�PERSON_SIZE�	SALTBYTES�	SALT_SIZE�bytes�intr�propertyrr�strrrrr rrr&rrrrr&s8��%rr�����@)�passwordr	�n�r�p�maxmem�dklenrc	Cstjj|||||||d�S)a
    Derive a cryptographic key using the scrypt KDF.

    :raises nacl.exceptions.UnavailableError: If called when using a
        minimal build of libsodium.

    Implements the same signature as the ``hashlib.scrypt`` implemented
    in cpython version 3.6
    )r?r@)�nacl�bindingsZ%crypto_pwhash_scryptsalsa208sha256_ll)r;r	r<r=r>r?r@rrr�scrypt{s�rC)rr6r7r8r9r:)$r�typingrZ
nacl.bindingsrAZ
nacl.utilsrrBZcrypto_generichash_BYTESr*Zcrypto_generichash_BYTES_MINZ	BYTES_MINZcrypto_generichash_BYTES_MAXZ	BYTES_MAXZcrypto_generichash_KEYBYTESZKEYBYTESZcrypto_generichash_KEYBYTES_MINZKEYBYTES_MINZcrypto_generichash_KEYBYTES_MAXr,Zcrypto_generichash_SALTBYTESr0Z crypto_generichash_PERSONALBYTESr.Z&has_crypto_pwhash_scryptsalsa208sha256ZSCRYPT_AVAILABLEZcrypto_generichash_blake2b_initrZ crypto_generichash_blake2b_finalrZ!crypto_generichash_blake2b_updaterrr2r3rCrrrr�<module>s@W��

F1le Man4ger