+
    '(j'                         ^ RI t ^ RIHtHt ^ RIHt ^ RIHtHt  ! R R] P                  4      t
 ! R R] P                  4      t/ 3R	 lt]R
8X  d   R t] P                  ! RR7       R# R# )    N)	unhexlifyhexlify)list_test_cases)strxorstrxor_cc                   n   a  ] tR t^)t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )StrxorTestsc                    \        R 4      p\        R4      p\        R4      pV P                  \        W4      V4       V P                  \        W!4      V4       R#    ff339a83e5cd4cdf5649   383d4ba020573314395b   c70ed123c59a7fcb6f12N)r   assertEqualr   )selfterm1term2results   &   U/home/ubuntu/cf-venv/lib/python3.14/site-packages/Crypto/SelfTest/Util/test_strxor.pytest1StrxorTests.test1+   sM    121223-v6-v6    c                @    R pV P                  \        W4      V4       R# r   N)r   r   )r   ess   & r   test2StrxorTests.test22   s    ,r   c                v    \        R 4      pR\        V4      ,          pV P                  \        W4      V4       R# )r       N)r   lenr   r   )r   r   	all_zeross   &  r   test3StrxorTests.test36   s0    12c%j(	-y9r   c                h    \        R 4      p\        R4      pV P                  \        \        W4       R# )r   s   ff339a83e5cd4cdf564990N)r   assertRaises
ValueErrorr   r   r   r   s   &  r   test_wrong_lengthStrxorTests.test_wrong_length;   s*    1234*fe;r   c                    \        R 4      p\        V4      p\        R4      p\        R4      pV P                  \        W#4      V4       R# r   )r   	bytearrayr   r   )r   r   term1_bar   r   s   &    r   test_bytearrayStrxorTests.test_bytearray@   sB    12U#12230&9r   c                    \        R 4      p\        V4      p\        R4      p\        R4      pV P                  \        W#4      V4       R# r   )r   
memoryviewr   r   )r   r   term1_mvr   r   s   &    r   test_memoryviewStrxorTests.test_memoryviewH   sB    12e$12230&9r   c                8   \        R4      p\        R4      pVR,          pVR,          p\        R4      p\        \        V4      4      p\        WVR7      pV P	                  VR4       V P	                  We4       V P	                  W4       V P	                  W$4       R# z3Verify result can be stored in pre-allocated memoryr   r   NNNr   outputN)r   r*   r   r   r   r   r   r   original_term1original_term2expected_xorr7   r   s   &       r   test_output_bytearray!StrxorTests.test_output_bytearrayP   s     1212qq !893u:&V4&.//r   c                J   \        R4      p\        R4      pVR,          pVR,          p\        R4      p\        \        \        V4      4      4      p\	        WVR7      pV P                  VR4       V P                  We4       V P                  W4       V P                  W$4       R# r4   )r   r/   r*   r   r   r   r8   s   &       r   test_output_memoryview"StrxorTests.test_output_memoryviewa   s     1212qq !89Ic%j12V4&.//r   c                    \        \        R4      4      p\        R4      pVR,          p\        R4      p\        WVR7      pV P                  VR4       V P                  W4       V P                  W#4       R# 1Verify result can be stored in overlapping memoryr   r   r5   r   r6   N)r*   r   r   r   r   r   r   r:   r;   r   s   &     r   !test_output_overlapping_bytearray-StrxorTests.test_output_overlapping_bytearrayr   sk     )$;<=12q !89U3&-/r   c                    \        \        \        R4      4      4      p\        R4      pVR,          p\        R4      p\        WVR7      pV P	                  VR4       V P	                  W4       V P	                  W#4       R# rB   )r/   r*   r   r   r   rD   s   &     r   "test_output_overlapping_memoryview.StrxorTests.test_output_overlapping_memoryview   sp     9Y/F%GHI12q !89U3&-/r   c                l    \        R4      p\        R4      pV P                  \        \        WVR7       R# 2Verify result cannot be stored in read-only memoryr   r   r6   N)r   r$   	TypeErrorr   r&   s   &  r   test_output_ro_bytes StrxorTests.test_output_ro_bytes   s1     1212)VU%Hr   c                ~    \        \        R4      4      p\        R4      pV P                  \        \        WVR7       R# rK   )r/   r   r$   rM   r   r&   s   &  r   test_output_ro_memoryview%StrxorTests.test_output_ro_memoryview   s6     9%<=>12)VU%Hr   c                    \        R4      p\        R4      p\        \        V4      ^,
          4      pV P                  \        \
        WVR7       R# )<Verify result cannot be stored in memory of incorrect lengthr   r   r6   N)r   r*   r   r$   r%   r   )r   r   r   r7   s   &   r   test_output_incorrect_length(StrxorTests.test_output_incorrect_length   sC     12123u:>**fe6Jr    N)__name__
