HEX
Server: LiteSpeed
System: Linux s3.sitechai.com 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: workzeni (2217)
PHP: 8.1.32
Disabled: mail, show_source, system, shell_exec, passthru, exec, eval, shell
Upload Files
File: //usr/lib64/python3.6/site-packages/borg/testsuite/__pycache__/crypto.cpython-36.opt-1.pyc
3

y��bD�@spddlmZmZddlmZmZmZmZmZm	Z	ddlm
Z
mZmZddlm
Z
ddlmZGdd	�d	e�Zd
S)�)�hexlify�	unhexlify�)�AES�
bytes_to_long�bytes_to_int�
long_to_bytes�hmac_sha256�blake2b_256)�increment_iv�bytes16_to_int�int_to_bytes16)�hkdf_hmac_sha512�)�BaseTestCasec@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�CryptoTestCasecCs|jtd�d�dS)Nsr)�assert_equalr)�self�r�/usr/lib64/python3.6/crypto.py�test_bytes_to_intsz CryptoTestCase.test_bytes_to_intcCs$|jtd�d�|jtd�d�dS)Nsr)rrr)rrrr�test_bytes_to_longsz!CryptoTestCase.test_bytes_to_longcCsD|jtd�d�|jtd�d�|jtd�d�|jtd�d�dS)Nsrsr�@ll)rrr
)rrrr�test_bytes16_to_intsz"CryptoTestCase.test_bytes16_to_intcCs�d}d}d}|jt|d�|�|jt|d�|�|jt|d�|�d}d}d	}|jt|d�|�|jt|d�|�|jt|d�|�|jt|d�|�dS)Nsssrrrs��������ssrl)rr)rZiv0Ziv1Ziv2ZivaZivbZivcrrr�test_increment_ivsz CryptoTestCase.test_increment_ivcCs�dd}dd}td|d�}|jt|jd�d�|j|�}|jt|�d	�|jt|jd�d
�td|d�}|jt|jd�d�|j|�}|j||�|jt|jd�d
�dS)N�X� sfoo�
T)Z
is_encrypt�key�rs<c6efb702de12498f34a2c2bbc8149e759996d08bf6dc5c610aefc0c3a466rF)rrrZivZencryptrZdecrypt)rr�dataZaesZcdataZpdatarrr�test_aes's

zCryptoTestCase.test_aescCs`d}ttd��}td�}td�}td�}td�}d}d	d
}td�}td�}d
d
}td�}dS)N��Z4869205468657265Z@b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7Z4a656665Z87768617420646f2079612077616e7420666f72206e6f7468696e673fZ@5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843�����2Z@773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565feZ20102030405060708090a0b0c0d0e0f10111213141516171819��Z@82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665bss��������������������)�
memoryviewr)rrr Zhmacrrr�test_hmac_sha2567szCryptoTestCase.test_hmac_sha256cCstd�}tdd�}dS)NZ@e944973af2256d4d670c12dd75304c319f58f4e40df6fb18ef996cb47e063676s
1234567890�d)rr()rrr rrr�test_blake2b_256QszCryptoTestCase.test_blake2b_256cCs2dd}tjd�}tjd�}d}t||||�}dS)Nr"��000102030405060708090a0b0c�f0f1f2f3f4f5f6f7f8f9�*)�bytes�fromhexr)r�ikm�salt�info�l�okmrrr�test_hkdf_hmac_sha512ds

z$CryptoTestCase.test_hkdf_hmac_sha512cCs4tjd�}tjd�}tjd�}d}t||||�}dS)NZ�000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4fZ�606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafZ�b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff�R)r0r1r)rr2r3r4r5r6rrr�test_hkdf_hmac_sha512_2ms


z&CryptoTestCase.test_hkdf_hmac_sha512_2cCs(tjd�}d}d}d}t||||�}dS)NZ,0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b�r/)r0r1r)rr2r3r4r5r6rrr�test_hkdf_hmac_sha512_3zs
z&CryptoTestCase.test_hkdf_hmac_sha512_3cCs4tjd�}tjd�}tjd�}d}t||||�}dS)NZ0b0b0b0b0b0b0b0b0b0b0br-r.r/)r0r1r)rr2r3r4r5r6rrr�test_hkdf_hmac_sha512_4�s


z&CryptoTestCase.test_hkdf_hmac_sha512_4cCs(tjd�}d}d}d}t||||�}dS)NZ,0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0cr:r/)r0r1r)rr2r3r4r5r6rrr�test_hkdf_hmac_sha512_5�s
z&CryptoTestCase.test_hkdf_hmac_sha512_5N)�__name__�
__module__�__qualname__rrrrr!r)r+r7r9r;r<r=rrrrr	s	
		rN)ZbinasciirrZcrypto.low_levelrrrrr	r
rrr
r�rrrrrr�<module>s