Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_hashlib.cpython-312.opt-1.pyc

�

'Μgպ��F�ddlZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZmZddlmZddlmZddlmZddlmZdd	lmZhd
�Ze	j4d�Ze�eZnJej9d�j;�j=d
�D�chc]}|j9���c}Zeddg��Zeek(reddg��Z ndZ 	ddl!m"Z"m#Z#m$Z$m%Z%	ddl(Z(ejRe(d�Z*ejVd��Z,ejRe,d�Z-d�Z.dZ/d�Z0Gd�dejb�Z2Gd�dejb�Z3e4dk(rejj�yycc}w#e&$rdZ"dZ#e'�Z$d�Z%Y��wxYw#e&$rdZ(Y��wxYw) �N)�	unhexlify)�support)�_4G�
bigmemtest)�import_fresh_module)�	os_helper)�requires_resource)�threading_helper)�
HTTPException>�md5�sha1�sha3�blake2�sha256�sha512�PY_BUILTIN_HASHLIB_HASHES�"�,�hashlib�_hashlib)�fresh)�blocked)�HASH�HASHXOF�openssl_md_meth_names�
get_fips_modec��y�Nr�r��./usr/local/lib/python3.12/test/test_hashlib.pyrr6s��r zrequires _blake2T)�ubzrequires _sha3c�J�d}d}|D]}|||dz	dz||dzzz
}�|S)N�0123456789abcdef���r)�s�h�r�is    r!�hexstrr,Fs?���A�
�A�
��	�Q��Q��#�~�
��1�s�7��
+�+����Hr z(http://www.pythontest.net/hashlib/{}.txtc#�K�tj|�}	tj|d��}|5|D]V}|j�}|jd�s|s�'|jd�}tj|d�|d<|���X	ddd�y#tt
f$r%t
jdj|���wxYw#1swYyxYw�w)Nzutf-8)�encodingzCould not retrieve {}�#rr)
�URL�formatr�open_urlresource�OSErrorr�unittest�SkipTest�strip�
startswith�split�bytes�fromhex)�	hash_name�url�testdata�line�partss     r!�read_vectorsr@Qs�����

