
    7g0                        d dl Z d dlmZ d dlZd dlmZ ej        j        Z	ej        j
        Zej        j        Zej        j        Zej        j        Zej        j        Zej        j        Zej        j        Zej        j        Zej        j        Zej        j        Zej        j        Z G d d          Z 	 	 	 	 	 	 dde!de!de"de"de"de"de"de!fdZ#dS )    N)NoReturn)bytes_as_stringc                       e Zd ZdZeZeZeZ	e
Zdedddfdededededef
dZed	efd
            Zed	efd            Zed	efd            Zded	dfdZd	efdZd	efdZddZd	efdZdS )blake2bzK
    :py:mod:`hashlib` API compatible blake2b algorithm implementation
        datadigest_sizekeysaltpersonc                 v    t          ||||          | _        || _        |r|                     |           dS dS )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
        )r
   r   r   r	   N)	_b2b_init_state_digest_sizeupdate)selfr   r	   r
   r   r   s         F/var/www/html/syslog/venv/lib/python3.11/site-packages/nacl/hashlib.py__init__zblake2b.__init__0   sW    :  $v;
 
 
 ( 	KK	 	r   returnc                     | j         S N)r   r   s    r   r	   zblake2b.digest_sizeU   s      r   c                     dS )N    r   s    r   
block_sizezblake2b.block_sizeY   s    sr   c                     dS )Nr   r   r   s    r   namezblake2b.name]   s    yr   Nc                 0    t          | j        |           d S r   )_b2b_updater   )r   r   s     r   r   zblake2b.updatea   s    DK&&&&&r   c                 R    | j                                         }t          |          S r   )r   copy
_b2b_final)r   _sts     r   digestzblake2b.digestd   s!    k  #r   c                 h    t          t          j        |                                                     S r   )r   binasciihexlifyr%   r   s    r   	hexdigestzblake2b.hexdigesth   s#    x/>>???r   c                      t          |           | j                  }| j                                        }||_        |S )N)r	   )typer	   r   r"   )r   _cpr$   s      r   r"   zblake2b.copyk   s<    d4jjT%5666k  

r   c                 Z    t          d                    | j        j                            )zc
        Raise the same exception as hashlib's blake implementation
        on copy.copy()
        zcan't pickle {} objects)	TypeErrorformat	__class____name__r   s    r   
__reduce__zblake2b.__reduce__q   s,    
 %,,T^-DEE
 
 	
r   )r   r   )r1   
__module____qualname____doc__BYTESMAX_DIGEST_SIZEKEYBYTES_MAXMAX_KEY_SIZEPERSONALBYTESPERSON_SIZE	SALTBYTES	SALT_SIZEbytesintr   propertyr	   r   strr   r   r%   r)   r"   r   r2   r   r   r   r   r   &   s         OLKI  # ## # 	#
 # # # # #J !S ! ! ! X! C    X c    X'5 'T ' ' ' '    @3 @ @ @ @   
H 
 
 
 
 
 
r   r   r               @   passwordr   nrpmaxmemdklenr   c           	      N    t           j                            | ||||||          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
    )rK   rL   )naclbindings%crypto_pwhash_scryptsalsa208sha256_ll)rG   r   rH   rI   rJ   rK   rL   s          r   scryptrQ   {   s2    $ =>>$1ae ?   r   )r   rB   rC   rD   rE   rF   )$r'   typingr   nacl.bindingsrN   
nacl.utilsr   rO   crypto_generichash_BYTESr6   crypto_generichash_BYTES_MIN	BYTES_MINcrypto_generichash_BYTES_MAX	BYTES_MAXcrypto_generichash_KEYBYTESKEYBYTEScrypto_generichash_KEYBYTES_MINKEYBYTES_MINcrypto_generichash_KEYBYTES_MAXr8   crypto_generichash_SALTBYTESr<    crypto_generichash_PERSONALBYTESr:   &has_crypto_pwhash_scryptsalsa208sha256SCRYPT_AVAILABLEcrypto_generichash_blake2b_initr    crypto_generichash_blake2b_finalr#   !crypto_generichash_blake2b_updater    r   r>   r?   rQ   r   r   r   <module>rf      sm               & & & & & &.M6	M6	=4}<}<M6	>=G M9	];
m=R
 R
 R
 R
 R
 R
 R
 R
n  
  	
         r   