__module____qualname____firstlineno__r   r   r!   r'   r,   r1   r<   r?   rE   rH   rN   rQ   rU   __static_attributes____classdictcell____classdict__s   @r   r	   r	   )   sO     7-:
<
::0"0"00IIK Kr   r	   c                   n   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )Strxor_cTestsc                j    \        R 4      p\        R4      pV P                  \        V^A4      V4       R# r      be72dbc2a48c0d9e1708Nr   r   r   )r   r   r   s   &  r   r   Strxor_cTests.test1   s/    1223%,f5r   c                T    \        R 4      pV P                  \        V^ 4      V4       R# )r   Nre   r   r   s   & r   r   Strxor_cTests.test2   s$    12%+U3r   c                >    V P                  \        R ^Z4      R 4       R# r   )r   r   )r   s   &r   r!   Strxor_cTests.test3   s    #r*C0r   c                    \        R 4      pV P                  \        \        VR4       V P                  \        \        VR4       R# )r      N)r   r$   r%   r   rh   s   & r   test_wrong_rangeStrxor_cTests.test_wrong_range   s5    12*hr:*hs;r   c                    \        R 4      p\        V4      p\        R4      pV P                  \        V^A4      V4       R# rc   )r   r*   r   r   )r   r   r+   r   s   &   r   r,   Strxor_cTests.test_bytearray   s9    12U#23(B/8r   c                    \        R 4      p\        V4      p\        R4      pV P                  \        V^A4      V4       R# rc   )r   r/   r   r   )r   r   r0   r   s   &   r   r1   Strxor_cTests.test_memoryview   s9    12e$23(B/8r   c                    \        R 4      pVR,          p\        R4      p\        \        V4      4      p\        V^AVR7      pV P	                  VR4       V P	                  WC4       V P	                  W4       R# r   r5   rd   r6   N)r   r*   r   r   r   r   r   r9   expected_resultr7   r   s   &     r   r<   #Strxor_cTests.test_output_bytearray   si    12q#$;<3u:&%F3&1/r   c                   \        R 4      pVR,          p\        R4      p\        \        \        V4      4      4      p\	        V^AVR7      pV P                  VR4       V P                  WC4       V P                  W4       R# rv   )r   r/   r*   r   r   r   rw   s   &     r   r?   $Strxor_cTests.test_output_memoryview   sn    12q#$;<Ic%j12%F3&1/r   c                    \        \        R4      4      p\        R4      p\        V^AVR7      pV P                  VR4       V P                  W4       R# rC   r   rd   r6   N)r*   r   r   r   r   r   r;   r   s   &   r   rE   /Strxor_cTests.test_output_overlapping_bytearray   sK     )$;<= !89%E2&-r   c                    \        \        \        R4      4      4      p\        R4      p\        V^AVR7      pV P	                  VR4       V P	                  W4       R# r}   )r/   r*   r   r   r   r~   s   &   r   rH   0Strxor_cTests.test_output_overlapping_memoryview   sP     9Y/F%GHI !89%E2&-r   c                X    \        R4      pV P                  \        \        V^AVR7       R# )rL   r   r6   N)r   r$   rM   r   rh   s   & r   rN   "Strxor_cTests.test_output_ro_bytes   s(     12)XubGr   c                    \        \        R4      4      p\        R4      pV P                  \        \        V^AVR7       R# rK   )r/   r   r$   rM   r   r&   s   &  r   rQ   'Strxor_cTests.test_output_ro_memoryview   s8     9%<=>12)XubGr   c                    \        R4      p\        \        V4      ^,
          4      pV P                  \        \
        V^AVR7       R# )rT   r   r6   N)r   r*   r   r$   r%   r   )r   r   r7   s   &  r   rU   *Strxor_cTests.test_output_incorrect_length  s:     123u:>**hr&Ir   rW   N)rX   rY   rZ   r[   r   r   r!   ro   r,   r1   r<   r?   rE   rH   rN   rQ   rU   r\   r]   r^   s   @r   ra   ra      sO     6
41<
99
0
0	.	.HHJ Jr   ra   c                 b    . pV\        \        4      ,          pV\        \        4      ,          pV# N)r   r	   ra   )configtestss   & r   	get_testsr     s*    E	_[))E	_]++ELr   __main__c                  >    \         P                  ! \        4       4      # r   )unittest	TestSuiter   rW   r   r   <lambda>r     s    H&&y{3r   suite)defaultTest)r   binasciir   r   Crypto.SelfTest.st_commonr   Crypto.Util.strxorr   r   TestCaser	   ra   r   rX   r   mainrW   r   r   <module>r      sl   D  ' 5 /|K(## |K~dJH%% dJN   z3EMMg& r   