�*�*�Y�
�C�E��+�+�C�'�B��
��D��:�:�<�D����s�#�4���J�J�s�O�E��}�}�U�1�X�.�E�!�H��K�
�
���
�]�#�E���� 7� >� >�s� C�D�D�E��	��s3�C�B�C�AC�	C�4C�C�C�Cc���eZdZdZddhZejdk(xsejZ	d�Z
�fd�Zed��Z
ed��Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed�d��Zed�d��Zdbd�Zd�Zd�Z d�Z!e"d��Z#e$d��Z%		dcd �Z&d!�Z'e$d"��Z(d#�Z)e$d$��Z*e"d%��Z+d&�Z,d'�Z-d(�Z.e/j`e1jde3d)zkd*�e4e3d)zd+d�,�d-���Z5e/j`e1jde3d+z
kd*�e4e3d+z
d+d�,�d.���Z6d/�Z7d0�Z8d1�Z9d2�Z:d3�Z;d4�Z<d5�Z=d6�Z>d7�Z?d8�Z@d9�ZAd:�ZBd;�ZCd<�ZDd=�ZEd>�ZFd?�ZGd@�ZHdA�ZIdB�ZJdC�ZKdD�ZLe"dE��ZMe"dF��ZNe"dG��ZOe"dH��ZPe"dI��ZQe"dJ��ZRe"dK��ZSe"dL��ZTe"dM��ZUe"dN��ZVe$dO��ZWe$dP��ZXe$dQ��ZYe$dR��ZZe$dS��Z[e$dT��Z\e$dU��Z]e$dV��Z^dW�Z_dX�Z`dY�ZadZ�Zbd[�Zcedj�edj��d\���Zgd]�Zhej�d^��Zje/j�eldud_�d`��Zmda�Zn�xZoS)d�HashLibTestCase)r�MD5r
�SHA1�sha224�SHA224r�SHA256�sha384�SHA384r�SHA512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256rQrR�posixc��	tj|�S#t$r6}|jr |tvrtjd|���Yd}~yd}~wwxYw)z@Import a module and return a reference to it or None on failure.z#Did a C extension fail to compile? N)�	importlib�
import_module�ModuleNotFoundError�_warn_on_extension_import�builtin_hashes�warnings�warn)�self�module_name�errors   r!�_conditional_import_modulez*HashLibTestCase._conditional_import_modulensS��	M��*�*�;�7�7��"�	M��-�-�+��2O��
�
� C�E�7�K�L����	M�s��	A�,A�Ac����t�}�jD]!}|j|j���#�j	d�}|r|jddh�i�_|D]1}tr|jd�r�t��j|<�3�jj�D];\}}|jtt|��d|fd�}|j|��=�j	d�}|�_|r��jt|d���jt|d���jj�D]1\}}t|d	|zd�}	|	s�	|	�|j|	��3�fd
�}
�j	d�}|r|
d��j	d
�}|r|
d��j	d�}
|
r |
d�|
d�|
d�|
d�|r|
d�|
d�tsC�j	d�}|r0|
d�|
d�|
d�|
d�|
d�|
d�t!t"��J|i|��y#t$rY��wxYw)N�_blake2rKrL�sha3_c�`�|�tj|fi|��Stj||fi|��S�N)r�new)�data�_alg�kwargss   r!�_test_algorithm_via_hashlib_newzAHashLibTestCase.__init__.<locals>._test_algorithm_via_hashlib_new�s1���<�"�;�;�t�6�v�6�6��{�{�4��8��8�8r r�openssl_md5�openssl_sha1�openssl_c�n��ttd�|�}�j|j|�y)N�__get_builtin_constructor)�getattrr�constructors_to_test�add)�name�constructorr\s  �r!�add_builtin_constructorz9HashLibTestCase.__init__.<locals>.add_builtin_constructor�s0���G�'�'�+F�G��M�K��%�%�d�+�/�/��<r �_md5r�_sha1r
�_sha2rErrHr�_sha3rMrNrOrPrQrR)�set�supported_hash_namesrq�lowerr_�updaterp�	SKIP_SHA3r7�itemsrorr�
assertTrue�hasattr�
ValueError�superrB�__init__)r\�argsrh�
algorithms�	algorithmra�constructorsrirrsrtrurvrwrx�	__class__s`              �r!r�zHashLibTestCase.__init__wsb����U�
��2�2�I��N�N�9�?�?�,�-�3��1�1�)�<������y�)�4�5�$&��!�#�I��Y�1�1�'�:��36�5�D�%�%�i�0�$�(,�'@�'@�'F�'F�'H�#�I�|����W�W�i�8�9�59�	�
9�
���<�=�
(I��2�2�:�>�� ��
��
�O�O�G�H�m�<�=��O�O�G�H�n�=�>�+/�+D�+D�+J�+J�+L�'�	�<�%�h�
�9�0D�d�K���6�#�
�
%�(�(��5�,M�	=��.�.�v�6���#�E�*��/�/��8���#�F�+��/�/��8���#�H�-�#�H�-�#�H�-�#�H�-��#�I�.�#�I�.���3�3�G�<�E��'�
�3�'�
�3�'�
�3�'�
�3�'��4�'��4�
�o�t�-�t�>�v�>��I&����s�<I3�3	J�?Jc�t�|jj�}tjj	|�Srd)rp�values�	itertools�chain�
from_iterable)r\r�s  r!�hash_constructorsz!HashLibTestCase.hash_constructors�s+���0�0�7�7�9�����,�,�\�:�:r c��t�Srd)r�r\s r!�is_fips_modezHashLibTestCase.is_fips_mode�s
����r c���tjdtd��}|jD]F}||d��}|j|jvr|jd��7|j��Hy)N�b�
F��usedforsecurity�)�array�ranger�rr�shakes�	hexdigest)r\�a�cons�cs    r!�test_hash_arrayzHashLibTestCase.test_hash_array�sV���K�K��U�2�Y�'���*�*�D��Q��.�A��v�v����$����B�����
�+r c�x�|jtjtd�|jD���y)Nc3�@K�|]}|j�r|���y�wrd)�islower)�.0�_algos  r!�	<genexpr>z=HashLibTestCase.test_algorithms_guaranteed.<locals>.<genexpr>�s!����&�#<�%��]�]�_��#<�s�)�assertEqualr�algorithms_guaranteedryrzr�s r!�test_algorithms_guaranteedz*HashLibTestCase.test_algorithms_guaranteed�s2������6�6��&�4�#<�#<�&�
&�	'r c�&�|jttj�j	tj
��|j
dtj
�tj
D]}tj|d��}�y)N�	undefinedFr�)rryrr��issubset�algorithms_available�assertNotInre)r\rr�digests   r!�test_algorithms_availablez)HashLibTestCase.test_algorithms_available�sd������G�9�9�:�$�H�W�%A�%A�B�	D�	
����g�&B�&B�C��0�0�D��[�[��u�=�F�1r c��tjdd��|jr|jd�|jD]}|d��|dd���tjdd��tj
d��|j�:|jjdd��|jjd��yy)NrTr�zskip in FIPS moder r)rrer��skipTestr�rrrj�r\r�s  r!�test_usedforsecurity_truez)HashLibTestCase.test_usedforsecurity_true�s������H�d�3�����M�M�-�.��*�*�D���&���d�+�+�	���E�4�0����D�)��=�=�$��M�M���e�T��:��M�M�%�%�d�%�;�%r c�`�tjdd��|jD]}|d��|dd���tjdd��tjd��|j�:|jjdd��|jjd��yy)NrFr�r r)rrer�rrrjr�s  r!�test_usedforsecurity_falsez*HashLibTestCase.test_usedforsecurity_false�s������H�e�4��*�*�D���'���e�,�+�	���E�5�1����E�*��=�=�$��M�M���e�U��;��M�M�%�%�e�%�<�%r c��|jttjd�|jttjd�y)Nzspam spam spam spam spam�)�assertRaisesr�rre�	TypeErrorr�s r!�test_unknown_hashz!HashLibTestCase.test_unknown_hash�s/�����*�g�k�k�3M�N����)�W�[�[�!�4r c�b�|jtjd�jd�y)NrGr)r�rrerrr�s r!�test_new_upper_to_lowerz'HashLibTestCase.test_new_upper_to_lower�s!��������X�.�3�3�X�>r c��ttd�}ttd�}|jt|d�	ddl}dtjd<|j�	|jt|d�dt�vrtjd<ntjd=	|jt|d�|d�}|j|j�|jt|�d	dg�y#t
$r|j
d�Y��wxYw#dt�vrtjd<wtjd=wxYw)
Nrn�__builtin_constructor_cache�testrz_md5 module not availablerur�rC)rorr�r�ru�ImportErrorr��sys�modules�clear�localsr��assertIsrr��sorted)r\�get_builtin_constructor�builtin_constructor_cacherurss     r!�test_get_builtin_constructorz,HashLibTestCase.test_get_builtin_constructors%��")�'�*E�#G��$+�G�,I�%K�!����*�&=�v�F�	7��#����F��!�'�'�)�	(����j�*A�5�I����!�&*����F�#��K�K��'����)�%<�a�@�-�e�4���
�
�k�4�8�8�,����� 9�:�U�E�N�K��!�	7��M�M�5�6�	7�����!�&*����F�#��K�K��'�s�D�!D#�D �D �#3Ec���|jD]�}|d��}|j|jvr_|j|j	d�t
�|j
t|j	d��|jd����|j|j	�t
�|j
t|j	��|j����y)NFr�r�)	r�rrr��assertIsInstancer�r9r�r,r��r\r�r)s   r!�test_hexdigestzHashLibTestCase.test_hexdigests����*�*�D��U�+�A��v�v����$��%�%�a�h�h�r�l�E�:�� � �������!5�q�{�{�2��G��%�%�a�h�h�j�%�8�� � �����
�!3�Q�[�[�]�C�+r c	��d}|jD]�}|d��}|j|jvr�%t�t	|t�r�<|j
|jfD]L}|jt|d�|D].}|jttf�5||�ddd��0�N��y#1swY�?xYw)N)i l��l
ll����l
Fr�i����)
r�rrr�r�
isinstancer�r�r�r��
OverflowError)r\�large_sizesr�r)r��lengths      r!�test_digest_length_overflowz+HashLibTestCase.test_digest_length_overflow$s���L���*�*�D��U�+�A��v�v�T�[�[�(����J�q�$�$7���(�(�A�K�K�/���!�!�*�f�c�:�)�F��*�*�J�
�+F�G��v��H�G�*�0�+�H�G�s�	B5	�5B>
c���|jD]�}|d��}|j|jt�|j|jvr'|j|j|j�n&|j
|j|j�|j|jtj|jd��j���y)NFr�)
r�r�rr�strrz�assertInr�r�rrer�s   r!�test_name_attributez#HashLibTestCase.test_name_attribute4s����*�*�D��U�+�A��!�!�!�&�&�#�.��v�v��2�2�2��
�
�a�f�f�d�&?�&?�@�� � �����)B�)B�C����������A�F�F�E�:�?�?�
�+r c�@�d}d}d}d}|jD�]�}|d��}|j|�|j|�|j|�|j|�|j|jvrd}nd}|d��}|j||z|z|z�|j	|j
|�|j
|��|||z|z|zd��}	|j	|j
|�|	j
|��|||z|zd��}
|
j
|�}|
j
�}|j|�|j	|j
|�|j
|��|j	|
j
|�|����y)	Ns�aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbs~ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccsddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddFr�)r�r)r�r|rrr�r�r��copy)
r\�aas�bees�cees�deesr��m1r��m2�m3�m4�	m4_digest�m4_copys
             r!�test_large_updatez!HashLibTestCase.test_large_updateAs�����������*�*�D��e�,�B��I�I�c�N��I�I�d�O��I�I�d�O��I�I�d�O��w�w�$�+�+�%������e�,�B��I�I�c�D�j�4�'�$�.�/����Y�R�Y�Y��-�y�r�y�y�$�/?�@��c�D�j�4�'�$�.��F�B����Y�R�Y�Y��-�y�r�y�y�$�/?�@��c�D�j�4�'��?�B�!��	�	�4�(�I��g�g�i�G��N�N�4� ����Y�R�Y�Y��-�~�w�~�~�t�/D�E����Y�R�Y�Y��-�y�9�1+r �cpuc���ddz}tj�}tdd�D]}|j|��|jd�|j	|j�d�y)N��r��hello world�@a5364f7a52ebe2e25f1838a4ca715a893b6fd7a23f2a0d9e9762120da8b1bf53)rrr�r|r�r��r\�zero_1mbr)r+s    r!�test_sha256_update_over_4gbz+HashLibTestCase.test_sha256_update_over_4gbasW���$�&���N�N����q�$��A�
