
    0hhAh                        S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKJrJ	r	  S SK
Jr   S SKrS SKJr  S SKJr  S SKJr   S SKrS r " S S	\R2                  5      r " S
 S\R2                  5      r " S S\R2                  5      r " S S\R2                  5      r " S S\R2                  5      r " S S\R2                  5      r\ S:X  a  \RB                  " 5         gg! \ a    SrSrSrSr Nf = f! \ a    Sr Nf = f)    N)hashlib_helpercheck_disallow_instantiation)_compare_digest)HMAC)hmac_new)compare_digestc                 F   ^  [         R                  " T 5      U 4S j5       nU$ )Nc                     > [         R                  " 5          [         R                  " S[        S9  T" U 0 UD6sS S S 5        $ ! , (       d  f       g = f)Nignore)category)warningscatch_warningsfilterwarningsDeprecationWarning)argskwargsfuncs     7/opt/python-3.13.8/usr/lib/python3.13/test/test_hmac.pywrapperignore_warning.<locals>.wrapper   s<    $$&##H-?A(( '&&s   !A
A)	functoolswraps)r   r   s   ` r   ignore_warningr      s%    __T) )
 N    c                   v   \ rS rSrS rS r\R                  " SSS9S 5       r\R                  " SSS9S	 5       r	S
 r
\R                  " SSS9S 5       r\R                  " SSS9S 5       r\R                  " SSS9S 5       r\R                  " SSS9S 5       r\R                  " S5      S 5       rS rS rSrg)TestVectorsTestCase(   c                    U R                  UR                  5       R                  5       UR                  5       5        U R                  UR                  5       [        R
                  " U5      5        U R                  UR                  SU 35        U R                  UR                  U5        U R                  UR                  U5        g )Nzhmac-)	assertEqual	hexdigestupperdigestbinascii	unhexlifynamedigest_size
block_size)selfhr"   hashnamer&   r'   s         r   assert_hmac_internals)TestVectorsTestCase.assert_hmac_internals*   s     	,,.?X%7%7%?@5
!344z2r   c                    [         R                  " XUS9nU R                  XXVU5        [         R                  " XUS9nU R                  XXVU5        [         R                  " XS9nUR                  5       n	U	R	                  S5        UR	                  U5        U R                  UR                  5       R                  5       UR                  5       5        [         R                  " XUS9nU R                  XXVU5        [         R                  " US US9nUR	                  U5        U R                  UR                  5       R                  5       UR                  5       5        [         R                  " XS9nUR	                  U5        U R                  UR                  5       R                  5       UR                  5       5        [         R                  " XUS9nU R                  UR                  5       R                  5       UR                  5       5        U R                  [         R                  " XUS9[        R                  " U5      5        U R                  [         R                  " XUS9[        R                  " U5      5        [         R                  R                  [         R                  5      nUR                  XUS9  U R                  XXVU5        [        Gb  [        XUS9nU R                  XXVU5        [        XS9nUR                  5       n	U	R	                  S5        UR	                  U5        U R                  UR                  5       R                  5       UR                  5       5        [        [         SU 35      n
[        XU
S9nU R                  XXVU5        [         R                  R                  [         R                  5      nUR#                  XUS9  U R                  XXVU5        g g )N	digestmods   test update)r"   openssl_)hmacr   r+   copyupdater   r    r!   newr"   r#   r$   __new__	_init_old
c_hmac_newgetattr_hashopenssl
_init_hmac)r(   keydatar"   hashfuncr*   r&   r'   r)   h2r   s              r   assert_hmacTestVectorsTestCase.assert_hmac3   s    IIc84""xj	
 IIc84""xj	
 IIc.VVX
		.!	,,.?HHS(3""xj	
 HHS$(3	,,.?HHS-	,,.?HHS(3,,.?KK(3v&	
 	KK(3v&	

 IIdii(	C2""xj	
 !39A&&8* 33ABIIn%HHTNQ[[]002FLLNC<8H:)>?D35A&&8* 		!!$)),ALLhL7&&8*) "r   md5T)opensslc                    ^  U 4S jnU" SSS5        U" SSS5        U" SS	S
5        U" [        [        SS5      5      SS5        U" SSS5        U" SSS5        U" SSS5        g )Nc           
      J   > TR                  XU[        R                  SSSS9  g )NrA      @   r=   r*   r&   r'   )r?   hashlibrA   r;   r<   r"   r(   s      r   md5test5TestVectorsTestCase.test_md5_vectors.<locals>.md5test   s+    6   r         Hi There 9294727A3638BB1C13F48EF8158BFC9D   Jefe   what do ya want for nothing? 750c783e6ab0b503eaa86e310a5db738s   2    56be34521d144c88dbb8c733f0e8b3f6      2    697eaf0aca3a3aea3a75164746ffaa79s      Test With Truncation 56461ef2342edc00f9bab995690efd4cP   6   Test Using Larger Than Block-Size Key - Hash Key First 6b1ab7fe4bd7bf8f0b62e6ce61b9d0cdI   Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data 6f630fad67cda0ee1fb1f562db3aa53ebytesrange)r(   rJ   s   ` r   test_md5_vectors$TestVectorsTestCase.test_md5_vectors}   s    	 	2	4 	/2	4 	2	4 	eArl#2	4 	'2	4 	I2	4 	82	4r   sha1c                    ^  U 4S jnU" SSS5        U" SSS5        U" SS	S
