Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE 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&