�H�H�X�� �	���� ��������(j�kr c���ddz}tj�}tdd�D]}|j|��|jd�|j	|j�d�y)Nr�r�rr�r��@e2d4535e3b613135c14f2fe4e026d7ad8d569db44901740beffa30d430acb038)rrNr�r|r�r�r�s    r!�test_sha3_256_update_over_4gbz-HashLibTestCase.test_sha3_256_update_over_4gbjsY���$�&��������q�$��A�
�H�H�X�� �	���� ��������(j�kr Fc�v�t|�dz}|j�}|j|}|jt|�d�|D]�}||fi|��}	|s|	j	�n|	j	|�}
|j|
|d|||
t|�|fz�|s|	j
�n|	j
|�}
tj|�}|j|
|�|r��|jt|�|	j���|s&|jd��|j|||�yyy)N�zrHash algorithm %s constructed using %s returned hexdigest %r for %d byte input data that should have hashed to %r.�key)�lenr{rp�assertGreaterEqualr�r�r�r9r:�digest_size�get�check_file_digest)r\rrrfr��shakerhr�r��hash_object_constructor�m�computedr�s            r!�checkzHashLibTestCase.checkss&���Y���"���O�O�%�	��0�0��6������L� 1�1�5�'3�#�'��7��7�A�,1�q�{�{�}�q�{�{�6�7J�H�����i�P��4���T��I�7�7�
8�*/�q�x�x�z�A�H�H�V�4D�H��]�]�9�-�F����X�v�.��� � ��V��a�m�m�<�(4�����E�*�2��"�"�4��y�9�3�ur c�V�|j�}	tj|�|g}|j	|j
|�t
tjd�5}|j|�ddd�	|D]�}tj|�}|jd�|jtj||�j�|�t
tjd�5}tj||�}ddd�|jj�|���	t!j"tj�y#t$rYywxYw#1swY��xYw#1swY�kxYw#t!j"tj�wxYw)N�wbr�rb)r{rrer��extendrp�openr�TESTFN�write�io�BytesIO�seekr��file_digestr��os�unlink)	r\rrrfr��digests�fr��buf�	digestobjs	         r!r�z!HashLibTestCase.check_file_digest�sE���O�O�%�	�	��K�K����&�����t�0�0��6�7�
�)�"�"�D�
)�Q�
�G�G�D�M�*�	(�!���j�j��&�������� � ��'�'��V�4�>�>�@�)���)�*�*�D�1�Q� '� 3� 3�A�v� >�I�2�� � ��!4�!4�!6�	�B�"�
�I�I�i�&�&�'��)�	��	��*�
)��2�1��
�I�I�i�&�&�'�sB�E�"E+�=A9F�6E7�
*F�	E(�'E(�+E4�7F	�<F�%F(c�^�|j|}|D]}|jt|d��y)N�spam)rpr�r�)r\�algorithm_namer�r�s    r!�check_no_unicodez HashLibTestCase.check_no_unicode�s0���0�0��@��'3�#����i�)@�&�I�(4r c���|jd�|jd�|jd�|jd�|jd�|jd�y)Nrr
rErrHr�rr�s r!�test_no_unicodezHashLibTestCase.test_no_unicode�sV�����e�$����f�%����h�'����h�'����h�'����h�'r c�H�|jd�|jd�y)NrKrLrr�s r!�test_no_unicode_blake2z&HashLibTestCase.test_no_unicode_blake2�s�����i�(����i�(r c���|jd�|jd�|jd�|jd�|jd�|jd�y)NrMrNrOrPrQrRrr�s r!�test_no_unicode_sha3z$HashLibTestCase.test_no_unicode_sha3�sV�����j�)����j�)����j�)����j�)����k�*����k�*r Nc���|j|}|D�]J}|d��}|j|j|�|j|j|�|rX|jt	|j|��|�|jt	|j
|��d|z�nU|jt	|j��|�|jt	|j
��d|z�|j|j|�|j|jd�dt|�j����My)NFr�r��_r)rpr��
block_sizer�r�r�r�rrr�r8�reprr{)r\rrrr��
digest_lengthr�r�r�s        r!�check_blocksize_namez$HashLibTestCase.check_blocksize_name�s���0�0��6��'3�#�'��>�A����Q�\�\�:�6����Q�]�]�K�8��� � ��Q�X�X�m�%<�!=�!.�0�� � ��Q�[�[��%?�!@�!"�=��2�� � ��Q�X�X�Z��+�>�� � ��Q�[�[�]�!3�Q�{�]�C����Q�V�V�T�*��M�M�$�*�*�S�/�!�,�d�1�g�m�m�o�>�(4r c���|jddd�|jddd�|jddd�|jddd	�|jd
dd�|jd
dd�y)Nr�@r�r
�rE�r� rH��0r�r!r�s r!�test_blocksize_and_namez'HashLibTestCase.test_blocksize_and_name�sn���!�!�%��R�0��!�!�&�"�b�1��!�!�(�B��3��!�!�(�B��3��!�!�(�C��4��!�!�(�C��4r c���|jddd�|jddd�|jddd	�|jd
dd�|jd
ddd�|jdddd�y)NrM�r%rN�r&rO�hr(rP�Hr#rQ�rrRr)r�s r!�test_blocksize_name_sha3z(HashLibTestCase.test_blocksize_name_sha3�sr���!�!�*�c�2�6��!�!�*�c�2�6��!�!�*�c�2�6��!�!�*�b�"�5��!�!�+�s�A�r�:��!�!�+�s�A�r�:r c�>�|j|}|D]�}|�}t�t|t�r�!|j||zd�|j|j|�|j|j
|�|j|j|���y)Ni@)rprr�r��_capacity_bits�
_rate_bits�_suffix)r\rr�capacity�rate�suffixr�r�r�s        r!�
check_sha3zHashLibTestCase.check_sha3�s����0�0��6��'3�#�'�)�A���J�q�$�$7�����X��_�d�3����Q�-�-�x�8����Q�\�\�4�0����Q�Y�Y��/�(4r c���|jdddd�|jdddd�|jdd	d
d�|jddd
d�|jdddd�|jdddd�y)NrMi�i��rN�i@rOii@rPr�i@rQ�i@�rR)r9r�s r!�test_extra_sha3zHashLibTestCase.test_extra_sha3�sn�����
�C��w�7����
�C��w�7����
�C��g�6����
�D�#�w�7�����S�$��8�����S�$��8r c�P�|jddd�|jddd�y)NrKr'r#rLr&r)r�s r!�test_blocksize_name_blake2z*HashLibTestCase.test_blocksize_name_blake2�s&���!�!�)�S�"�5��!�!�)�R��4r c�.�|jdddd��y)Nrr � d41d8cd98f00b204e9800998ecf8427eFr��r�r�s r!�test_case_md5_0zHashLibTestCase.test_case_md5_0s���
�
��3�:�!�	�	
r c�.�|jdddd��y)Nr�abc� 900150983cd24fb0d6963f7d28e17f72Fr�rDr�s r!�test_case_md5_1zHashLibTestCase.test_case_md5_1s���
�
��6�=�!�	�	
r c�.�|jdddd��y)Nrs>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789� d174ab98d277d9f5a5611c2c9f419d9fFr�rDr�s r!�test_case_md5_2zHashLibTestCase.test_case_md5_2s���
�
��M�.�!�		�	
r �z!test cannot run on 32-bit systemsr�)�size�memuse�dry_runc�0�|jdd|zd�y)Nr�A� c9af2dff37468ce5dfee8f2cfc0a9c6drD�r\rNs  r!�test_case_md5_hugez"HashLibTestCase.test_case_md5_huge���	
�
�
�5�$�t�)�%G�Hr c�0�|jdd|zd�y)NrrR� 28138d306ff1b8281f1a9067e1a1a2b3rDrTs  r!�test_case_md5_uintmaxz%HashLibTestCase.test_case_md5_uintmaxrVr c�*�|jddd�y)Nr
r �(da39a3ee5e6b4b0d3255bfef95601890afd80709rDr�s r!�test_case_sha1_0z HashLibTestCase.test_case_sha1_0"s���
�
�6�3�=�	?r c�*�|jddd�y)Nr
rG�(a9993e364706816aba3e25717850c26c9cd0d89drDr�s r!�test_case_sha1_1z HashLibTestCase.test_case_sha1_1&s���
�
�6�6�=�	?r c�*�|jddd�y)Nr
�8abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq�(84983e441c3bd26ebaae4aa1f95129e5e54670f1rDr�s r!�test_case_sha1_2z HashLibTestCase.test_case_sha1_2*s���
�
�6�N�=�	?r c�0�|jdddzd�y)Nr
�a�@B�(34aa973cd4c4daa4f61eeb2bdbad27316534016frDr�s r!�test_case_sha1_3z HashLibTestCase.test_case_sha1_3/s���
�
�6�4�'�>�=�	?r c�*�|jddd�y)NrEr �8d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42frDr�s r!�test_case_sha224_0z"HashLibTestCase.test_case_sha224_08s���
�
�8�S�
D�	Fr c�*�|jddd�y)NrErG�823097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7rDr�s r!�test_case_sha224_1z"HashLibTestCase.test_case_sha224_1<s���
�
�8�V�
D�	Fr c�*�|jddd�y)NrEra�875388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525rDr�s r!�test_case_sha224_2z"HashLibTestCase.test_case_sha224_2@s���
�
�8�
E�
D�	Fr c�0�|jdddzd�y)NrErerf�820794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67rDr�s r!�test_case_sha224_3z"HashLibTestCase.test_case_sha224_3Es���
�
�8�T�G�^�
D�	Fr c�*�|jddd�y)Nrr �@e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855rDr�s r!�test_case_sha256_0z"HashLibTestCase.test_case_sha256_0Js���
�
�8�S�
L�	Nr c�*�|jddd�y)NrrG�@ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015adrDr�s r!�test_case_sha256_1z"HashLibTestCase.test_case_sha256_1Ns���
�
�8�V�
L�	Nr c�*�|jddd�y)Nrra�@248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1rDr�s r!�test_case_sha256_2z"HashLibTestCase.test_case_sha256_2Rs���
�
�8�
E�
L�	Nr c�0�|jdddzd�y)Nrrerf�@cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0rDr�s r!�test_case_sha256_3z"HashLibTestCase.test_case_sha256_3Ws���
�
�8�T�G�^�
L�	Nr c�*�|jddd�y)NrHr �`38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95brDr�s r!�test_case_sha384_0z"HashLibTestCase.test_case_sha384_0\s���
�
�8�S�-�	.r c�*�|jddd�y)NrHrG�`cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7rDr�s r!�test_case_sha384_1z"HashLibTestCase.test_case_sha384_1as���
�
�8�V�-�	.r c�*�|jddd�y)NrH�pabcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu�`09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039rDr�s r!�test_case_sha384_2z"HashLibTestCase.test_case_sha384_2fs���
�
�8�O�-�	.r c�0�|jdddzd�y)NrHrerf�`9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b07b8b3dc38ecc4ebae97ddd87f3d8985rDr�s r!�test_case_sha384_3z"HashLibTestCase.test_case_sha384_3ms���
�
�8�T�G�^�-�	.r c�*�|jddd�y)Nrr ڀcf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3erDr�s r!�test_case_sha512_0z"HashLibTestCase.test_case_sha512_0ss���
�
�8�S�M�	Nr c�*�|jddd�y)NrrGڀddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49frDr�s r!�test_case_sha512_1z"HashLibTestCase.test_case_sha512_1xs���
�
�8�V�M�	Nr c�*�|jddd�y)Nrr�ڀ8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909rDr�s r!�test_case_sha512_2z"HashLibTestCase.test_case_sha512_2}s���
�
�8�O�M�	Nr c�0�|jdddzd�y)Nrrerfڀe718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09brDr�s r!�test_case_sha512_3z"HashLibTestCase.test_case_sha512_3�s���
�
�8�T�G�^�M�	Nr c���|j|j|�t|dz�D]}|d|z���d|dzz}|jt||��|j|j
|�t|dz�D]}|d|z���d|dzz}	|jt||	��|j|j|�td|dz�D]}||���
|jt|d��|jt|d��|jt||dz��|j|j|�t|dz�D]}|d|z���d|dzz}
|jt||
��|j|�j�|d	��j��tdd
�D]}||���
|jt|d��|jt|d
��tdd
�D]}||���
|jt|d��|jt|d��|jt|d
��tdd
�D]}||�
��
|jt|d�
�|jt|d
�
�td|dz�D]}||���
|jt|d��|jt||dz��|d��|d��|jt|d��|jt|d��|d��||��|jt|d��|jt||dz��|jt|d	��|jt|d	��|jt|d�|d	d	d	d	dddd
dddd��y)Nr�re��salt)�person�r����r�r�r r=)�fanout)�depth)�
node_depth)�
inner_size)�	leaf_size���l)�node_offset)rf)�stringr%�r<�T)r�r�r�r�r�r�r�r�r�r��	last_node)r��	SALT_SIZEr�r�r��PERSON_SIZE�MAX_DIGEST_SIZE�MAX_KEY_SIZEr�r�r�)r\rs�	salt_size�person_size�key_sizer��
max_offsetr+r�r�r�s           r!�check_blake2zHashLibTestCase.check_blake2�s�������.�.�	�:��y�1�}�%�A��T�A�X�&�&��y�1�}�%�����*�k���=�����0�0�+�>��{�1�}�%�A��t�a�x�(�&���q��)�����*�k�&��A�����4�4�k�B��q�+��/�*�A��A�&�+����*�k�r��B����*�k�q��A����*�k�{�1�}��M�����1�1�8�<��x��z�"�A��D�1�H�%�#��h��l�#�����*�k�s��;������0�0�2�$��-�7�7�9�	;��q�#��A��q�!�����*�k�"��=����*�k�#��>��q�#��A��a� �����*�k���<����*�k���;����*�k���=��q�#��A��1�%�����*�k�b��A����*�k�c��B��q�+��/�*�A��1�%�+����*�k�b��A����*�k�k�!�m��L��a� ��i�(����*�k�R��@����-����F���"��
�+����*�k�r��B����-��*�Q�,��O����)�[�s��;����)�[���=����)�[�"�5��������������
	
r c� �d�}|d��}|D]n}|D]g}|||�}|||�}	|||��}
|j|
j��|||	|��}|j|j���i�p|j�S)Nc��d}d|z|z}d}t|�}t|�D]}||z|z}||}}|dz	dz||<�|S)Nr�l�KZ=r���)�	bytearrayr�)r��seed�maskr�r��outr+�ts        r!�selftest_seqz4HashLibTestCase.blake2_rfc7693.<locals>.selftest_seq�sb���D��d�"�d�*�A��A��F�#�C��6�]����U�d�N���!�1���r�'�T�)��A��#��Jr r&r�)r�r�)r|r�r�)r\rs�md_len�in_lenr��outer�outlen�inlen�indatar��unkeyed�keyeds            r!�blake2_rfc7693zHashLibTestCase.blake2_rfc7693�s���		���+���F���%�e�U�3��"�6�6�2��%�f�&�A�����W�^�^�-�.�#�F���H�����U�\�\�^�,�
 ����� � r c��|jtjddddd�gd�}gd�}|j|j	tj||�d�y)Nr�r#l����)r$r&r(r#)rr�r'�r�r��@c23a7800d98123bd10f506c61e29da5603d763b8bbad2e737f5e765a7bccd475)r�rrKr�r�)r\�
