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_hmac.cpython-312.opt-1.pyc

�

'ΜgAh���ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZ	ddl
Zddl
mZddl
mZddl
mZ	ddlZd�ZGd�d	ej2�ZGd
�dej2�ZGd�d
ej2�ZGd�dej2�ZGd�dej2�ZGd�dej2�Ze dk(rejB�yy#e$rdZdZdZdZY��wxYw#e$rdZY��wxYw)�N)�hashlib_helper�check_disallow_instantiation)�_compare_digest)�HMAC)�hmac_new)�compare_digestc�B��tj���fd��}|S)Nc���tj�5tjdt���|i|��cddd�S#1swYyxYw)N�ignore)�category)�warnings�catch_warnings�filterwarnings�DeprecationWarning)�args�kwargs�funcs  ��+/usr/local/lib/python3.12/test/test_hmac.py�wrapperzignore_warning.<locals>.wrappers<���
�
$�
$�
&��#�#�H�-?�
A���(��(�'�
&�
&�s�#A�A)�	functools�wraps)rrs` r�ignore_warningrs%����_�_�T��)��)�
�N�c��eZdZd�Zd�Zejdd��d��Zejdd��d��Zd	�Z	ejd
d��d��Z
ejdd��d
��Zejdd��d��Zejdd��d��Z
ejd�d��Zd�Zd�Zy)�TestVectorsTestCasec��|j|j�j�|j��|j|j�t	j
|��|j|jd|���|j|j|�|j|j|�y)Nzhmac-)	�assertEqual�	hexdigest�upper�digest�binascii�	unhexlify�name�digest_size�
block_size)�self�hr �hashnamer$r%s      r�assert_hmac_internalsz)TestVectorsTestCase.assert_hmac_internals*s���	
�������,�,�.�����?��������X�%7�%7��%?�@�������5��
�!3�4��������4�������z�2rc�R�tj|||��}|j|||||�tj|||��}|j|||||�tj||��}|j�}	|	j	d�|j	|�|j|j
�j�|j��tj|||��}|j|||||�tj|d|��}|j	|�|j|j
�j�|j��tj||��}|j	|�|j|j
�j�|j��tj|||��}|j|j
�j�|j��|jtj|||��tj|��|jtj|||��tj|��tjjtj�}|j|||��|j|||||�t��+t|||��}|j|||||�t||��}|j�}	|	j	d�|j	|�|j|j
�j�|j��tt d|���}
t|||
��}|j|||||�tjjtj�}|j#|||��|j|||||�yy)N��	digestmodstest update)r �openssl_)�hmacrr)�copy�updaterrr�newr r!r"�__new__�	_init_old�
c_hmac_new�getattr�_hashopenssl�
_init_hmac)r&�key�datar �hashfuncr(r$r%r'�h2rs           r�assert_hmaczTestVectorsTestCase.assert_hmac3sB��
�I�I�c�4�8�4���"�"�
�v�x��j�	
�
�I�I�c�4�8�4���"�"�
�v�x��j�	
�
�I�I�c�X�.��
�V�V�X��
�	�	�.�!�	������������,�,�.�����?��H�H�S�$�(�3���"�"�
�v�x��j�	
�
�H�H�S�$�(�3��	������������,�,�.�����?��H�H�S�H�-��	������������,�,�.�����?��H�H�S�$�(�3���������,�,�.�����?�����K�K��T�(�3����v�&�	
�	
����K�K��T�(�3����v�&�	
�

�I�I���d�i�i�(��	���C����2��"�"�
�v�x��j�	
��!��3���9�A��&�&��6�8�[�*�
��3�(�3�A�����B��I�I�n�%�
�H�H�T�N����Q�[�[�]�0�0�2�F�L�L�N�C��<�8�H�:�)>�?�D��3���5�A��&�&��6�8�[�*�
��	�	�!�!�$�)�)�,�A�
�L�L��d�h�L�7��&�&��6�8�[�*�
�)"r�md5T)�opensslc�����fd�}|ddd�|ddd�|dd	d
�|ttdd��d
d�|ddd�|ddd�|ddd�y)Nc	�R���j|||tjddd��y)Nr=��@�r:r(r$r%)r<�hashlibr=�r8r9r r&s   �r�md5testz5TestVectorsTestCase.test_md5_vectors.<locals>.md5test�s-�������T�6� ������
�
r��Hi There� 9294727A3638BB1C13F48EF8158BFC9D�Jefe�what do ya want for nothing?� 750c783e6ab0b503eaa86e310a5db738s�����������������2��������������������������������������������������� 56be34521d144c88dbb8c733f0e8b3f6���2��������������������������������������������������� 697eaf0aca3a3aea3a75164746ffaa79s�Test With Truncation� 56461ef2342edc00f9bab995690efd4c�P���������������������������������������������������������������������������������6Test Using Larger Than Block-Size Key - Hash Key First� 6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd�ITest Using Larger Than Block-Size Key and Larger Than One Block-Size Data� 6f630fad67cda0ee1fb1f562db3aa53e��bytes�range)r&rFs` r�test_md5_vectorsz$TestVectorsTestCase.test_md5_vectors}s����	�	���2�	4�	��/�2�	4�	���2�	4�	��e�A�r�l�#��2�	4�	��'�2�	4�	��I�2�	4�	��8�2�	4r�sha1c�����fd�}|ddd�|ddd�|dd	d
�|ttdd��d
d�|ddd�|ddd�|ddd�y)Nc	�R���j|||tjddd��y)Nr^�rBrC)r<rDr^rEs   �r�shatestz5TestVectorsTestCase.test_sha_vectors.<locals>.shatest�s-�������T�6� ������
�
r�rH�(b617318655057264e28bc0b6fb378c8ef146be00rJrK�(effcdf6ae5eb2fa2d27416d5f184df9c259a7c79���������������������rM�(125d7342b9ac11cd91a39af48aa17b4f63f175d3rOrPrQ�(4c9007f4026250c6bc8414f9bf50c86c2d7235dasrS�(4c1a03424b55e07fe7f27be1d58bb9324a9a5a04rUrV�(aa4ae5e15272d00e95705637ce8a3b55ed402112rX�(e8e99d0f45237d786d6bbaa7965c7808bbff1a91rZ)r&rbs` r�test_sha_vectorsz$TestVectorsTestCase.test_sha_vectors�s����	�	���:�	<�	��/�:�	<�	���:�	<�	��e�A�r�l�#��:�	<�	��'�:�	<�	��I�:�	<�	��8�:�	<rc�������������fd�}|ddtjdtjdtjdtjdi��|d	d
tjdtjdtjd
tjdi��|ddtjdtjdtjdtjdi��|td�t
dd�D��dtjdtjdtjdtjdi��|ddtjdtjd tjd!tjd"i��|dd#tjd$tjd%tjd&tjd'i��y)(Nc	�@��|�}�j|||������y)NrC)r<)	r8r9�
hexdigestsr r%r$�	hash_namer:r&s	    �����r�hmactestz9TestVectorsTestCase._rfc4231_test_cases.<locals>.hmactest�s3�����)�F�����T�6�!�"�'�%�
�
rrcrH�8896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22�@b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7�`afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6ڀ87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854)r8r9rorJrK�8a30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44�@5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843�`af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649ڀ164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737rfrM�87fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333ea�@773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe�`88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27ڀfa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fbc3� K�|]}|���y�w�N�)�.0�xs  r�	<genexpr>z:TestVectorsTestCase._rfc4231_test_cases.<locals>.<genexpr>s����<�(;�1�Q�(;�s�rOrPrQ�86c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5a�@82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b�`3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffbڀb0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dds������������������������������������������������������������������������������������������������������������������������������������rV�895e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870e�@60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54�`4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952ڀ80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598s�This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.�83a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1�@9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2�`6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523eڀe37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58)rD�sha224�sha256�sha384�sha512r[r\)r&r:rpr$r%rqs````` r�_rfc4231_test_casesz'TestVectorsTestCase._rfc4231_test_cases�s����		�		�	�z�#��>�>�$>��>�>�$F��>�>�$F��>�>�$F��	�"	�w�7��>�>�$>��>�>�$F��>�>�$F��>�>�$F��	�"	�z�"��>�>�$>��>�>�$F��>�>�$F��>�>�$F��	�"	�u�<��d�F�(;�<�<�"��>�>�$>��>�>�$F��>�>�$F��>�>�$F��	�"	�{�2��>�>�$>��>�>�$F��>�>�$F��>�>�$F��	�$	�{�4��>�>�$>��>�>�$F��>�>�$F��>�>�$F��
	rr�c�H�|jtjddd�y)Nr��rB)r�rDr��r&s r�test_sha224_rfc4231z'TestVectorsTestCase.test_sha224_rfc4231F���� � �����2�r�Brr�c�H�|jtjddd�y)Nr�� rB)r�rDr�r�s r�test_sha256_rfc4231z'TestVectorsTestCase.test_sha256_rfc4231Jr�rr�c�H�|jtjddd�y)Nr��0�)r�rDr�r�s r�test_sha384_rfc4231z'TestVectorsTestCase.test_sha384_rfc4231N���� � �����2�s�Crr�c�H�|jtjddd�y)Nr�rBr�)r�rDr�r�s r�test_sha512_rfc4231z'TestVectorsTestCase.test_sha512_rfc4231Rr�rc��Gd�dt�}tj�5tjdt�|jt�5t
jdd|��|jd�ddd�d|_	|jt�5t
jdd|��|jd	�ddd�ddd�y#1swY�`xYw#1swY�xYw#1swYyxYw)
Nc�"�eZdZdZd�Zd�Zd�Zy)�JTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHashz#Ain't no block_size attribute here.c�h�tj|�|_|jj|_yr)rDr��_xr$)r&rs  r�__init__zSTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHash.__init__Zs$��!�.�.�$�/���#'�7�7�#6�#6�� rc�:�|jj|�yr)r�r0)r&�vs  rr0zQTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHash.update]s�������q�!rc�6�|jj�Sr)r�r r�s rr zQTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHash.digest_s���w�w�~�~�'�'rN)�__name__�
__module__�__qualname__�__doc__r�r0r r�rr�
MockCrazyHashr�Xs��5�
7�
"�
(rr��error�a�br+z)Expected warning about missing block_sizerOz'Expected warning about small block_size)
�objectr
r�simplefilter�RuntimeWarning�assertRaisesr.r�failr%)r&r�s  r�test_legacy_block_size_warningsz3TestVectorsTestCase.test_legacy_block_size_warningsVs���	(�F�	(��
$�
$�
&��!�!�'�>�:��"�"�>�2��	�	�$��
�>��	�	�E�F�3�()�M�$��"�"�>�2��	�	�$��
�>��	�	�C�D�3�'�
&�2�2��
3�2��'�
&�s;�0C5�*C�>$C5�"*C)�C5�C&	�"C5�)C2	�.C5�5C>c��|jtd�5d}d}tj||d��ddd�|jtd�5tj�ddd�|jtd�5tjd��ddd�y#1swY�vxYw#1swY�MxYw#1swYyxYw)z5The digestmod parameter is required as of Python 3.8.zrequired.*digestmodrGrHNr+�)�msgr,)�assertRaisesRegex�	TypeErrorr.rr1)r&r8r9s   r�test_with_digestmod_no_defaultz2TestVectorsTestCase.test_with_digestmod_no_defaultms���
�
#�
#�I�/E�
F��C��D��I�I�c�4�4�0�G��
#�
#�I�/E�
F��H�H�S�$��G�
�
#�
#�I�/E�
F��I�I�c�t�r�2�G�
F�
G�
F��G�
F��
F�
F�s#�B)�B5�C�)B2�5B>�C
c��ttd�}	tj|d<tjddd�j�}d}|j
||�|jd�y#|jd�wxYw)N�__builtin_constructor_cache�foo�keysmessage�@6e9ef29b75fffc5b7abae527d58fdadb2fe42e7219011976917343065f58ed4a)r5rDr�r.r �hexr�pop)r&�cacher�expecteds    r�test_with_fallbackz&TestVectorsTestCase.test_with_fallbackxsj����!>�?��	�"�>�>�E�%�L����F�J��>�B�B�D�I�Y�H����Y��1��I�I�e���E�I�I�e��s�AA0�0BN)r�r�r�r)r<r�requires_hashdigestr]rlr�r�r�r�r�r�r�r�r�rrrr(s"��3�H�T(�^�'�'��t�<�'4�=�'4�R(�^�'�'���=�%<�>�%<�Nu�n(�^�'�'��$�?�C�@�C�(�^�'�'��$�?�C�@�C�(�^�'�'��$�?�D�@�D�(�^�'�'��$�?�D�@�D�(�^�'�'��1�E�2�E�,	3�rrc���eZdZdZej
d�d��Zej
d�d��Zej
d�d��Zej
d�d��Z	ej
d�d��Z
ej
d�d��Zej
d�d	��Ze
jed
ud�d��Ze
jed
ud
�d��Zy
)�ConstructorTestCase�@6c845b47f52b3b47f6590c502db7825aad757bf4fadc8fa972f7cd2e76a5bdebr�c�t�	tjdd��y#t$r|jd�YywxYw)Nr�r�r+z+Standard constructor call raised exception.)r.r�	Exceptionr�r�s r�test_normalzConstructorTestCase.test_normal�s4��	E��I�I�f��1���	E��I�I�C�D�	E�s��7�7c��|jt�5tjdd��}ddd�y#1swYyxYw�Nr8r�r+)r�r�r.r�r&r's  r�test_with_str_keyz%ConstructorTestCase.test_with_str_key�s.���
�
�y�
)��	�	�%�8�4�A�*�
)�
)��	�7�Ac��|jt�5tjdd��}ddd�y#1swYyxYwr�)r�r�r.r1r�s  r�test_dot_new_with_str_keyz-ConstructorTestCase.test_dot_new_with_str_key�s.���
�
�y�
)�����(�3�A�*�
)�
)�r�c���	tjddd��}|j	j�|j�y#t$r|jd�Y�GwxYw)Nr��
hash this!r�r+z5Constructor call with text argument raised exception.)r.rr�r�rrr�r�s  r�
test_withtextz!ConstructorTestCase.test_withtext�sV��	O��	�	�&�-�8�D�A�	
��������
�
�6���	O��I�I�M�N�	O�s�A�A"�!A"c���	tjtd�td�d��}|jj
�|j�y#t$r|j	d�Y�GwxYw)Nr�r�r�r+z;Constructor call with bytearray arguments raised exception.)r.r�	bytearrayr�r�rrr�r�s  r�test_with_bytearrayz'ConstructorTestCase.test_with_bytearray�sc��	U��	�	�)�F�+�Y�}�-E�$,�.�A�	
��������
�
�6���	U��I�I�S�T�	U�s�*A�A4�3A4c���	tjdtd�d��}|jj
�|j�y#t$r|j	d�Y�GwxYw)Nr�r�r�r+z6Constructor call with memoryview msg raised exception.)r.r�
memoryviewr�r�rrr�r�s  r�test_with_memoryview_msgz,ConstructorTestCase.test_with_memoryview_msg�s[��	P��	�	�&�*�]�";�x�P�A�	
��������
�
�6���	P��I�I�N�O�	P�s�!A�A+�*A+c��	tjddtj�}y#t$r|jd�YywxYw)Nr�rz6Constructor call with hashlib.sha256 raised exception.)r.rrDr�r�r�r�s  r�test_withmodulez#ConstructorTestCase.test_withmodule�s<��	P��	�	�&�#�w�~�~�6�A���	P��I�I�N�O�	P�s�%(�A�ANz
need _hashlibc��t|t�|jtd�5dt_ddd�y#1swYyxYw)Nzimmutable type)r�C_HMACr�r��valuer�s r�test_internal_typesz'ConstructorTestCase.test_internal_types�s3��	%�T�6�2�
�
#�
#�I�/?�
@��F�L�A�
@�
@�s	�<�Azneed _sha256c��tjddtj��}|j	|j�|j�|j	|jd�tjddtj�}|j	|tj|j��y)Nr�r�r+zhmac-sha256)r.r�
sha256_moduler�rrr�r#r r!r")r&r'r s   r�test_with_sha256_modulez+ConstructorTestCase.test_with_sha256_module�s���I�I�f�m�}�7K�7K�L����������
�
�6��������/����V�]�M�4H�4H�I�������!3�!3�D�M�M�!B�Cr)r�r�r�r�rr�r�r�r�r�r�r�r��unittest�
skipUnlessr�r�r�r�r�rrr�r��sK��	K�
�(�^�'�'��1�E�2�E�(�^�'�'��1�5�2�5�(�^�'�'��1�4�2�4�(�^�'�'��1�7�2�7�(�^�'�'��1�7�2�7�(�^�'�'��1�7�2�7�(�^�'�'��1�P�2�P��X����t�+�_�=� �>� ��X����d�2�N�C�D�D�Drr�c�<�eZdZejd�d��Zy)�SanityTestCaser�c��	tjdd��}|jd�|j�|j	�|j�y#t$r|jd�YywxYw)Ns
my secret keyr�r+scompute the hash of this text!z3Exception raised during normal usage of HMAC class.)r.rr0r rr/r�r�r�s  r�test_exercise_all_methodsz(SanityTestCase.test_exercise_all_methods�s_��	M��	�	�*�h�?�A�
�H�H�6�7�
�H�H�J�
�K�K�M�
�F�F�H���	M��I�I�K�L�	M�s�AA�A8�7A8N)r�r�r�rr�r�r�rrr�r��s#��'�^�'�'��1�
M�2�
Mrr�c�<�eZdZejd�d��Zy)�UpdateTestCaser�c��|jt�5tjdd��}|j	d�ddd�y#1swYyxYw)Nr�r�r+zinvalid update)r�r�r.r1r0r�s  r�test_with_str_updatez#UpdateTestCase.test_with_str_update�s9��
�
�
�y�
)�����8�4�A�
�H�H�%�&�*�
)�
)�s�)A�AN)r�r�r�rr�r�r�rrr�r��s!��'�^�'�'��1�'�2�'rr�c�,�eZdZejd�d��Zejd�d��Zeje	dud�ejd�d���Z
ejd�d��Zejd�d��Zy)	�CopyTestCaser�c��tjjtj�}|jddd��|j	�}|jt
|j�t
|j�d�|jt
|j�t
|j�d�y)Nr��msgr�r+zTypes of inner don't match.zTypes of outer don't match.)	r.rr2r3r/r�type�_inner�_outer�r&�h1r;s   r�test_attributes_oldz CopyTestCase.test_attributes_old�s����Y�Y�
�
�t�y�y�
)��
���V�V�x��8�
�W�W�Y������b�i�i��$�r�y�y�/�)�	+�����b�i�i��$�r�y�y�/�)�	+rc��tjjtj�}|jddd��|j	�}|jt
|�t
|�k7d�|jt
|j�t
|j�k7d�|jt
|j�t
|j�k7d�|j|jd�y)Nr�r�r�r+�"No real copy of the HMAC instance.z&No real copy of the attribute 'inner'.z&No real copy of the attribute 'outer'.)r.rr2r3r/�
assertTrue�idr�r��assertIs�_hmacr�s   r�test_realcopy_oldzCopyTestCase.test_realcopy_old�s����Y�Y�
�
�t�y�y�
)��
���V�V�x��8�
�W�W�Y������2��"�R�&�(�*N�O�����2�9�9�
��B�I�I��6�4�	6�����2�9�9�
��B�I�I��6�4�	6��
�
�b�h�h��%rNztest requires _hashopensslc��tjjtj�}|jddd��|j	�}|jt
|j�t
|j�k7�y)Nr�r�r�r+)r.rr2r7r/rrrr�s   r�test_realcopy_hmaczCopyTestCase.test_realcopy_hmacsZ���Y�Y�
�
�t�y�y�
)��
�
�
�f�f��
�9�
�W�W�Y������2�8�8���2�8�8��4�5rc�0�tjdd��}|jd�|j�}|j	|j�|j�d�|j	|j
�|j
�d�y)Nr�r�r+�some random text�-Digest of copy doesn't match original digest.�3Hexdigest of copy doesn't match original hexdigest.)r.rr0r/rr rr�s   r�
test_equalityzCopyTestCase.test_equality
so���Y�Y�v��
2��
�	�	�%�&�
�W�W�Y���������b�i�i�k�;�	=������������A�	Crc�~�tjdd��}|jd�|j�}|j	t|�t|�k7d�|j
|j�|j�d�|j
|j�|j�d�y)Nr�r�r+r	rr
r)	r.r1r0r/rrrr rr�s   r�test_equality_newzCopyTestCase.test_equality_news����X�X�f��
1��
�	�	�%�&�
�W�W�Y������r�F�b��f��B�	
�	
�������b�i�i�k�;�	=������������A�	Cr)
r�r�r�rr�r�rr��skipIfr6rrrr�rrr�r��s���'�^�'�'��1�+�2�+�(�^�'�'��1�&�2�&��X�_�_�\�T�)�+G�H�'�^�'�'��1�6�2�I�6�(�^�'�'��1�C�2�C�(�^�'�'��1�C�2�Crr�c�T�eZdZd�Zd�Zejedud�d��Zd�Z	y)�CompareDigestTestCasec���|jtj�t�%|j	tjt�y|j	tjt
�yr)�_test_compare_digestr.r�openssl_compare_digestr�operator_compare_digestr�s r�test_hmac_compare_digestz.CompareDigestTestCase.test_hmac_compare_digest)sF���!�!�$�"5�"5�6�!�-��M�M�$�-�-�/E�F��M�M�$�-�-�/F�Grc�.�|jt�yr)rrr�s r�test_operator_compare_digestz2CompareDigestTestCase.test_operator_compare_digest0s���!�!�"9�:rNztest requires _hashlibc�.�|jt�yr)rrr�s r�test_openssl_compare_digestz1CompareDigestTestCase.test_openssl_compare_digest3s���!�!�"8�9rc���d\}}|jt|||�d\}}|jt|||�d\}}|jt|||�d\}}|jt|||�d\}}|jt|||�d\}}|j|||��d\}}|j|||��d\}}|j|||��d	\}}|j|||��d
\}}|j|||��d\}}|j|||��t	d�t	d�}}|j|||��t	d�t	d
�}}|j|||��t	d�t	d�}}|j|||��t	d�d}}|j|||��|j|||��t	d�d
}}|j|||��|j|||��t	d�d}}|j|||��|j|||��d\}}|j|||��d\}}|j|||��d\}}|j|||��d\}}|jt|||�d\}}|jt|||�d\}}|jt|||�d\}}|jt|||�d\}}|jt|||�Gd�dt
�}|d�|d�}}|j|||��|d�d}}|j|||��|d�|d�}}|j|||��Gd�dt�}|d�|d�}}|j|||��|d�d}}|j|||��|d�|d�}}|j|||��y)N)�d��)r�foobar)rr)�foobarr)rr)r�foo)�ޭ��sޭ)r�foobaz)r!s���)rr)r!r!rr r")rr)r�r)r�foobaz)rrO)�fooär$c��eZdZd�Zy)�9CompareDigestTestCase._test_compare_digest.<locals>.mystrc��y�NFr��r&�others  r�__eq__z@CompareDigestTestCase._test_compare_digest.<locals>.mystr.__eq__����rN�r�r�r�r+r�rr�mystrr&����
rr.rr#c��eZdZd�Zy)�;CompareDigestTestCase._test_compare_digest.<locals>.mybytesc��yr(r�r)s  rr+zBCompareDigestTestCase._test_compare_digest.<locals>.mybytes.__eq__�r,rNr-r�rr�mybytesr1�r/rr3)r�r��assertFalserr��strr[)r&r�a�br.r3s      rrz*CompareDigestTestCase._test_compare_digest7sU�����1����)�^�Q��:����1����)�^�Q��:����1����)�^�Q��:�"���1����)�^�Q��:�"���1����)�^�Q��:�!���1������1�-�.�/���1������1�-�.�$���1������1�-�.�7���1������1�-�.�$���1�����q�!�,�-�7���1�����q�!�,�-���#�Y�y�%9�1������q�!�,�-���#�Y�v�%6�1�������1�-�.���#�Y�y�%9�1�������1�-�.���#�Y�1������q�!�,�-�����q�!�,�-���#�V�1�������1�-�.������1�-�.���#�Y�1�������1�-�.������1�-�.�"���1�����q�!�,�-����1������1�-�.�"���1������1�-�.�#���1����)�^�Q��:�"���1����)�^�Q��:����1����)�^�Q��:����1����)�^�Q��:����1����)�^�Q��:�	�C�	��X���h��1������q�!�,�-��X���1������q�!�,�-��X���h��1�������1�-�.�	�e�	��y�!�7�9�#5�1������q�!�,�-��y�!�9�1������q�!�,�-��y�!�7�9�#5�1�������1�-�.r)
r�r�r�rrr�rrrrr�rrrr's<��H�;��X�_�_�+�t�3�5M�N�:�O�:�g/rr�__main__)"r!rr.rDr��
unittest.mockr
�test.supportrr�	_operatorrr�_hashlibr6rr�rr4rr�ImportError�_sha256r�r�TestCaserr�r�r�r�rr��mainr�rr�<module>rAs���������E�@�	"�#�'�/�A��#�
�X�(�+�+�X�v
LD�(�+�+�LD�^
M�X�&�&�
M� '�X�&�&�'�:C�8�$�$�:C�zw/�H�-�-�w/�t�z���H�M�M�O���_�"��L�
�F��J�!��	"�����M��s#�C �C3� 
C0�/C0�3C=�<C=

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