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-312.pyc
�

k9_��
��ddlmZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZgd�Zej&d�Zdd	ed
edefd�Zd
ededefd�Zd
ededefd�Z	dd
ededed	ededefd�Zdeddfd�Zy)�)�absolute_import)�divisionN�)�_bcrypt)�
__author__�
__copyright__�	__email__�__license__�__summary__�	__title__�__uri__�__version__)rrr
rrr	r
r�gensalt�hashpw�kdf�checkpws^\$2y\$�rounds�prefix�returnc��|dvrtd��|dks|dkDrtd��tjd�}tjjdd�}tjj||t|��d	|zd	zd
|zjd�zd	ztjj|�zS)N)s2a�2bz%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�outputs    �1/usr/lib/python3/dist-packages/bcrypt/__init__.pyrr9s���
�^�#��@�A�A�
��z�V�b�[��)�*�*�
�:�:�b�>�D�
�[�[�_�_�X�r�
*�F��K�K���f�d�C��I�6�	
�
�	�
�	��V��
#�
#�G�
,�	-��		�
�+�+�
�
�V�
$�	%���passwordr)c���t|tj�st|tj�rtd��d|vrt	d��|dd}|t
j
d|�}}tjjdd�}tjj|||t|��}|dk7rt	d	��|dd
tjj|�d
dzS)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$�bcrypt_hashpassr&r()r-r)�
original_salt�hashed�retvals     r+rrNs����(�C�M�M�*�j��s�}�}�.M��H�I�I��(���=�>�>����}�H��
� 1� 1�'�4� @�4�M�
�[�[�_�_�X�s�
+�F�
�[�[�
(�
(��4���V��
M�F�
��{���(�(���!��w�{�{�1�1�&�9�!�"�=�=�=r,�hashed_passwordc�H�t|tj�st|tj�rtd��d|vsd|vrt	d��t||�}t
|�t
|�k7rytjj||t
|��dk(S)Nz/Unicode-objects must be encoded before checkingr0z6password and hashed_password may not contain NUL bytesFr)
r3r4r5r6rrr&rr$�timingsafe_bcmp)r-r=�rets   r+rrts����(�C�M�M�*�j�����/��I�J�J��(��g��8��D�
�	
���?�
+�C�
�3�x�3��'�'���;�;�&�&�s�O�S��X�F�!�K�Kr,�desired_key_bytes�ignore_few_roundsc
��t|tj�st|tj�rtd��t	|�dk(st	|�dk(rtd��|dks|dkDrtd��|dkrtd��|dkr-|s+t
jd	j|�td
��tjjd|�}tjj|t	|�|t	|�|t	|�|�}t|dk(�tjj!||�ddS)
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[])r3r4r5r6r&r�warnings�warn�format�UserWarningrr"r#r$�bcrypt_pbkdf�_bcrypt_assert�buffer)r-r)rArrB�key�ress       r+rr�s���(�C�M�M�*�j��s�}�}�.M��H�I�I�
�8�}���S��Y�!�^��>�?�?��A��!2�S�!8��:�;�;�
��z��3�4�4�
��{�,�	�
�
�P��f�V�n���
	
��+�+�/�/�+�'8�
9�C�
�+�+�
"�
"��#�h�-��s�4�y�#�s�3�x���C��3�!�8���;�;���c�#4�5�a�8�8r,�okc��|std��y)Nzbcrypt assertion failed)�SystemError)rPs r+rLrL�s��
��3�4�4�r,)�r)F)�
__future__rrr �rerGr4�r�	__about__rrr	r
rrr
r�__all__�compiler7�int�bytesrr�boolrrrL�r,r+�<module>r^s��� '��	�	��
��	�	�	�
�� ��
�
�;�'�
��C��e����*#>�U�#>�%�#>�E�#>�LL�e�L�e�L��L�0$�&9��&9�
�&9��&9�
�	&9�
�&9��
&9�R5�t�5��5r,