b2b_md_len�
b2b_in_lens   r!�test_blake2bzHashLibTestCase.test_blake2b�sP�����'�/�/�2�r�2�r�9�E�%�
�0�
�����������Z�H�N�	Pr c�*�|jddd�y)NrKr ڀ786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2cerDr�s r!�test_case_blake2b_0z#HashLibTestCase.test_case_blake2b_0�s���
�
�9�c�M�	Nr c�*�|jddd�y)NrKrGڀba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d17d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923rDr�s r!�test_case_blake2b_1z#HashLibTestCase.test_case_blake2b_1�s���
�
�9�f�M�	Nr c�B�|jddddddddd	d
ddd
d��y)NrK�foo� 920568b0c5873b2f0ab67bedb6cf1b2br��bar�baz�bingr�r�r&rM�r�T�r�r�r�r�r�r�r�r�r�r�r�rDr�s r!� test_case_blake2b_all_parametersz0HashLibTestCase.test_case_blake2b_all_parameters�=��	
�
�
�9�f�
,������������	�	r c��td�D]0\}}}tj|�}|jd|||���2y)NrKr��r@r9r:r��r\�msgr��mds    r!�test_blake2b_vectorsz$HashLibTestCase.test_blake2b_vectors�9��(��3�L�C��b��-�-��$�C��J�J�y�#�r�s�J�3�4r c��|jtjddddd�gd�}gd�}|j|j	tj||�d�y)N�r&l���)r�r$r%r&)rr�r#�Ar�r��@6a411f08ce25adcdfb02aba641451cec53c598b24f4fc787fbdc88797f4c1dfe)r�rrLr�r�)r\�
b2s_md_len�
b2s_in_lens   r!�test_blake2szHashLibTestCase.test_blake2ssP�����'�/�/�1�a��R��C�%�
�.�
�����������Z�H�N�	Pr c�*�|jddd�y)NrLr �@69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9rDr�s r!�test_case_blake2s_0z#HashLibTestCase.test_case_blake2s_0$s���
�
�9�c�
L�	Nr c�*�|jddd�y)NrLrG�@508c5e8c327c14e2e1a72ba34eeb452f37458b209ed63a294d999b4c86675982rDr�s r!�test_case_blake2s_1z#HashLibTestCase.test_case_blake2s_1)s���
�
�9�f�
L�	Nr c�B�|jddddddddd	d
ddd
d��y)NrLr�� bf2a8f7fe3c555012a6f8046e646bc75r�r�r�r�r�r�r&rMr�r�Tr�rDr�s r!� test_case_blake2s_all_parametersz0HashLibTestCase.test_case_blake2s_all_parameters.r�r c��td�D]0\}}}tj|�}|jd|||���2y)NrLr�r�r�s    r!�test_blake2s_vectorsz$HashLibTestCase.test_blake2s_vectors@r�r c�*�|jddd�y)NrMr �86b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7rDr�s r!�test_case_sha3_224_0z$HashLibTestCase.test_case_sha3_224_0Fs���
�
�:�s�
D�	Fr c�P�td�D]\}}|jd||��y)NrM�r@r��r\r�r�s   r!�test_case_sha3_224_vectorz)HashLibTestCase.test_case_sha3_224_vectorK�%��#�J�/�G�C���J�J�z�3��+�0r c�*�|jddd�y)NrNr �@a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434arDr�s r!�test_case_sha3_256_0z$HashLibTestCase.test_case_sha3_256_0Ps���
�
�:�s�
L�	Nr c�P�td�D]\}}|jd||��y)NrNr�r�s   r!�test_case_sha3_256_vectorz)HashLibTestCase.test_case_sha3_256_vectorUr�r c�*�|jddd�y)NrOr �`0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004rDr�s r!�test_case_sha3_384_0z$HashLibTestCase.test_case_sha3_384_0Zs���
�
�:�s�-�	.r c�P�td�D]\}}|jd||��y)NrOr�r�s   r!�test_case_sha3_384_vectorz)HashLibTestCase.test_case_sha3_384_vector`r�r c�*�|jddd�y)NrPr ڀa69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26rDr�s r!�test_case_sha3_512_0z$HashLibTestCase.test_case_sha3_512_0es���
�
�:�s�M�	Nr c�P�td�D]\}}|jd||��y)NrPr�r�s   r!�test_case_sha3_512_vectorz)HashLibTestCase.test_case_sha3_512_vectorkr�r c�T�|jdddd�|jdddd�y)NrQr �@7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26T�7f9crDr�s r!�test_case_shake_128_0z%HashLibTestCase.test_case_shake_128_0p�,���
�
�;��
L�
�	�	
�
�
�;��V�T�2r c�R�td�D]\}}|jd||d��y)NrQTr�r�s   r!�test_case_shake128_vectorz)HashLibTestCase.test_case_shake128_vectorv�'��#�K�0�G�C���J�J�{�C��T�2�1r c�T�|jdddd�|jdddd�y)NrRr �@46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b81b82b50c27646ed5762fT�46b9rDr�s r!�test_case_shake_256_0z%HashLibTestCase.test_case_shake_256_0zrr c�R�td�D]\}}|jd||d��y)NrRTr�r�s   r!�test_case_shake256_vectorz)HashLibTestCase.test_case_shake256_vector�rr c�4�d}|jD]_}|d��}|jd�|jd|z�|jd�|d|zd��}|jd��atj�}|jd�|jd|z�|jd�|j	|j�d�tjdd|zzdz�}|j	|j�d�y)NiFr��1�#�x�@1cfceca95989f51f658e3f3ffe7f1cd43726c9e088c13ee10b46f57cef135b94)r�r|rrr�r�)r\�gil_minsizer�r�s    r!�test_gilzHashLibTestCase.test_gil�s������*�*�D��U�+�A�
�H�H�T�N�
�H�H�T�K�'�(�
�H�H�T�N��T�K�'��?�A�
�H�H�T�N�+�
�N�N���	�����	�����#�$�	��������
�K�K�M�N�	
�

