403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/Cryptodome/SelfTest/Util/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/Cryptodome/SelfTest/Util/__pycache__/test_strxor.cpython-311.pyc
�

8�tc�'����ddlZddlmZmZddlmZddlmZmZGd�dej	��Z
Gd�dej	��Zifd	�Ze
d
krd�Zejd�
��dSdS)�N)�	unhexlify�hexlify)�list_test_cases)�strxor�strxor_cc�\�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�ZdS)�StrxorTestsc���td��}td��}td��}|�t||��|��|�t||��|��dS�N�ff339a83e5cd4cdf5649�383d4ba020573314395b�c70ed123c59a7fcb6f12)r�assertEqualr)�self�term1�term2�results    �F/usr/lib/python3/dist-packages/Cryptodome/SelfTest/Util/test_strxor.py�test1zStrxorTests.test1+sr���1�2�2���1�2�2���2�3�3�������u�-�-�v�6�6�6������u�-�-�v�6�6�6�6�6�c�R�d}|�t||��|��dS)Nr)rr)r�ess  r�test2zStrxorTests.test22s+��
�������B����,�,�,�,�,rc��td��}dt|��z}|�t||��|��dS)Nr�)r�lenrr)rr�	all_zeross   r�test3zStrxorTests.test36sF���1�2�2���c�%�j�j�(�	������u�-�-�y�9�9�9�9�9rc��td��}td��}|�tt||��dS)Nrsff339a83e5cd4cdf564990)r�assertRaises�
ValueErrorr�rrrs   r�test_wrong_lengthzStrxorTests.test_wrong_length;s>���1�2�2���3�4�4�����*�f�e�U�;�;�;�;�;rc���td��}t|��}td��}td��}|�t||��|��dSr)r�	bytearrayrr)rr�term1_barrs     r�test_bytearrayzStrxorTests.test_bytearray@s_���1�2�2���U�#�#���1�2�2���2�3�3�������%�0�0�&�9�9�9�9�9rc���td��}t|��}td��}td��}|�t||��|��dSr)r�
memoryviewrr)rr�term1_mvrrs     r�test_memoryviewzStrxorTests.test_memoryviewHs_���1�2�2���e�$�$���1�2�2���2�3�3�������%�0�0�&�9�9�9�9�9rc��td��}td��}|dd�}|dd�}td��}tt|����}t|||���}|�|d��|�||��|�||��|�||��dS�z3Verify result can be stored in pre-allocated memoryrr
Nr��output)rr%rrr�rrr�original_term1�original_term2�expected_xorr/rs        r�test_output_bytearrayz!StrxorTests.test_output_bytearrayPs����1�2�2���1�2�2���q�q�q����q�q�q��� �!8�9�9���3�u�:�:�&�&����u�V�4�4�4�������&�&�&������.�.�.������/�/�/������/�/�/�/�/rc��td��}td��}|dd�}|dd�}td��}ttt|������}t	|||���}|�|d��|�||��|�||��|�||��dSr-)rr)r%rrrr0s        r�test_output_memoryviewz"StrxorTests.test_output_memoryviewas����1�2�2���1�2�2���q�q�q����q�q�q��� �!8�9�9���I�c�%�j�j�1�1�2�2����u�V�4�4�4�������&�&�&������.�.�.������/�/�/������/�/�/�/�/rc�6�ttd����}td��}|dd�}td��}t|||���}|�|d��|�||��|�||��dS��1Verify result can be stored in overlapping memoryrr
Nrr.)r%rrr�rrrr2r3rs      r�!test_output_overlapping_bytearrayz-StrxorTests.test_output_overlapping_bytearrayrs����)�$;�<�<�=�=���1�2�2���q�q�q��� �!8�9�9����u�U�3�3�3�������&�&�&������-�-�-������/�/�/�/�/rc�P�tttd������}td��}|dd�}td��}t|||���}|�|d��|�||��|�||��dSr8)r)r%rrrr:s      r�"test_output_overlapping_memoryviewz.StrxorTests.test_output_overlapping_memoryview�s����9�Y�/F�%G�%G�H�H�I�I���1�2�2���q�q�q��� �!8�9�9����u�U�3�3�3�������&�&�&������-�-�-������/�/�/�/�/rc��td��}td��}|�tt|||���dS��2Verify result cannot be stored in read-only memoryrr
r.N)rr �	TypeErrorrr"s   r�test_output_ro_bytesz StrxorTests.test_output_ro_bytes�sE���1�2�2���1�2�2�����)�V�U�E�%��H�H�H�H�Hrc��ttd����}td��}|�tt|||���dSr?)r)rr rArr"s   r�test_output_ro_memoryviewz%StrxorTests.test_output_ro_memoryview�sM���9�%<�=�=�>�>���1�2�2�����)�V�U�E�%��H�H�H�H�Hrc���td��}td��}tt|��dz
��}|�tt
|||���dS)�<Verify result cannot be stored in memory of incorrect lengthrr
�r.N)rr%rr r!r)rrrr/s    r�test_output_incorrect_lengthz(StrxorTests.test_output_incorrect_length�s\���1�2�2���1�2�2���3�u�:�:��>�*�*�����*�f�e�U�6��J�J�J�J�JrN)�__name__�
__module__�__qualname__rrrr#r'r+r4r6r;r=rBrDrH�rrr	r	)s�������7�7�7�-�-�-�:�:�:�
<�<�<�
:�:�:�:�:�:�0�0�0�"0�0�0�"0�0�0�0�0�0�I�I�I�I�I�I�K�K�K�K�Krr	c�\�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�ZdS)�
Strxor_cTestsc��td��}td��}|�t|d��|��dS�Nr�be72dbc2a48c0d9e1708�A�rrr)rrrs   rrzStrxor_cTests.test1�sD���1�2�2���2�3�3������%��,�,�f�5�5�5�5�5rc�l�td��}|�t|d��|��dS)NrrrS�rrs  rrzStrxor_cTests.test2�s6���1�2�2������%��+�+�U�3�3�3�3�3rc�N�|�tdd��d��dS)Nr�Z)rr)rs rrzStrxor_cTests.test3�s(������#�r�*�*�C�0�0�0�0�0rc��td��}|�tt|d��|�tt|d��dS)Nr����)rr r!rrUs  r�test_wrong_rangezStrxor_cTests.test_wrong_range�sJ���1�2�2�����*�h��r�:�:�:����*�h��s�;�;�;�;�;rc��td��}t|��}td��}|�t|d��|��dSrP)rr%rr)rrr&rs    rr'zStrxor_cTests.test_bytearray�sQ���1�2�2���U�#�#���2�3�3������(�B�/�/��8�8�8�8�8rc��td��}t|��}td��}|�t|d��|��dSrP)rr)rr)rrr*rs    rr+zStrxor_cTests.test_memoryview�sQ���1�2�2���e�$�$���2�3�3������(�B�/�/��8�8�8�8�8rc�6�td��}|dd�}td��}tt|����}t|d|���}|�|d��|�||��|�||��dS�NrrQrRr.)rr%rrr�rrr1�expected_resultr/rs      rr4z#Strxor_cTests.test_output_bytearray�s����1�2�2���q�q�q���#�$;�<�<���3�u�:�:�&�&���%��F�3�3�3�������&�&�&������1�1�1������/�/�/�/�/rc�P�td��}|dd�}td��}ttt|������}t	|d|���}|�|d��|�||��|�||��dSr_)rr)r%rrrr`s      rr6z$Strxor_cTests.test_output_memoryview�s����1�2�2���q�q�q���#�$;�<�<���I�c�%�j�j�1�1�2�2���%��F�3�3�3�������&�&�&������1�1�1������/�/�/�/�/rc���ttd����}td��}t|d|���}|�|d��|�||��dS�r9rrQrRr.N)r%rrr�rrr3rs    rr;z/Strxor_cTests.test_output_overlapping_bytearray�sn���)�$;�<�<�=�=�� �!8�9�9���%��E�2�2�2�������&�&�&������-�-�-�-�-rc���tttd������}td��}t|d|���}|�|d��|�||��dSrd)r)r%rrrres    rr=z0Strxor_cTests.test_output_overlapping_memoryview�sv���9�Y�/F�%G�%G�H�H�I�I�� �!8�9�9���%��E�2�2�2�������&�&�&������-�-�-�-�-rc�l�td��}|�tt|d|���dS)r@rrRr.N)rr rArrUs  rrBz"Strxor_cTests.test_output_ro_bytes�s7���1�2�2�����)�X�u�b���G�G�G�G�Grc��ttd����}td��}|�tt|d|���dS)r@rr
rRr.N)r)rr rArr"s   rrDz'Strxor_cTests.test_output_ro_memoryview�sM���9�%<�=�=�>�>���1�2�2�����)�X�u�b���G�G�G�G�Grc��td��}tt|��dz
��}|�tt
|d|���dS)rFrrGrRr.N)rr%rr r!r)rrr/s   rrHz*Strxor_cTests.test_output_incorrect_lengthsN���1�2�2���3�u�:�:��>�*�*�����*�h��r�&��I�I�I�I�IrN)rIrJrKrrrr[r'r+r4r6r;r=rBrDrHrLrrrNrN�s�������6�6�6�
4�4�4�1�1�1�<�<�<�
9�9�9�9�9�9�
0�
0�
0�
0�
0�
0�	.�	.�	.�	.�	.�	.�H�H�H�H�H�H�J�J�J�J�JrrNc�f�g}|tt��z
}|tt��z
}|S�N)rr	rN)�config�testss  r�	get_testsrns0���E�	�_�[�
)�
)�)�E�	�_�]�
+�
+�+�E��Lr�__main__c�B�tjt����Srk)�unittest�	TestSuiternrLrr�<lambda>rss��H�&�y�{�{�3�3�r�suite)�defaultTest)rq�binasciirr�Cryptodome.SelfTest.st_commonr�Cryptodome.Util.strxorrr�TestCaser	rNrnrIrt�mainrLrr�<module>r{s ��D����'�'�'�'�'�'�'�'�9�9�9�9�9�9�3�3�3�3�3�3�3�3�|K�|K�|K�|K�|K�(�#�|K�|K�|K�~dJ�dJ�dJ�dJ�dJ�H�%�dJ�dJ�dJ�N������z���3�3�E��H�M�g�&�&�&�&�&�&��r

Youez - 2016 - github.com/yon3zu
LinuXploit