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: //usr/lib/python3/dist-packages/bcrypt/__pycache__/__init__.cpython-38.pyc
U

k9_��@s�ddlmZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZddd	d
ddd
dddddgZe�d�Zd"eeed�dd�Zeeed�dd�Zeeed�dd�Zd#eeeeeed�dd�Zedd�d d!�ZdS)$�)�absolute_import)�divisionN�)�_bcrypt)�
__author__�
__copyright__�	__email__�__license__�__summary__�	__title__�__uri__�__version__rr
rr
rrr	r�gensalt�hashpw�kdf�checkpws^\$2y\$��2b)�rounds�prefix�returncCs~|dkrtd��|dks |dkr(td��t�d�}tj�dd�}tj�||t|��d	|d	d
|�	d�d	tj�
|�S)N)s2arz%Supported prefixes are b'2a' or b'2b'��zInvalid rounds��char[]��$z%2.2u�ascii)�
ValueError�os�urandomr�ffi�new�lib�
encode_base64�len�encode�string)rr�salt�output�r*�1/usr/lib/python3/dist-packages/bcrypt/__init__.pyr9s&
����
��)�passwordr(rcCs�t|tj�st|tj�r td��d|kr0td��|dd�}|t�d|�}}tj�	dd�}tj
�|||t|��}|dkr�td	��|dd
�tj�
|�d
d�S)N�.Unicode-objects must be encoded before hashing�z"password may not contain NUL bytes�Hs$2b$r�rzInvalid saltr)�
isinstance�six�	text_type�	TypeErrorr�
_normalize_re�subrr!r"r#Zbcrypt_hashpassr%r')r,r(Z
original_saltZhashed�retvalr*r*r+rNs)r,�hashed_passwordrcCsnt|tj�st|tj�r td��d|ks0d|kr8td��t||�}t|�t|�krVdStj�	||t|��dkS)Nz/Unicode-objects must be encoded before checkingr.z6password and hashed_password may not contain NUL bytesFr)
r1r2r3r4rrr%rr#Ztimingsafe_bcmp)r,r8�retr*r*r+rts��
F)r,r(�desired_key_bytesr�ignore_few_roundsrc	Cs�t|tj�st|tj�r td��t|�dks8t|�dkr@td��|dksP|dkrXtd��|dkrhtd��|dkr�|s�tjd	�|�t	d
d�t
j�d|�}t
j
�|t|�|t|�|t|�|�}t|dk�t
j�||�dd�S)
Nr-rz#password and salt must not be emptyizdesired_key_bytes must be 1-512rzrounds must be 1 or more�2zrWarning: bcrypt.kdf() called with only {0} round(s). This few is not secure: the parameter is linear, like PBKDF2.�)�
stacklevelz	uint8_t[])r1r2r3r4r%r�warnings�warn�format�UserWarningrr!r"r#Zbcrypt_pbkdf�_bcrypt_assert�buffer)r,r(r:rr;�key�resr*r*r+r�s:���	�)�okrcCs|std��dS)Nzbcrypt assertion failed)�SystemError)rGr*r*r+rC�srC)rr)F)�
__future__rrr�rer?r2�r�	__about__rrrr	r
rrr
�__all__�compiler5�int�bytesrr�boolrrrCr*r*r*r+�<module>sD(
�
&��)