+
    '(j&                     t   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RI	H
t
Ht ^ RIHt R t ! R R]P                  4      t ! R R	]P                  4      t ! R
 R]P                  4      t ! R R]P                  4      t ! R R]P                  4      t ! R R]P                  4      tR/ 3R ltR tR# )z&Self-testing for PyCrypto hash modulesN)hexlify	unhexlify)btobytes)strxor_cc                 Z    \         P                  ! R R\        V 4      4      p\        V4      # )s   \s+    )resubr   r   )
hex_stringshorters   & P/home/ubuntu/cf-venv/lib/python3.14/site-packages/Crypto/SelfTest/Hash/common.pyt2br   $   s$    ffWc7:#67GWr   c                   2   a  ] tR t^)t o R tR tR tRtV tR# )HashDigestSizeSelfTestc                t    \         P                  P                  V 4       Wn        W0n        W n        W@n        R # N)unittestTestCase__init__hashmodexpecteddescriptionextra_params)selfr   r   r   r   s   &&&&&r   r   HashDigestSizeSelfTest.__init__+   s,    ""4( &(r   c                    V P                   # r   r   r   s   &r   shortDescription'HashDigestSizeSelfTest.shortDescription2       r   c                   R V P                   9  dV   V P                  \        V P                  R4      4       V P	                  V P                  P
                  V P                  4       V P                  P                  ! R/ V P                   B pV P                  \        VR4      4       V P	                  VP
                  V P                  4       R# )truncatedigest_sizeN )r   
assertTruehasattrr   assertEqualr$   r   newr   hs   & r   runTestHashDigestSizeSelfTest.runTest5   s    T...OOGDLL-@AT\\55t}}ELL1t001=126r   )r   r   r   r   N	__name__
__module____qualname____firstlineno__r   r   r,   __static_attributes____classdictcell____classdict__s   @r   r   r   )   s     ) 7 7r   r   c                   2   a  ] tR t^>t o R tR tR tRtV tR# )HashSelfTestc                    \         P                  P                  V 4       Wn        VP	                  4       V n        W@n        W n        WPn        R # r   )	r   r   r   r   lowerr   inputr   r   )r   r   r   r   r;   r   s   &&&&&&r   r   HashSelfTest.__init__@   s:    ""4( (
&(r   c                    V P                   # r   r   r   s   &r   r   HashSelfTest.shortDescriptionH   r!   r   c                   V P                   P                  ! R/ V P                  B pVP                  V P                  4       \
        P                  ! VP                  4       4      pVP                  4       pV P                   P                  ! V P                  3/ V P                  B pVP                  4       p\
        P                  ! VP                  4       4      pV P                  V P                  V4       \        P                  ^ ,          ^8X  d:   V P                  V P                  V4       V P                  V P                  V4       MTV P                  V P                  P                  4       V4       V P                  V P                  P                  4       V4       V P                  V P                  V4       V P                   P                  R9  g   \        VR4      '       dn   VP                  4       pVP                  V P                  4       \
        P                  ! VP                  4       4      pV P                  V P                  V4       R# R# )    r)   Nr%   )zCrypto.Hash.MD5zCrypto.Hash.SHA1)r   r)   r   updater;   binasciib2a_hexdigest	hexdigestr(   r   sysversion_infodecoder/   r'   )r   r+   out1out2out3out4h2out5s   &       r   r,   HashSelfTest.runTestK   s   LL1t001	
