| Server IP : 104.21.25.182 / Your IP : 216.73.216.214 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.9/site-packages/passlib/tests/__pycache__/ |
Upload File : |
a
f�Wch � @ s^ d Z ddlmZ ddlZddlZe�e�ZddlZddl Z e �
dd� ddlmZ ddl
mZ ddlmZmZmZ dd lmZ dd
lmZmZmZmZ ddlmZ g d�Zd
d� Zd&dd�Zdd� Z G dd� de�Z!G dd� de�Z"dd� Z#e#� Z$dd� Z%e%� Z&ee�pedd�d�G dd� de"��Z'ee$d �G d!d"� d"e"��Z(ee&d#�G d$d%� d%e"��Z)dS )'ztests for passlib.utils.scrypt� )�hexlifyN�ignorez .*using builtin scrypt backend.*)�exc)�getrandbytes)�PYPY�u�
bascii_to_str)�
classproperty)�TestCase�
skipUnless� TEST_MODE�hb��scrypt)�ScryptEngineTest�BuiltinScryptTestZFastScryptTestc C s t t| ��S )zreturn bytes as hex str)r r )�data� r �D/usr/lib/python3.9/site-packages/passlib/tests/test_crypto_scrypt.py�hexstr s r c C s0 t | �d }|du s ||ks J �t�d| | �S )z%unpack bytes as list of uint32 values� Nz<%dI)�len�struct�unpack)r Zcheck_count�countr r r �unpack_uint32_list# s r c C s\ t | d�r| �d�} d}d}t|�|k rP|t�| t�d|� ��� 7 }|d7 }q|d|� S )zr
generate random reference bytes from specified seed.
used to generate some predictable test vectors.
�encode�ascii� r z<I� N)�hasattrr r �hashlibZsha256r �pack�digest)Zseedr �buf�ir r r �
seed_bytes) s
r&