�N�N�4�$��"4�4�t�;�<�����
�K�K�M�N�	
r c�.�	�
�tj��
d}d}|dz�	tj�	|z�j�}�	�
fd�}g}t|�D]l}t	�	�d|zz}|j|d�|j
|t	|�zd�tj||f��}|j|��n|D]}|j��|D]}|j��|j
|�
j��y)NrMsswineflui@
c�~��d}|t��kr,�j�|||z�||z
}|t��kr�+yyr)r�r|)�
chunk_size�indexrf�hashers  ��r!�hash_in_chunksz=HashLibTestCase.test_threaded_hashing.<locals>.hash_in_chunks�sD����E��#�d�)�#��
�
�d�5���);�<�=���#���#�d�)�#r r�r)�targetr�)rr
r�r�r��
assertGreaterr��	threading�Thread�append�start�join)r\�num_threads�
smallest_data�
expected_hashr(�threads�	threadnumr%�threadrfr's         @@r!�test_threaded_hashingz%HashLibTestCase.test_threaded_hashing�s�����������#�
��v�%�����T�+�%5�6�@�@�B�
�	$����{�+�I��T��r�Y��7�J����z�1�-����Z�#�m�*<�<�a�@��%�%�^�,6�=�:�F��N�N�6�"�
,��F��L�L�N���F��K�K�M��	
�����(8�(8�(:�;r c�N�|j}|�|j|t�yyrd)r�r��int)r\�	fips_modes  r!�test_get_fips_modez"HashLibTestCase.test_get_fips_mode�s(���%�%�	�� ��!�!�)�S�1�!r c	�4�|jj�D]`\}}|jd�r�|D]D}	|�}|j	|��5tj|t|��ddd��F�by#t$rY�UwxYw#1swY�bxYw)N)rbr��blake)rs)rpr~r7r��subTestr�check_disallow_instantiation�type)r\r�r�rsr)s     r!�test_disallow_instantiationz+HashLibTestCase.test_disallow_instantiation�s���'+�'@�'@�'F�'F�'H�#�I�|��#�#�$?�@��+���#�
�A��\�\�k�\�:��8�8��t�A�w�G�;�:�
 ,�(I��"�����:�:�s�A?� B�?	B�
B�Bz
need _hashlibc�l�tj|t�tj|t�yrd)rr>rrr�s r!� test_hash_disallow_instantiationz0HashLibTestCase.test_hash_disallow_instantiation�s$��	�,�,�T�4�8��,�,�T�7�;r c	�H�|jj�D]^\}}|D]T}	t|��}|j	|��5|jtd�5d|_ddd�ddd��V�`y#t$rY�ewxYw#1swY�%xYw#1swY�~xYw)N)�	hash_typezimmutable typeF)rpr~r?r�r=�assertRaisesRegexr��value)r\r�r�rsrDs     r!�test_readonly_typesz#HashLibTestCase.test_readonly_types�s���'+�'@�'@�'F�'F�'H�#�I�|�+��� $�[�]� 3�I��\�\�I�\�6��/�/�	�;K�L�*/�	��M�7�6�
 ,�(I��"�����M�L��7�6�s5�A=�	B� B	�(B�=	B	�B	�B
�B�B!)F)rrN)p�__name__�
__module__�__qualname__rzr�rrrr�Py_DEBUGrXr_r��propertyr�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rr�requires_blake2r�
requires_sha3rr!r*r1r9r?rArErIrLr4�skipIfr��maxsizerrrUrYr\r_rcrhrkrnrqrtrwrzr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr
rrrrr"r
�reap_threads�requires_working_threadingr6r:�cpython_onlyr@�
skipUnlessrrBrG�
__classcell__)r�s@r!rBrBas����7���;�
'�F�"$���G�!3�!G�w�7G�7G���I?�V�;��;������'�
>�<�	=�5�?�L�4D�'� �:�@�u��l��l��u��l��l�:�2(�4J�(��)��)��+��+�DE�+/�?�&5��;��;�
0��9��9��5��5�
�
�
��X�_�_�S�[�[�3��7�*�,O�P��S�1�W�Q��6�I�7�Q�I��X�_�_�S�[�[�3��7�*�,O�P��S�1�W�Q��6�I�7�Q�I�?�?�?�
?�F�F�F�
F�
N�N�N�
N�
.�
.�
.�.�N�
N�
N�N�
M
�^!�,�P��P��N��N�
�N��N�
����"�4��4�
�P��P��N��N��N��N�����"�4��4�
�F��F��,��,��N��N��,��,��.��.�
�,��,��N��N�
�,��,�3�3�3�3�
�:�"�"�0��0�0�2�!<�3�#�!<�F2�

���
H��
H��X����T�)�?�;�<�<�<�
0r rBc
�N�eZdZgd�Zddddded�fdddd	ded
�fddd
d	ded�fgZejd�dfejd�dfejd�dfejd�dfejd�dfgejd�dfejd�dfejd�dfejd�dfejd�dfgejd�dfejd�dfejd�dfejd�d fejd!�dfgd"�Zd#�Z	e
jedud$�d%��Z
e
jeed&�d'�e
je�d(�)�d*���Zd+�Zd,�Zy)-�KDFTests))�password�saltr�N)rXrYr�N)rXrYr�N)spasswordPASSWORDpasswords$saltSALTsaltSALTsaltSALTsaltSALTsaltr�r�)s	passwordssaltr�r�r r�r�ڀ77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906rXsNaClr�r�ڀfdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640s
pleaseletmeinsSodiumChloridei@ڀ7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887�(0c60c80f961f0e71f3a9b524af6012062fe037a6N�(ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957�(4b007901b765489abead49d926f721d065a429c1�23d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038�� 56fa6aa75548099dcc37d7f03425e0c3�@120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b�@ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43�@c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134a�P348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9�(� 89b69d0516f829893c696226650a8687ڀ867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fceڀe1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82be67335c77a6068e04112754f27ccf4eڀd197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f87f6902e072f457b5143f30602641b3d55cd335988cb36b84376060ecd532e039b742a239434af2d5ڀ8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868c005174dc4ee71115b59f9e60cd9532fa33e0f75aefe30225c583a186cd82bd4daea9724a3d3b8r#� 9d9e9c4cd21fe4be24d5b8244c759665)r
rrc��|jj�D]�\}}||vr�t|j�D]�\}}|\}}}	}
||\}}|r|}
|||||	|
�}
|j	|
|||||	|
f�||t|�t|�|	|
�}
|j	|
|�||t
|�t
|�|	|
�}
|j	|
|�|
���|||||	�}
|j	|
|||||	f�����|jtd�5|dddd�ddd�d|vr�|jt|dddd�|jt|ddd	d�|jt|dddd
�|jt|dddd�|jt|ddddd
�|jt|ddddd�|ddddd�
�}
|j	|
|jdd
d
�yy#1swY��xYw)Nz.*unsupported.*�unknownspassrYr�r
ssha1�passr�rr�rX)r;�passwordr��
iterations�dklen)�pbkdf2_resultsr~�	enumerate�pbkdf2_test_vectorsr��
memoryviewr�rEr�r�r�)r\�pbkdf2�	supported�digest_name�resultsr+�vectorrqr��roundsrs�expected�overwrite_dklenr�s              r!�_test_pbkdf2_hmaczKDFTests._test_pbkdf2_hmac(sZ��$(�$7�$7�$=�$=�$?� �K���)�+��&�t�'?�'?�@�	��6�06�-��$���,3�A�J�)��/�"�+�E��[�(�D�&�%�H��� � ��h�"-�x��v�u�!M�O��[�*�X�*>�'��-�v�u�>��� � ��h�/��[�)�H�*=�&�t�_�f�e�=��� � ��h�/��=� ��h��f�E�C��$�$�S�(�&1�8�T�6�%J�L�!A�%@�,�
#�
#�J�0A�
B��9�g�w��2�C��Y������6�7�G�W�a�
�
����6�6�6�6�1�
�
����F�F�G�W�a�
�
����F�F�G�W�b�
�
����F�F�G�W�a��
�
����F�F�G�W�a��
��6�K�g��D�*�C����S�$�"5�"5�f�"=�a�"@��"C�D�+�C�
B�s�H�H
zrequires OpenSSL bindingsc�L�|jtjt�yrd)r��openssl_hashlib�pbkdf2_hmacrr�s r!�test_pbkdf2_hmac_czKDFTests.test_pbkdf2_hmac_cYs������:�:�<Q�Rr �scryptz   test requires OpenSSL > 1.1zscrypt is blocked in FIPS mode)�reasonc
���|jD]5\}}}}}}tj|||||��}|j||��7tjddddd��|j	t
�5tjddddd��ddd�|j	t
�5tjddddd��ddd�|j	t
�5tjd�ddd�|j	t
�5tjdd�ddd�|j	t
�5tjddddd�	�ddd�d
D]E}|j	ttt
f�5tjdd|dd��ddd��GdD]E}|j	ttt
f�5tjddd|d��ddd��GdD]E}|j	ttt
f�5tjdddd|��ddd��GdD]F}|j	ttt
f�5tjddddd|�
�ddd��HdD]F}	|j	ttt
f�5tjddddd|	��ddd��Hy#1swY��VxYw#1swY��+xYw#1swY��xYw#1swY���xYw#1swY���xYw#1swY���xYw#1swY���xYw#1swY��DxYw#1swY��xYw#1swY��xYw)N)r��nr*�prXrYr�r�r�rqr�r�)r�rr�N)r�rN)r�N)r�r�r*r��maxmem)r�r�r*r�rs)�scrypt_test_vectorsrr�r�r�r�r�r�)
r\rqr�r�r*r�r~�resultr�rss
          r!�test_scryptzKDFTests.test_scrypt]s���26�1I�1I�-�H�d�A�q�!�X��^�^�H�4�1��Q�G�F����V�X�.�2J�
	���{��A��a�@�
�
�
�y�
)��N�N�:�G�q�A��C�*�
�
�
�y�
)��N�N�;�V�q�A��C�*��
�
�y�
)��N�N�;�'�*�
�
�
�y�
)��N�N�;��0�*�
�
�
�y�
)��N�N�;��1�a�g�>�*�!�A��"�"�J�
�y�#I�J����{��A��a�H�K�J�"��A��"�"�J�
�y�#I�J����{��A��a�H�K�J���A��"�"�J�
�y�#I�J����{��A��a�H�K�J��!�F��"�"�J�
�y�#I�J����{��A��a�&,�.�K�J�!� �E��"�"�J�
�y�#I�J����{��A��a�%*�,�K�J� �1*�
)��
)�
)��*�
)��
)�
)��
)�
)��K�J��K�J��K�J��K�J��K�J�sx�4K#�,K0�$K=�L
�L�L$�L1�'L>�1M�<M�#K-�0K:�=L�
L�L!�$L.	�1L;	�>M	�M	�M!	c��|jdtj�|jdtj�y)N�
blake2b512zsha3-512)r�rr�r�s r!�test_normalized_namezKDFTests.test_normalized_name�s.������w�'C�'C�D�����W�%A�%A�Br c�,�ddz}tj�}|jtjt
j�tt
jd�5}td�D]$}|j|�|j|��&	ddd�tt
jd�5}tj|tj�}ddd�|j|j�j��|j|j|j�|jt!|�t!|��|j#t$�5tjdd�ddd�|j#t$�5tt
jd�5}tj|d�ddd�ddd�|j#t$�5tt
jd�5}tj|d�ddd�ddd�y#1swY���xYw#1swY��rxYw#1swY��xYw#1swY��xYw#1swY��xYw#1swY�PxYw#1swYyxYw)Nreirr�rrr*)rr�
addCleanuprrrrrr�r|rr
r�r�rrr�r?r�r�)r\rf�d1rr�d2s      r!�test_file_digestzKDFTests.test_file_digest�s����e�|��
�^�^�
������	�	�9�#3�#3�4�
�)�"�"�D�
)�Q��2�Y���	�	�$������
��*�
�)�"�"�D�
)�Q��$�$�Q����7�B�*�	
�����������8�������"�'�'�*��
�
�d�2�h��R��)�
�
�
�z�
*�����h�/�+��
�
�z�
*��i�&�&��,���#�#�A�x�0�-�+��
�
�z�
*��i�&�&��-���#�#�A�x�0�.�+�
*�'*�
)��
*�
)��+�
*��-�,��+�
*��
.�-��+�
*�sl�"3I�8%I
�2I�&I2�I&�I2�=J
�I>�/J
�I
�
I�I#�&I/	�+I2�2I;�>J	�J
�
J)rHrIrJrvrr�r9r:rtr�r4rOr�r�rTr�rrr�r�r�rr r!rWrW�sw��	��

�c�2�q�!�Y�(j�k�	l�	�g�t�Q��I�7y�-z�	{�	�,�e�Q��9�FH�<I�	J����]�]�E�
F��M�
�]�]�E�
F��M�
�]�]�E�
F��M�
�]�]�&�'�(*�
,�
�]�]�=�
>��E�H��]�]�>�?�@D�
F�
�]�]�>�?�@D�
F�
�]�]�>�?�@D�
F��]�]�J�K�LN�
P�
�]�]�=�
>��E�H��]�]�>�?�@D�
F��]�]�>�?�@D�
F��]�]�>�?�@D�
F��]�]�>�?�@B�
D��]�]�=�
>��E�
H�-$�N�L/E�b�X�_�_�_��,�.I�J�S�K�S��X�����(�3�5�7��X�_�_�]�_�-M�N�#,�O�7�#,�JC�1r rW�__main__)6r��binasciirrrUrr�rr��	sysconfigr+r4rZr�r�test.supportrr�test.support.import_helperrrr	r
�http.clientr�default_builtin_hashes�get_config_varrYr6r{r8r��builtin_hashlibrrrrrr��	frozensetrarTrM�check_sanitizerr}rNr,r0r@�TestCaserBrWrH�main)r�s0r!�<module>r�s���
����	��	�
������(�:�"�*�)�%�O��)��)�)�*E�F����+�N�*�/�/��4�:�:�<�B�B�3�G��G�a����	�G��N�&�i�
�|�D���+�+�)�)�j�\�J�O��O��L�L���&�(�%�%�g�/A�B��
$�G�#�#�t�,�	�#��#�#�	�M�3C�D�
�
�1��
� K0�h�'�'�K0�\s1�x� � �s1�l�z���H�M�M�O���G$�����D��G�%�K��������G��s*�*E8�#E=�0F�=F�F�F �F 

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists