HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/cryptography/hazmat/primitives/kdf/__pycache__/pbkdf2.cpython-310.pyc
o

�)%a��@slddlmZddlmZmZmZmZddlmZddl	m
Z
ddlmZm
Z
ddlmZGdd�de�Zd	S)
�)�utils)�AlreadyFinalized�
InvalidKey�UnsupportedAlgorithm�_Reasons)�_get_backend)�PBKDF2HMACBackend)�
constant_time�hashes)�KeyDerivationFunctionc	@sTeZdZ	ddejdededefdd�Zded	efd
d�Zdeded	dfd
d�Z	dS)�
PBKDF2HMACN�	algorithm�length�salt�
iterationscCspt|�}t|t�stdtj��|�|�std�|j�tj	��d|_
||_||_t
�d|�||_||_||_dS)Nz4Backend object does not implement PBKDF2HMACBackend.z/{} is not supported for PBKDF2 by this backend.Fr)r�
isinstancerrr�BACKEND_MISSING_INTERFACE�pbkdf2_hmac_supported�format�name�UNSUPPORTED_HASH�_used�
_algorithm�_lengthr�_check_bytes�_salt�_iterations�_backend)�selfr
rrr�backend�r �K/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py�__init__s(
�
��
zPBKDF2HMAC.__init__�key_material�returncCs<|jrtd��d|_t�d|�|j�|j|j|j|j	|�S)Nz'PBKDF2 instances can only be used once.Tr#)
rrr�_check_bytesliker�derive_pbkdf2_hmacrrrr)rr#r r r!�derive2s�zPBKDF2HMAC.derive�expected_keycCs"|�|�}t�||�std��dS)NzKeys do not match.)r'r	�bytes_eqr)rr#r(�derived_keyr r r!�verify@s
�zPBKDF2HMAC.verify)N)
�__name__�
__module__�__qualname__r
�
HashAlgorithm�int�bytesr"r'r+r r r r!rs����
�rN)�cryptographyr�cryptography.exceptionsrrrr�cryptography.hazmat.backendsr�'cryptography.hazmat.backends.interfacesr�cryptography.hazmat.primitivesr	r
�"cryptography.hazmat.primitives.kdfrrr r r r!�<module>s