HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/root/lib/python3/dist-packages/nacl/__pycache__/hashlib.cpython-38.pyc
U

�֫[E�@s�ddlmZmZmZddlZddlZddlmZej	j
Zej	jZ
ej	jZej	jZej	jZej	jZej	jZej	jZej	jZej	jZej	jZej	j Z!Gdd�de"�Z#ddd
�Z$dS)�)�absolute_import�division�print_functionN)�bytes_as_stringc@sxeZdZdZeZeZeZ	e
Zdedddfdd�Ze
dd��Ze
dd��Ze
d	d
��Zdd�Zd
d�Zdd�Zdd�ZdS)�blake2bzK
    :py:mod:`hashlib` API compatible blake2b algorithm implementation
    �cCs*t||||d�|_||_|r&|�|�dS)ac
        :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: an 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
        )�key�salt�person�digest_sizeN)�	_b2b_init�_state�_digest_size�update)�self�datarrr	r
�r�./usr/lib/python3/dist-packages/nacl/hashlib.py�__init__.s�zblake2b.__init__cCs|jS�N)r�rrrrrLszblake2b.digest_sizecCsdS)N�rrrrr�
block_sizePszblake2b.block_sizecCsdS)Nrrrrrr�nameTszblake2b.namecCst|j|�dSr)�_b2b_updater
)rrrrrrXszblake2b.updatecCstj�|j�}t||j�Sr)�nacl�bindings�%crypto_generichash_blake2b_state_copyr
�
_b2b_finalr)r�_strrr�digest[szblake2b.digestcCstt�|����Sr)r�binasciiZhexlifyr rrrr�	hexdigest_szblake2b.hexdigestcCs$t|�|jd�}t|j�}||_|S)N)r)�typer�	_b2b_copyr
)rZ_cprrrr�copybs
zblake2b.copyN)�__name__�
__module__�__qualname__�__doc__�BYTESZMAX_DIGEST_SIZE�KEYBYTES_MAXZMAX_KEY_SIZE�
PERSONALBYTESZPERSON_SIZE�	SALTBYTESZ	SALT_SIZEr�propertyrrrrr r"r%rrrrr%s&�



r������@c	Cstjj|||||||d�S)z�
    Derive a cryptographic key using the scrypt KDF.

    Implements the same signature as the ``hashlib.scrypt`` implemented
    in cpython version 3.6
    )�maxmem�dklen)rrZ%crypto_pwhash_scryptsalsa208sha256_ll)Zpasswordr	�n�r�pr5r6rrr�scryptis�r:)r/r0r1r2r3r4)%Z
__future__rrrr!Z
nacl.bindingsrZ
nacl.utilsrrZcrypto_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_SALTBYTESr-Z crypto_generichash_PERSONALBYTESr,Zcrypto_generichash_blake2b_initrZ crypto_generichash_blake2b_finalrrr$Z!crypto_generichash_blake2b_updater�objectrr:rrrr�<module>s(D