+{{}LLTZZ=4+<+<={{}
+ 	-A!#T]]D1T]]D1T]]113T:T]]113T:-
 <<  (OOSZ[\^cSdSdBIIdjj!##BIIK0DT]]D1	 Ter   )r   r   r   r   r;   Nr.   r5   s   @r   r8   r8   >   s     ) 2 2r   r8   c                   ,   a  ] tR t^kt o R tR tRtV tR# )HashTestOIDc                h    \         P                  P                  V 4       Wn        W n        W0n        R # r   )r   r   r   r   oidr   )r   r   rS   r   s   &&&&r   r   HashTestOID.__init__l   s&    ""4((r   c                    V P                   P                  ! R/ V P                  B pV P                  VP                  V P                  4       R # )Nr%   )r   r)   r   r(   rS   r*   s   & r   r,   HashTestOID.runTestr   s7    LL1t001)r   )r   r   rS   Nr/   r0   r1   r2   r   r,   r3   r4   r5   s   @r   rQ   rQ   k   s     )* *r   rQ   c                   ,   a  ] tR t^wt o R tR tRtV tR# )ByteArrayTestc                \    \         P                  P                  V 4       Wn        W n        R # r   r   r   r   moduler   r   r\   r   s   &&&r   r   ByteArrayTest.__init__y   !    ""4((r   c                   \        R 4      p\        V4      pV P                  P                  ! V3/ V P                  B pV P                  P                  ! V3/ V P                  B pRVR&   V P                  VP                  4       VP                  4       4       \        V4      pV P                  P                  ! R/ V P                  B pV P                  P                  ! R/ V P                  B pVP                  V4       VP                  V4       RVR&   V P                  VP                  4       VP                  4       4       R# )z    N   NNr%   )r   	bytearrayr\   r)   r   r(   rD   rA   )r   databah1rM   s   &    r   r,   ByteArrayTest.runTest~   s      t_[[__T7T%6%67[[__R54#4#452biik2 t_[[__1t001[[__1t001
		$
		"2biik2r   r   r\   NrW   r5   s   @r   rY   rY   w   s     )
3 3r   rY   c                   ,   a  ] tR t^t o R tR tRtV tR# )MemoryViewTestc                \    \         P                  P                  V 4       Wn        W n        R # r   r[   r]   s   &&&r   r   MemoryViewTest.__init__   r_   r   c                   R pR pR pW#3 EFZ  pV! V4      pV P                   P                  ! V3/ V P                  B pV P                   P                  ! V3/ V P                  B pVP                  '       g   RVR&   V P	                  VP                  4       VP                  4       4       V! V4      pV P                   P                  ! R/ V P                  B pV P                   P                  ! R/ V P                  B pVP                  V4       VP                  V4       VP                  '       g   RVR&   V P	                  VP                  4       VP                  4       4       EK]  	  R# )s    c                     \        V 4      # r   )
memoryviewre   s   &r   	get_mv_ro)MemoryViewTest.runTest.<locals>.get_mv_ro   s    d##r   c                 *    \        \        V 4      4      # r   )rp   rd   rq   s   &r   	get_mv_rw)MemoryViewTest.runTest.<locals>.get_mv_rw   s    io..r   ra   rb   Nr%   )r\   r)   r   readonlyr(   rD   rA   )r   re   rr   ru   get_mvmvrg   rM   s   &       r   r,   MemoryViewTest.runTest   s   	$	/  *F B;):):;B9t'8'89B;;; 2RYY["))+6 B54#4#45B54#4#45BIIdOIIbM;;; 2RYY["))+6) +r   ri   NrW   r5   s   @r   rk   rk      s     )
7 7r   rk   c                   2   a  ] tR t^t o R tR tR tRtV tR# )MACSelfTestc                    \         P                  P                  V 4       Wn        \	        V4      V n        \	        V4      V n        \	        V4      V n        W`n        W n	        R # r   )
r   r   r   r\   r   resultre   keyparamsr   )r   r\   r   r~   re   r   r   s   &&&&&&&r   r   MACSelfTest.__init__   sG    ""4(&kI	s8&r   c                    V P                   # r   r   r   s   &r   r   MACSelfTest.shortDescription   r!   r   c                *   \        V P                  4      pV P                  P                  ! V P                  3/ V P
                  B pVP                  V P                  4       V P                  V P                  VP                  4       4       V P                  \        V P                  4      P                  R 4      VP                  4       4       VP                  V P                  4       VP                  V4       \        V P                  ^4      pV P                  \         VP                  V4       V P                  \         VP                  R4       V P                  P                  ! V P                  V P                  3/ V P
                  B pV P                  V P                  VP                  4       4       V P                  \        V P                  4      P                  R 4      VP                  4       4        V P                  P                  ! V P                  V P                  3/ V P
                  B pVP#                  4       pVP#                  4       pVP                  R4       V P                  VP                  4       V P                  4       VP                  R4       V P                  VP                  4       VP                  4       4       V P'                  \)        VP                  4       \+        R4      4      4       V P'                  \)        VP                  4       \+        R4      4      4       VP                  VP                  4       4       VP                  VP                  4       P-                  R 4      4       R#   \$         d     Li ; i)ascii4556s   blar    N)r   r~   r\   r)   r   r   rA   re   r(   rD   rH   rE   verify	hexverifyr   assertRaises
ValueErrorcopyNotImplementedErrorr&   
isinstancetypeencode)r   
result_hexr+   	wrong_macrM   h3s   &     r   r,   MACSelfTest.runTest   s_   T[[)
 KKOODHH44	ahhj1-44W=q{{}M 	
	J T[[#.	*ahh	:*akk6: KKOODHHdii?4;;?ahhj1-44W=q{{}M	$))Ct{{CABB IIfRYY[$++6 HHVQXXZ5
 	
188:tCy9:
1;;=$r(;< 	
AKKM"	AKKM((12 # 		s   ;CN NN)re   r   r   r\   r   r~   Nr.   r5   s   @r   r|   r|      s     ' .3 .3r   r|   c           
      :   . p\        \        V4      4       Fw  pW',          p\        \        VR ,          4      w  r\        V4      ^8  d   \	        V
4      pM	V^,          pRW^,           V3,          pVP                  \        WWV4      4       Ky  	  RV\        V4      ^,           3,          pVP                  \        WW54      4       Ve   VP                  \        WV4      4       VP                  \        W4      4       VP                  \        W4      4       V# ):r@      N
%s #%d: %sz%s #%d: digest_size)rangelenmapr   reprappendr8   r   rQ   rY   rk   )r\   module_name	test_datar$   rS   r   testsirowr   r;   r   names   &&&&&&       r   make_hash_testsr      s    E3y>"lC1s8a<u+Ka&K{aC==\&NO # !KY!1C#DDD	LL'kPQ
[l;<	LLv45	LL56Lr   c                     . p\        V4       Fa  w  rE\        V4      ^8X  d   \        V4      / .,           w  rgrp
MVw  rgrp
RW^,           V	3,          pVP                  \	        WWWj4      4       Kc  	  V# )   r   )	enumerater   listr   r|   )r\   r   r   r   r   r   r   re   resultsr   r   r   s   &&&         r   make_mac_testsr     su    EI&s8q=8<S	bF8J5Sf8;5Sf{aC==[wcJK ' Lr   )__doc__r	   rF   r   rB   Crypto.HashCryptor   r   Crypto.Util.py3compatr   r   Crypto.Util.strxorr   r   r   r   r8   rQ   rY   rk   r|   r   r   r%   r   r   <module>r      s   2 - 	 
    ' , '
7X.. 7**28$$ *2Z	*(## 	*3H%% 3>%7X&& %7P<3(## <3~ FJ!#4	r   