5        U" [        [        SS5      5      SS5        U" SSS5        U" SSS5        U" SSS5        g )Nc           
      J   > TR                  XU[        R                  SSSS9  g )Nrd      rF   rG   )r?   rH   rd   rI   s      r   shatest5TestVectorsTestCase.test_sha_vectors.<locals>.shatest   s+    6   r      rM   (b617318655057264e28bc0b6fb378c8ef146be00rO   rP   (effcdf6ae5eb2fa2d27416d5f184df9c259a7c79   rR   (125d7342b9ac11cd91a39af48aa17b4f63f175d3rT   rU   rV   (4c9007f4026250c6bc8414f9bf50c86c2d7235das   rX   (4c1a03424b55e07fe7f27be1d58bb9324a9a5a04rZ   r[   (aa4ae5e15272d00e95705637ce8a3b55ed402112r]   (e8e99d0f45237d786d6bbaa7965c7808bbff1a91r_   )r(   rh   s   ` r   test_sha_vectors$TestVectorsTestCase.test_sha_vectors   s    	 	:	< 	/:	< 	:	< 	eArl#:	< 	':	< 	I:	< 	8:	<r   c                   ^ ^^^^ UUUUU 4S jnU" SS[         R                  S[         R                  S[         R                  S[         R                  S0S9  U" S	S
[         R                  S[         R                  S[         R                  S[         R                  S0S9  U" SS[         R                  S[         R                  S[         R                  S[         R                  S0S9  U" [        S [        SS5       5       5      S[         R                  S[         R                  S[         R                  S[         R                  S0S9  U" SS[         R                  S[         R                  S [         R                  S![         R                  S"0S9  U" SS#[         R                  S$[         R                  S%[         R                  S&[         R                  S'0S9  g )(Nc           
      8   > UT   nTR                  XUTTTTS9  g )NrG   )r?   )	r;   r<   
hexdigestsr"   r'   r&   	hash_namer=   r(   s	       r   hmactest9TestVectorsTestCase._rfc4231_test_cases.<locals>.hmactest   s1    )F6!"'%  r   rj   rM   8896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22@b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7`afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6ڀ87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854)r;   r<   rw   rO   rP   8a30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44@5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843`af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649ڀ164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737rm   rR   87fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333ea@773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe`88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27ڀfa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fbc              3   $   #    U  H  ov   M     g 7fN ).0xs     r   	<genexpr>:TestVectorsTestCase._rfc4231_test_cases.<locals>.<genexpr>  s     <(;1Q(;s   rT   rU   rV   86c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5a@82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b`3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffbڀb0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dds   r[   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)rH   sha224sha256sha384sha512r`   ra   )r(   r=   rx   r&   r'   ry   s   ````` r   _rfc4231_test_cases'TestVectorsTestCase._rfc4231_test_cases   s   		 		 	z#>> $>>> $F>> $F >> $F	" 	w7>> $>>> $F>> $F >> $F	" 	z">> $>>> $F>> $F >> $F	" 	u<dF(;<<">> $>>> $F>> $F >> $F	" 	{2 >> $>>> $F>> $F >> $F	$ 	{4 >> $>>> $F>> $F >> $F	r   r   c                 H    U R                  [        R                  SSS5        g )Nr      rF   )r   rH   r   r(   s    r   test_sha224_rfc4231'TestVectorsTestCase.test_sha224_rfc4231F        2rBr   r   c                 H    U R                  [        R                  SSS5        g )Nr       rF   )r   rH   r   r   s    r   test_sha256_rfc4231'TestVectorsTestCase.test_sha256_rfc4231J  r   r   r   c                 H    U R                  [        R                  SSS5        g )Nr   0      )r   rH   r   r   s    r   test_sha384_rfc4231'TestVectorsTestCase.test_sha384_rfc4231N        2sCr   r   c                 H    U R                  [        R                  SSS5        g )Nr   rF   r   )r   rH   r   r   s    r   test_sha512_rfc4231'TestVectorsTestCase.test_sha512_rfc4231R  r   r   c                     " S S[         5      n[        R                  " 5          [        R                  " S[        5        U R                  [        5         [        R                  " SSUS9  U R                  S5        S S S 5        SUl	        U R                  [        5         [        R                  " SSUS9  U R                  S	5        S S S 5        S S S 5        g ! , (       d  f       Nc= f! , (       d  f       N(= f! , (       d  f       g = f)
Nc                   *    \ rS rSrSrS rS rS rSrg)JTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHashiX  z#Ain't no block_size attribute here.c                 j    [         R                  " U6 U l        U R                  R                  U l        g r   )rH   r   _xr&   )r(   r   s     r   __init__STestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHash.__init__Z  s$    !..$/#'77#6#6 r   c                 :    U R                   R                  U5        g r   )r   r3   )r(   vs     r   r3   QTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHash.update]  s    q!r   c                 6    U R                   R                  5       $ r   )r   r"   r   s    r   r"   QTestVectorsTestCase.test_legacy_block_size_warnings.<locals>.MockCrazyHash.digest_  s    ww~~''r   )r   r&   N)	__name__
__module____qualname____firstlineno____doc__r   r3   r"   __static_attributes__r   r   r   MockCrazyHashr   X  s    57"(r   r   error   a   br.   z)Expected warning about missing block_sizerT   z'Expected warning about small block_size)
objectr   r   simplefilterRuntimeWarningassertRaisesr1   r   failr'   )r(   r   s     r   test_legacy_block_size_warnings3TestVectorsTestCase.test_legacy_block_size_warningsV  s    	(F 	( $$&!!'>:"">2		$>		EF 3 ()M$"">2		$>		CD 3 '&22
 32 '&s;   1C=(C>$C="(C,
C=
C)	%C=,
C:	6C==
Dc                    U R                  [        S5         SnSn[        R                  " XSS9  SSS5        U R                  [        S5         [        R                  " WW5        SSS5        U R                  [        S5         [        R                  " WWSS9  SSS5        g! , (       d  f       Nz= f! , (       d  f       NU= f! , (       d  f       g= f)z5The digestmod parameter is required as of Python 3.8.zrequired.*digestmodrL   rM   Nr.    )msgr/   )assertRaisesRegex	TypeErrorr1   r   r4   )r(   r;   r<   s      r   test_with_digestmod_no_default2TestVectorsTestCase.test_with_digestmod_no_defaultm  s    ##I/EFCDIIc40 G ##I/EFHHS$ G##I/EFIIctr2 GF GF GFFFs#   B%B6C%
B36
C
Cc                    [        [        S5      n [        R                  US'   [        R                  " SSS5      R                  5       nSnU R                  X#5        UR                  S5        g ! UR                  S5        f = f)N__builtin_constructor_cachefoo   keys   message@6e9ef29b75fffc5b7abae527d58fdadb2fe42e7219011976917343065f58ed4a)r8   rH   r   r1   r"   hexr   pop)r(   cacher    expecteds       r   test_with_fallback&TestVectorsTestCase.test_with_fallbackx  sh    !>?	">>E%LFJ>BBDIYHY1IIeEIIes   AA0 0Br   N)r   r   r   r   r+   r?   r   requires_hashdigestrb   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r   (   s   3HT ''t<'4 ='4R ''=%< >%<Nun ''$?C @C ''$?C @C ''$?D @D ''$?D @D ''1E 2E,	3r   r   c                      \ rS rSrSr\R                  " S5      S 5       r\R                  " S5      S 5       r\R                  " S5      S 5       r	\R                  " S5      S 5       r
\R                  " S5      S 5       r\R                  " S5      S	 5       r\R                  " S5      S
 5       r\R                  " \SLS5      S 5       r\R                  " \SLS5      S 5       rSrg)ConstructorTestCasei  @6c845b47f52b3b47f6590c502db7825aad757bf4fadc8fa972f7cd2e76a5bdebr   c                 r     [         R                  " SSS9  g ! [         a    U R                  S5         g f = f)Nr   r   r.   z+Standard constructor call raised exception.)r1   r   	Exceptionr   r   s    r   test_normalConstructorTestCase.test_normal  s4    	EIIf1 	EIICD	Es    66c                     U R                  [        5         [        R                  " SSS9nS S S 5        g ! , (       d  f       g = fNr;   r   r.   )r   r   r1   r   r(   r)   s     r   test_with_str_key%ConstructorTestCase.test_with_str_key  s.     y)		%84A *))	   5
Ac                     U R                  [        5         [        R                  " SSS9nS S S 5        g ! , (       d  f       g = fr   )r   r   r1   r4   r   s     r   test_dot_new_with_str_key-ConstructorTestCase.test_dot_new_with_str_key  s.     y)(3A *))r   c                      [         R                  " SSSS9nU R	                  WR                  5       U R                  5        g ! [         a    U R                  S5         NHf = f)Nr   
   hash this!r   r.   z5Constructor call with text argument raised exception.)r1   r   r   r   r   r    r   r   s     r   test_withtext!ConstructorTestCase.test_withtext  sV    	O		&-8DA 	6  	OIIMN	Os   A A! A!c                      [         R                  " [        S5      [        S5      SS9nU R                  WR                  5       U R                  5        g ! [         a    U R	                  S5         NHf = f)Nr   r   r   r.   z;Constructor call with bytearray arguments raised exception.)r1   r   	bytearrayr   r   r   r    r   r   s     r   test_with_bytearray'ConstructorTestCase.test_with_bytearray  sc    	U		)F+Y}-E$,.A 	6  	UIIST	Us   (A A32A3c                      [         R                  " S[        S5      SS9nU R                  WR                  5       U R                  5        g ! [         a    U R	                  S5         NHf = f)Nr   r   r   r.   z6Constructor call with memoryview msg raised exception.)r1   r   
memoryviewr   r   r   r    r   r   s     r   test_with_memoryview_msg,ConstructorTestCase.test_with_memoryview_msg  s[    	P		&*]";xPA 	6  	PIINO	Ps   A A*)A*c                      [         R                  " SS[        R                  5      ng ! [         a    U R                  S5         g f = f)Nr   r   z6Constructor call with hashlib.sha256 raised exception.)r1   r   rH   r   r   r   r   s     r   test_withmodule#ConstructorTestCase.test_withmodule  s<    	P		&#w~~6A 	PIINO	Ps   &) AANzneed _hashlibc                     [        U [        5        U R                  [        S5         S [        l        S S S 5        g ! , (       d  f       g = f)Nzimmutable type)r   C_HMACr   r   valuer   s    r   test_internal_types'ConstructorTestCase.test_internal_types  s3     	%T62##I/?@FL A@@s	   <
A
zneed _sha256c                    [         R                  " SS[        R                  S9nU R	                  UR                  5       U R                  5        U R	                  UR                  S5        [         R                  " SS[        R                  5      nU R	                  U[        R                  " U R                  5      5        g )Nr   r   r.   zhmac-sha256)r1   r   sha256_moduler   r   r    r   r%   r"   r#   r$   )r(   r)   r"   s      r   test_with_sha256_module+ConstructorTestCase.test_with_sha256_module  s    IIfm}7K7KL6/V]M4H4HI!3!3DMM!BCr   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   unittest
skipUnlessr  r  r  r	  r   r   r   r   r   r     s9    	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 t+_=  >  d2NCD DDr   r   c                   D    \ rS rSr\R
                  " S5      S 5       rSrg)SanityTestCasei  r   c                      [         R                  " SSS9nUR                  S5        UR                  5         UR	                  5         UR                  5         g ! [         a    U R                  S5         g f = f)Ns   my secret keyr   r.   s   compute the hash of this text!z3Exception raised during normal usage of HMAC class.)r1   r   r3   r"   r    r2   r   r   r   s     r   test_exercise_all_methods(SanityTestCase.test_exercise_all_methods  s_    	M		*h?AHH67HHJKKMFFH 	MIIKL	Ms   AA A76A7r   N)r   r   r   r   r   r   r  r   r   r   r   r  r    s!    ''1
M 2
Mr   r  c                   D    \ rS rSr\R
                  " S5      S 5       rSrg)UpdateTestCasei  r   c                     U R                  [        5         [        R                  " SSS9nUR	                  S5        S S S 5        g ! , (       d  f       g = f)Nr   r   r.   zinvalid update)r   r   r1   r4   r3   r   s     r   test_with_str_update#UpdateTestCase.test_with_str_update  s9    y)84AHH%& *))s   'A
Ar   N)r   r   r   r   r   r   r  r   r   r   r   r  r    s    ''1' 2'r   r  c                   4   \ rS rSr\R
                  " S5      S 5       r\R
                  " S5      S 5       r\R                  " \
SL S5      \R
                  " S5      S 5       5       r\R
                  " S5      S 5       r\R
                  " S5      S	 5       rS
rg)CopyTestCasei  r   c                    [         R                  R                  [         R                  5      nUR                  SSSS9  UR	                  5       nU R                  [        UR                  5      [        UR                  5      S5        U R                  [        UR                  5      [        UR                  5      S5        g )Nr      msgr   r.   zTypes of inner don't match.zTypes of outer don't match.)	r1   r   r5   r6   r2   r   type_inner_outerr(   h1r>   s      r   test_attributes_old CopyTestCase.test_attributes_old  s     YYtyy)
VVx8WWYbii$ryy/)	+bii$ryy/)	+r   c                    [         R                  R                  [         R                  5      nUR                  SSSS9  UR	                  5       nU R                  [        U5      [        U5      :g  S5        U R                  [        UR                  5      [        UR                  5      :g  S5        U R                  [        UR                  5      [        UR                  5      :g  S5        U R                  UR                  S 5        g )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'.)r1   r   r5   r6   r2   
assertTrueidr  r  assertIs_hmacr  s      r   test_realcopy_oldCopyTestCase.test_realcopy_old  s     YYtyy)
VVx8WWY2"R&(*NO299BII64	6299BII64	6bhh%r   Nztest requires _hashopensslc                    [         R                  R                  [         R                  5      nUR                  SSSS9  UR	                  5       nU R                  [        UR                  5      [        UR                  5      :g  5        g )Nr   r  r   r.   )r1   r   r5   r:   r2   r$  r%  r'  r  s      r   test_realcopy_hmacCopyTestCase.test_realcopy_hmac  sZ     YYtyy)
ff9WWY28828845r   c                 ,   [         R                  " SSS9nUR                  S5        UR                  5       nU R	                  UR                  5       UR                  5       S5        U R	                  UR                  5       UR                  5       S5        g )Nr   r   r.      some random text-Digest of copy doesn't match original digest.3Hexdigest of copy doesn't match original hexdigest.)r1   r   r3   r2   r   r"   r    r  s      r   test_equalityCopyTestCase.test_equality  so     YYv2
		%&WWYbiik;	=A	Cr   c                 z   [         R                  " SSS9nUR                  S5        UR                  5       nU R	                  [        U5      [        U5      :g  S5        U R                  UR                  5       UR                  5       S5        U R                  UR                  5       UR                  5       S5        g )Nr   r   r.   r.  r#  r/  r0  )	r1   r4   r3   r2   r$  r%  r   r"   r    r  s      r   test_equality_newCopyTestCase.test_equality_new  s     XXf1
		%&WWYrFbfB	
 	biik;	=A	Cr   r   )r   r   r   r   r   r   r   r(  r  skipIfr9   r+  r1  r4  r   r   r   r   r  r    s    ''1+ 2+ ''1& 2& __\T)+GH''16 2 I6 ''1C 2C ''1C 2Cr   r  c                   \    \ rS rSrS rS r\R                  " \SL S5      S 5       r	S r
Srg)	CompareDigestTestCasei'  c                     U R                  [        R                  5        [        b%  U R	                  [        R                  [        5        g U R	                  [        R                  [
        5        g r   )_test_compare_digestr1   r   openssl_compare_digestr&  operator_compare_digestr   s    r   test_hmac_compare_digest.CompareDigestTestCase.test_hmac_compare_digest)  sF    !!$"5"56!-MM$--/EFMM$--/FGr   c                 .    U R                  [        5        g r   )r:  r<  r   s    r   test_operator_compare_digest2CompareDigestTestCase.test_operator_compare_digest0  s    !!"9:r   Nztest requires _hashlibc                 .    U R                  [        5        g r   )r:  r;  r   s    r   test_openssl_compare_digest1CompareDigestTestCase.test_openssl_compare_digest3  s    !!"89r   c                 V   Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  U" X#5      5        Su  p#U R                  U" X#5      5        Su  p#U R                  U" X#5      5        S	u  p#U R                  U" X#5      5        S
u  p#U R                  U" X#5      5        Su  p#U R                  U" X#5      5        [	        S5      [	        S5      p2U R                  U" X#5      5        [	        S5      [	        S5      p2U R                  U" X#5      5        [	        S5      [	        S5      p2U R                  U" X#5      5        [	        S5      Sp2U R                  U" X#5      5        U R                  U" X25      5        [	        S5      Sp2U R                  U" X#5      5        U R                  U" X25      5        [	        S5      Sp2U R                  U" X#5      5        U R                  U" X25      5        Su  p#U R                  U" X#5      5        Su  p#U R                  U" X#5      5        Su  p#U R                  U" X#5      5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5        Su  p#U R                  [        XU5         " S S[
        5      nU" S5      U" S5      p2U R                  U" X#5      5        U" S5      Sp2U R                  U" X#5      5        U" S5      U" S5      p2U R                  U" X#5      5         " S S[        5      nU" S5      U" S5      p2U R                  U" X#5      5        U" S5      Sp2U R                  U" X#5      5        U" S5      U" S5      p2U R                  U" X#5      5        g )N)d      )rF     foobar)rH  rG  )foobarrH  )rH  rI  )rH     foo)   ޭs   ޭ)rH     foobaz)rK  s   )rH  rH  )rK  rK  rH  rJ  rL  )rI  rI  )r   rI  )rI  foobaz)rH  rT   )   fooärN  c                       \ rS rSrS rSrg)9CompareDigestTestCase._test_compare_digest.<locals>.mystri  c                     gNFr   r(   others     r   __eq__@CompareDigestTestCase._test_compare_digest.<locals>.mystr.__eq__      r   r   Nr   r   r   r   rU  r   r   r   r   mystrrP        r   rY  rI  rM  c                       \ rS rSrS rSrg);CompareDigestTestCase._test_compare_digest.<locals>.mybytesi  c                     grR  r   rS  s     r   rU  BCompareDigestTestCase._test_compare_digest.<locals>.mybytes.__eq__  rW  r   r   NrX  r   r   r   mybytesr\    rZ  r   r_  )r   r   assertFalser$  r   strr`   )r(   r   abrY  r_  s         r   r:  *CompareDigestTestCase._test_compare_digest7  s   )^:)^:)^:")^:")^: !-./-. $-.7-. $q,-7q,- #Yy%91q,- #Yv%61-. #Yy%91-. #Y1q,-q,- #V1-.-. #Y1-.-. "q,- -. "-. #)^:")^:)^:)^:)^:	C 	 Xh1q,-X1q,-Xh1-.	e 	 y!79#51q,-y!91q,-y!79#51-.r   r   )r   r   r   r   r=  r@  r  r6  r;  rC  r:  r   r   r   r   r8  r8  '  s:    H; __+t35MN: O:g/r   r8  __main__)"r#   r   r1   rH   r  unittest.mockr   test.supportr   r   	_operatorr   r<  _hashlibr9   r   r  r   r7   r   r;  ImportError_sha256r  r   TestCaser   r   r  r  r  r8  r   mainr   r   r   <module>rn     s          E @	"#'/A#
X(++ Xv
LD(++ LD^MX&& M 'X&& ':C8$$ :Czw/H-- w/t zMMO _  "LFJ!	"  Ms#   C! C5 !C21C25D ?D 