Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_crypt.cpython-38.opt-1.pyc
U

>��g��
@s�ddlZddlZzddlZdZWnFek
rfZz(ejdkrJe�ee���dZee�ZW5dZ[XYnXe�	ejdkd�e�
ed�Gdd�dej���Ze�	ed�Gdd	�d	ej��Z
ed
kr�e��dS)�N�win32zThis should only run on windowszimport succeededc@seZdZdd�ZdS)�TestWhyCryptDidNotImportcCs|�dt�dS)Nz
not supported)�assertIn�IMPORT_ERROR��self�r�./opt/cppython/lib/python3.8/test/test_crypt.py�test_import_failure_messagesz4TestWhyCryptDidNotImport.test_import_failure_messageN)�__name__�
__module__�__qualname__r
rrrr	rsrzcrypt module is requiredc@s�eZdZdd�Zdd�Zdd�Zdd�Ze�e	oFe	j
e	jkpFe	je	jkd	�d
d��Z
e�e	ofe	je	jkd�d
d��Zdd�ZdS)�
CryptTestCasecCsRt�d�}t�d|�}|�||�t�dd�}|dk	rNt�d|�}|�||�dS)N�
mypassword�ab)�crypt�assertEqual)r�cr�cr2rrr	�
test_crypts
zCryptTestCase.test_cryptc
Cst|�ttj�d�tjD]V}t�|�}|�t|�|jddddddh�|jr|�|j|dt|�|j��qdS)N�@r�����)	r�lenrZ
_saltchars�methods�mksaltr�
salt_chars�ident)r�method�saltrrr	�	test_salt#s

"zCryptTestCase.test_saltcCsjtjD]^}t�d|�}|�t|�|j�t�d|�}|�||�t�dt�|��}|�t|�|j�qdS)NZassword)rrrrZ
total_sizer)rr!rrrrr	�test_saltedcrypt+s
zCryptTestCase.test_saltedcryptcCsL|�ttj�dk�tj�d�r4|�tjtjg�n|�tjdtj	�dS)NrZopenbsd���)
�
assertTruerrr�sys�platform�
startswithr�METHOD_BLOWFISH�METHOD_CRYPTrrrr	�test_methods4szCryptTestCase.test_methodszrequires support of SHA-2c	Cs�tjtjfD]|}dD]r}tj||d�}|�d||�|�t|�|jdtt|���t�d|�}|�	|�t�d|�}|�||�qqdS)N)��i'i����roundsz$rounds=%d$�r)
r�
METHOD_SHA256�
METHOD_SHA512rrrrr�strr&)rr!r/r"rrrrr	�test_sha2_rounds;s�
zCryptTestCase.test_sha2_roundszrequires support of BlowfishcCs�tdd�D]r}tjtjd|>d�}|�d||�|�t|�tjjddh�t�d|�}|�|�t�d|�}|�||�q
dS)	Nrr0rr.z$%02d$rrr)	�rangerrr*rrrr&r)rZ
log_roundsr"rrrrr	�test_blowfish_roundsNs
z"CryptTestCase.test_blowfish_roundscCs�tjtjtjfD]�}|�t��tj|dd�W5QRX|�t��tj|dd�W5QRXddddd>fD](}|�t��tj||d�W5QRXqlq|�t��tjtjdd�W5QRXtjtj	fD]*}|�
td	��tj|d
d�W5QRXq�dS)NZ4096r.g�@rrr%i�r-�supporti)rr1r2r*ZassertRaises�	TypeErrorr�
ValueErrorr+Z
METHOD_MD5ZassertRaisesRegex)rr!r/rrr	�test_invalid_rounds[s�z!CryptTestCase.test_invalid_roundsN)rrr
rr#r$r,�unittest�
skipUnlessrr1rr2r4r*r6r:rrrr	rs 		�
�

r�__main__)r'r;rr�ImportError�exr(ZSkipTestr3r<ZskipIfZTestCaserrr�mainrrrr	�<module>s 


T

F1le Man4ger