ff>xdZddlZddlZddlmZddlTddlmZGddejZ Gdd e Z Gd d ejZ ifd Z e d krdZejddSdS)zSelf-test for Math.NumbersN)list_test_cases)*) IntegerNativecFeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5S)6TestIntegerBasec td)NzTo be implemented)NotImplementedErrorselfs /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Math/test_Numbers.pysetUpzTestIntegerBase.setUp0s!"5666c,t|j|SN)mapInteger)r args r IntegerszTestIntegerBase.Integers3s4<%%%rc@|j}|d}||}|d}|t|d|d}|d}|d}|d}|d} |||||d|||||d||d||d||d||d|| d|||k||}|||||d dkdS) Ng?ld( ld( llr)r assertRaises ValueError assertEqual assertFalse) r rv1v2v3v4v5v6v7v8s r test_init_and_equalityz&TestIntegerBase.test_init_and_equality6s, WR[[ WR[[ WR[[ *gs333 WV__ WW   WV__ WZ  W' ( ( R    R    R    R    X&&& Y''' V$$$ Z((( /000 r"""WR[[ R    t+,,,,,rc|dddz\}}|t|d|t|ddzdS)Ni)rrintr rrs r test_conversion_to_intz&TestIntegerBase.test_conversion_to_intWs_sAI..B R#&&& R!t),,,,,rc|ddddz\}}}||dk||dk||dk||ddzkdS)Nrir'r(r assertTruerr rrrs r test_equality_with_intsz'TestIntegerBase.test_equality_with_ints\s]]2sAI66 B b!!! c """ r""" a4i(((((rcv|dddddz\}}}}|t|dk|t|dk|t|dk|t|d kdS) Nrir'r(200z-20.10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376)rr/strr rrrr s r test_conversion_to_strz&TestIntegerBase.test_conversion_to_strcsr1c19==BB B4((( B3''' B5())) B$TT U U U U Urc|dddz\}}|t|d|t|ddS)Nr'Pz Integer(-1)z"Integer(1208925819614629174706176))rrreprr*s r test_reprzTestIntegerBase.test_reprjs\r1b5))B b=111 b#GHHHHHrc:|j}|d}|td||d}|td||td|d|t |jd|td|d |td |dd |d }|t |j|t |jd dS)Nriuÿþuÿþuþÿlittle byteorderuþÿbittle)rrbto_bytesrr)r rrrrs r test_conversion_to_bytesz(TestIntegerBase.test_conversion_to_bytesosM, WT]] 6BKKMM222 WV__ : 666 >**BKKNN;;; *bk1555 : h (G(GHHH >**BKKXK,N,NOOO WS\\ *bk222 *bkXFFFFFrc|j}|d}|t|||d||d}|d||d}|d||dd}|d||dd}|d||dd }|d ||t |jd d dS) NrsrBsrbigrDrC rG)r from_bytesr/ isinstancerrr)r rrrrr r!r"s r test_conversion_from_bytesz*TestIntegerBase.test_conversion_from_bytessJ,    ( (  2w//000 B    , , B    , , $$$    U 3 3 B    u  = = B    x  @ @ $$$ *g&8'8LLLLLrc|dddd\}}}}|||k||dk|||k||dk|||k|||k||ddkdS)NYZr)rr/rrr8s r test_inequalityzTestIntegerBase.test_inequalitysr2r266BB b!!! b!!! r""" r""" b!!! b!!!  Q4/00000rc|ddddd\}}}}}|||k||dk|||k||dk|||k|||k|||k|||kdSN rVr.r rrrr r!s r test_less_thanzTestIntegerBase.test_less_thans!]]2r2r7CCBB R    R    b!!! b!!! R    b!!! R    b!!!!!rc|ddddd\}}}}}|||k||dk|||k||dk|||k|||k|||k|||kdS)NrZr[r\r.r]s r test_less_than_or_equalz'TestIntegerBase.test_less_than_or_equals!]]2r2r7CCBB b!!! b!!! b!!! b!!! b!!! r""" b!!! r"""""rc|ddddd\}}}}}|||k||dk|||k|||k||dk|||k|||k|||k|||kdSrYr.r]s r test_more_thanzTestIntegerBase.test_more_thans!]]2r2r7CCBB R    R    b!!! b!!! b!!! R    b!!! R    b!!!!!rcl|dddd\}}}}|||k||dk|||k|||k||dk|||kdS)NrZr[r`r.r8s r test_more_than_or_equalz'TestIntegerBase.test_more_than_or_equalsr2r266BB b!!! b!!! b!!! b!!! b!!! r"""""rcp|dddd\}}}}|||t||||t|||||dS)Nr rr\)rrboolr/r8s r test_boolzTestIntegerBase.test_boolsq"b'::BB  b"""  R!!!  rc|ddz dddddz\}}}}}||||||||dS)NrAdr)rr/ is_negativerr]s r test_is_negativez TestIntegerBase.test_is_negatives!]]AH9b!Q3GGBB (())) (())) ))*** ))*****rc|ddd\}}}|t||z|j|||zd||dzd|||zd||dzd||dzddS)NrUarr\irr/rQrrr0s r test_additionzTestIntegerBase.test_additions]]1b"-- B  27DL99::: b"%%% b"%%% b!$$$ rA&&& g{33333rc|ddd\}}}|t||z |j|||z d||dz d|||z d||dz d||dz ddS) NrprUrqSrrr[r\irsr0s r test_subtractionz TestIntegerBase.test_subtractions]]1b"-- B  27DL99::: b"%%% a$$$ b"%%% rB''' g{33333rc^|dddd\}}}}|t||z|j|||zd||dzd||dzd||dzddS)Nr\r3rVirsr8s r test_multiplicationz#TestIntegerBase.test_multiplicationsq!R99BB  27DL99::: b"%%% a$$$ b"%%% g}55555rc|ddddz\}}|t|z|j||zd||dzd||dzd||ddzzd|t fddS)NrAr'r<rlOcdzSNrrsr z0TestIntegerBase.test_floor_div..s R1Wr)rr/rQrrrZeroDivisionErrorr rrrs @r test_floor_divzTestIntegerBase.test_floor_divs]]1ab11 B  28T\::;;; r1%%% q!$$$ r2&&& qBw*** +____=====rc|ddd\}}|t|z|j||zd|dzd||dzd|dzd|t fd|tfddS) Nrrzr`rArBr\cdzSrrrsr rz0TestIntegerBase.test_remainder..s R!VrcdzS)Nrrsr rz0TestIntegerBase.test_remainder..s b2gr)rr/rQrrrrrrs @r test_remainderzTestIntegerBase.test_remainder s]]2q"-- B  27DL99::: b!$$$ a### a### gr*** +^^^^<<< *oooo66666rc.|ddd\}}}|t||z|j|||zd|t ||d||dzd|t |dd||dzd||dzd|tt |ddS)NryrAr{@r'rVrl)rr/rQrrpowrrr0s r test_simple_exponentiationz*TestIntegerBase.test_simple_exponentiations]]1a,, B  28T\::;;; r2&&& Rb))) q"%%% RR((( q!$$$ q"%%% *c2r22222rc |ddd\}}}|tt||||j|t|||d|t|d|d|t||dd|t|ddd|t|ddd|t|dddzd|t|ddzd d |tt|dd|tt|dd |tt|d d dS)NrrzrprrBr'r<i\iEr`rlr~) rr/rQrrrrrrr0s r test_modular_exponentiationz+TestIntegerBase.test_modular_exponentiation s]]2q"-- B  3r2r??DLAABBB RR!,,, RR!,,, RR!,,, RR!,,, RR!,,, RQ"W--r222 Rb5115999 +S"a;;; *c2q"555 *c2r155555rc|d}|d||d|d}|dd||ddS)Nryr'rB)r inplace_powrr rs r test_inplace_exponentiationz+TestIntegerBase.test_inplace_exponentiation0sx \\!__ q R   \\!__ q" Qrc|ddz dddddz\}}}}}|t|ddz|t|d|t|d|t|d|t|ddzdS)Nr'rkr{r)rrabsr]s r test_abszTestIntegerBase.test_abs9s!]]AH9b!QSIIBB R!s(+++ R!$$$ R!$$$ R!$$$ R!s(+++++rc||dddddz\}}}}|t|j||d||d||ddzdS)Nr{r1rgrkrp2)rrrsqrtrr8s r test_sqrtzTestIntegerBase.test_sqrtAsr1b"c'::BB *bg... A&&& A&&& BF+++++rc|t|djd|t|djd|dddksJ|dddvsJdD]P}t d|D]=}|dz|z}|||}||||z fvsJ>Q|t|djd|t|d jd |d dd vsJ|d dd vsJdS)Nrzrr;rB)rBry) rZrr%)+/5r'rryrgr)ryrpr)rrrrrange)r pisquareress r test_sqrt_modulez TestIntegerBase.test_sqrt_moduleIs *dll1oo&:A>>> *dll1oo&:B???||A##A&&!++++||A##A&&&0000B ) )A1a[[ ) )All6**//22q!a%j((((( ) *dll1oo&:B??? *dll1oo&:B???||F##((,,6666||F##((,,666666rc"|dd\}}||z }||d|dz }||d|dz }||d|ddzz }||dddzzdS) Nrgr3(r;'r'r(rrr*s r test_in_place_addz!TestIntegerBase.test_in_place_adddsr2&&B b R    b R    b R    a4i R!t)^,,,,,rc|dd\}}||z}||d|dz}||d|dz}||d|dz}||d dS) Nrgr3iirUi_iʠi`yij'rr*s r test_in_place_subz!TestIntegerBase.test_in_place_subpsr2&&B b S!!! d  R    e  V$$$ g  U#####rc"|dd\}}||z}||d|dz}||d|dz}||d|ddzz}||dddzzdS) NrArzrr'rr{ir(rr*s r test_in_place_mulz!TestIntegerBase.test_in_place_mul|sq!$$B b R    a R    b S!!! a4i SAI./////rc"dd\}}||z}|d|ddzz}|d|dz}|dfd}t|dS)Nr3rpr'r(rc<d}|dz}dS)N rr)rr s r tz0TestIntegerBase.test_in_place_modulus..tsaB !GBBBr)rrrr)r rrrs` r test_in_place_modulusz%TestIntegerBase.test_in_place_modulussr1%%B b Q a4i Q a Q      +Q/////rc|ddd\}}}|t||z|j|||zd||dzd|||zd||dzd||dzd||ddzdzzddS)Nr0r'r(rsr0s r test_andzTestIntegerBase.test_ands]]4t44 B  27DL99::: b$''' dD))) b$''' dD))) dD))) qDy4/0$77777rcl|ddd\}}}|t||z|j|||zd||dzd|||zd||ddzzddzdzdS)Nrrir'r(rsr0s r test_orzTestIntegerBase.test_ors]]4t44 B  27DL99::: b$''' dD))) b$''' a4idT)9:::::rc|ddd\}}|dz |t|z |j||z d|dz d|t fd|ddzz d||dz d ||ddzz d dS) NrrBrr~cdz SNr;rrsr rz2TestIntegerBase.test_right_shift.. bBhrr'r(rVr;rrr/rQrrrrs @r test_right_shiftz TestIntegerBase.test_right_shifts ]]4E22 B q"%%%  28T\::;;; r4((( q$''' *&6&6&6&6777 T *A... q%((( T *B/////rcddd\}}}|dz}|d|dz}|d||z}|d|dz}|dfd}t|fd }d|fd }d |dS) NrrBrrr~ryrVc<d}|dz}dSNr;rr r s r lz4TestIntegerBase.test_in_place_right_shift..l!d##B 2IBBBrcBd}|ddzz}|SNrr'r(rrs r m1z5TestIntegerBase.test_in_place_right_shift..m1s'd##B 19 BIrcBd}|ddzz}|S)Nr;r'r(rrs r m2z5TestIntegerBase.test_in_place_right_shift..m2s'b!!B 19 BIrr;rrrr)r rrrrrrs` r test_in_place_right_shiftz)TestIntegerBase.test_in_place_right_shifts?]]4E22 B q T""" q T""" r  T""" q U###      *a(((      BBDD!!!      RRTT"""""rc|ddd\}}|dz|t|z|j||zd|dzd||dzd|t fd|t fddS) NrrBrr cdzSrrrsr rz2TestIntegerBase._test_left_shift..rrcddzzS)Nr'r(rrsr rz2TestIntegerBase._test_left_shift..sbQ$Y.?rrrs @r _test_left_shiftz TestIntegerBase._test_left_shifts]]4E22 B q"%%%  28T\::;;; r4((( q$''' q%((( *&6&6&6&6777 *&?&?&?&?@@@@@rcddd\}}}|dz}|d|dz}|d||z}|d|dz}|dfd}t|fd }t|dS) NrrBrrrrrc<d}|dz}dSrrrs r rz3TestIntegerBase.test_in_place_left_shift..lrrcBd}|ddzz}dSrrrs r mz3TestIntegerBase.test_in_place_left_shift..ms&d##B 19 BBBrr)r rrrrrs` r test_in_place_left_shiftz(TestIntegerBase.test_in_place_left_shifts]]4E22 B q T""" q T""" r  T""" q U###      *a(((      *a(((((rcx|ddd\}}}||dd||dd|||d||dd||dd|t|jd||dd zd|t|jd|t|jd|t|jd|t|jd dS) NirlrBrr~rr;r'r(i)rrget_bitrrr0s r test_get_bitzTestIntegerBase.test_get_bitsk]]5"a00 B A*** A*** B+++ A*** A*** *bj"555 AI..222 *bj"555 *bj!444 *bj!444 *bj(;;;;;rcP|ddddd\}}}}}||||||||||||||||||||dS)Nrryrr`i)rr/is_evenris_oddr]s r test_odd_evenzTestIntegerBase.test_odd_evens:!]]1aR==BB  %%%  %%% &&&  %%% &&& %%% %%%  $$$ %%%  $$$$$rcp|dddd\}}}}||d||d||d|t|jdS)NrrBrNrFr)rr size_in_bitsrrr8s r test_size_in_bitsz!TestIntegerBase.test_size_in_bits sq!UC88BB **A... **A... **A... *bo66666rc|dddddd\}}}}}}||d||d||d||d||d|t|jdS) NrrBiirr'rA)rr size_in_bytesrrrr rrrr r!r"s r test_size_in_bytesz"TestIntegerBase.test_size_in_bytess!%q!T5'2!N!NBBB ))++Q/// ))++Q/// ))++Q/// ))++Q/// ))++Q/// *bo66666rc||d||d||d||d||d||d||d||dt d d D]}|||dzdz|||dzdS) NrrrBr'rAryiirkr()rris_perfect_squarer/r)r xs r test_perfect_squarez#TestIntegerBase.test_perfect_squares b));;==>>>  Q99;;<<<  Q99;;<<< a::<<=== a::<<===  Q99;;<<<  U++==??@@@ g..@@BBCCCsD!! D DA   T\\!Q$q&11CCEE F F F OODLLA..@@BB C C C C D DrcD|ddd\}}}|d|d|ddz|t|jd|t|j|dS)N iryrpr'r<)rfail_if_divisible_byrrr0s r test_fail_if_divisible_byz)TestIntegerBase.test_fail_if_divisible_by)s]]2sA.. B """ """ R((( *b&=qAAA *b&=rBBBBBrc|ddd\}}}|||||d||d||d|d|||d|dd||d |dd||d |ddd z||d dd zz|dd zd||d dd zzdS) NryrAr'rgrrBr{r3r()rmultiply_accumulaterr0s r test_multiply_accumulatez(TestIntegerBase.test_multiply_accumulate5so]]1a++ B r2&&& R    r1%%% R    q"%%% R    q"%%% R    r1%%% R    q!t),,, R!t)^,,, qDy!,,, R!t)^,,,,,rc|dd\}}||||d|d||d|d||d|ddz||ddzdS)NrArrr{r'r()rsetrr*s r test_setzTestIntegerBase.test_setFsq!$$B r  Q q  Q r  R    qDy Q$Y'''''rc`|dddddd\}}}}}}|t|||j|||d||dd||dd||dd ||d d |t|jd |t|jd|t|jd |t|jddS) Nr'rzrlri ii rAiiKS~i&irg) rr/rQinverserrrrrrs r test_inversezTestIntegerBase.test_inverseQse!%q!RFD!I!IBBB  2::b>>4<@@AAA B+++ A*** A*** H--x888 D))4000 *bj"555 *bj"555 *bj"555 +RZ;;;;;rc|dd\}}||||ddS)Nr'rzrA)rinplace_inverserr*s r test_inplace_inversez$TestIntegerBase.test_inplace_inverse`sIq!$$B 2 QrcP|dddd\}}}}|t|||j|||d||dd|||d||dd||dddS)Nrrgrr{r'rB)rr/rQgcdrrr8s r test_gcdzTestIntegerBase.test_gcdfsq"b"55BB  266"::t|<<=== Q''' Q''' Q''' Q''' A&&&&&rc|ddddd\}}}}}|t|||j|||d||dd|||d||dd||dd||dd||dddS)Nrrgrr{rrf)rr/rQlcmrrr]s r test_lcmzTestIntegerBase.test_lcmos4!]]1b"b!<<BB  266"::t|<<=== R((( R((( S))) Q''' A&&& A&&& A&&&&&rc Bd}|jj}tddD]"}|||dd#tdddD]"}||d|d#|t |dd|t |dd|t |dd|t |dd|t |dd|t |dd |t |dd|t |dd |D]}|||d|d|d||||d|d|d|||d||d|ddS) N))rrBrB)r-rB)r~r;)rzrrB)ibir;)ri&r;)rzl-&r;rBrr'rr{r;rryr~)r jacobi_symbolrrrr)r datajskntvs r test_jacobi_symbolz"TestIntegerBase.test_jacobi_symbolzs!\ 'q" * *A   RR1XXq ) ) ) )q"a * *A   RR1XXq ) ) ) ) *b!R000 *b!R000 *b!Q/// *b!Q/// *b!Q/// *b!Q/// *b!Q/// *b!Q/// D DB   RR1r!u--r!u 5 5 5   RR RU 3 3RU;;RU C C C   RR1t||BqE':':;;RU C C C C D Drcdgdfdgdfdgdfdgdfd gd fd gd fd gdfdgdfdgdfdgdfdgdfdgdfdgdfdgdfg}|jj}|D]-\}}|D]%\}}|||||&.dS)NrA)rBrBr'r;rArryrBrzr;rrrprBr~r;rrrgrBrr;rrrZrBr[r;rrrrBrr;rrrrBr3r;rrrrBrr;r-rrBr;rrBrr;rrrz)r%r&rAr;r(rzrrrBrpr;r,rrBrgrrrBrr;rZr;r[rBr3r4r5rr;r7r3rrrBrr;r;r-rBr>rr@rBrBr;rDr;rrBrFrp)r%r'rBrGr(r)rr;rprr~rBrKrgr;rMrNrOr[rrrBr4r5rrBrr;r8r9r:rrBr-r;r=r?rXrDrrZrrBr)r%r[r'r(rzrBr*r+r^r-r.rMr0r1rPr3r4rrBr6r7r3rBr9r:rdr<r=rWrArCrZrFr)r%r&rArBr(rhr\rJr,rKr_)rrrrBrOrPrar4r5rQrcrjrr;)rrrdrer=rWrBrBrYrErr;rZ)r%r&rkr(r)r\rJr,rKr.r/rl)rZrrPrr;r4rirQrcr8rmr:rdrer=)r@rrnrYrZrgr)r%r[r'r(rHr*rJr^r-rLr/r0rOr2r3r4rir6r7rRr9rTrdr<rVr?rArYrErFr)r%r[rGr(r)r\rJr^rKr_r/rNr1r2rar4)rrrbr7r8rSrTr;rer=rWrXrYrErgr)r%r&rGr(rhrIr+r,rKr_rMrNrOr2rpr4rirQ)rrrjrmrTrdrUr=rWrXrCrErgr)r%r&r'r(rhr*r]r,r-r_r/r0rOr`r3r4rir6rcrjr9r:r;r<r=rWrArfrErFr)r%r[rkr(r)rIrJr^rKr_r/rlr1r2rpr4r5rbrcr8rmrT)rrrUr=rWrnrYrZror>)r%r[rkr(rHrIr+r^rKrLrMrlr1rPr3r4rirbr7rRrSr:rdrUrVrWrnrCrZrFrBr)r%r&rGr(rhrIr+r,rKr_r/rNr1r2rpr4r5rQrcrjrmr:rdrUr=r?rXrC)rrrg)rrr)r r"rr!kjr js r test_jacobi_symbol_wikipediaz,TestIntegerBase.test_jacobi_symbol_wikipedias``` a bbb c bbb c VVV W eee f ddd e ___ ` fff g ddd e ___ ` ddd e WWW X aaa b eee f"\ ' . .EAr . .1  Aq1---- . . .rcz|d\}|t|ddS)Nr0x10)rrhexrs r test_hexzTestIntegerBase.test_hexs7mmD!! R&)))))rN)7__name__ __module__ __qualname__r rr%r+r1r9r>rJrRrWr^rarcrerirnrtrwr|rrrrrrrrrrrrrrrrrrrrrrrrr r rrrrr#rsrwrrr rr.s:777&&&---B--- )))UUUIII GGG$MMM0 1 1 1 " " " # # # " " "###+++444444666>>> 7 7 7 3 3 3666    ,,,,,,7776 - - - $ $ $ 0 0 0 0 0 0888;;; 0 0 0###2AAA)))(<<< % % %777777 D D D C C C---" ( ( ( < < <   ''' ' ' '!D!D!DF...4*****rrceZdZdZdS)TestIntegerIntct|_dSr)rrr s r r zTestIntegerInt.setUps $ rNrxryrzr rrr r|r|s#%%%%%rr|c&eZdZdZdZdZdZdS)testIntegerRandomc~tdD]I}tjd}||dk||dkJtddD]R}tj|}||d|d z zk||d|zkSdS) Nr(r~) exact_bitsrNr\r'rB)rrrandomr)r _a bits_values r test_random_exact_bitsz(testIntegerRandom.test_random_exact_bitsst ' 'A$222A   QW % % %   Q#X & & & &h// 1 1J$ ;;;A   QZ!^!44 5 5 5   Q!Z-/ 0 0 0 0 1 1rcLd}tdD]8}tjd}|p|dk}||dk9||tddD]3}tj|}||d |zk4dS) NFr(r~)max_bitsrrNr\rr')rrrrr/)r flagrrrs r test_random_max_bitsz&testIntegerRandom.test_random_max_bitsst % %A$a000A?1s7D   QV $ $ $ $ h// 1 1J$j999A   Q!Z-/ 0 0 0 0 1 1rcGddt}|}tjd|}||jddS)NceZdZdZdZdS)@testIntegerRandom.test_random_bits_custom_rng..CustomRNGcd|_dSr)counterr s r __init__zItestIntegerRandom.test_random_bits_custom_rng..CustomRNG.__init__s   rcF|xj|z c_td|zSr)rbchr)r sizes r __call__zItestIntegerRandom.test_random_bits_custom_rng..CustomRNG.__call__s" $ Aww~%rN)rxryrzrrrrr CustomRNGrs2 ! ! ! & & & & &rrr)rrandfuncry)objectrrrr)r r custom_rngrs r test_random_bits_custom_rngz-testIntegerRandom.test_random_bits_custom_rngsm & & & & & & & &Y[[  B D D D +Q/////rctj}tdD]2}|dd}|d|cxkodknc3tdD]2}|dd}|d|cxkodknc3|t |ddd|t |dd dS) NrBr) min_inclusive max_inclusive)r max_exclusiver'rA)rrr)rr)r random_rangerr/rr)r funcrrs r test_random_rangez#testIntegerRandom.test_random_ranges)s * *A1B777A OOALLLLbLLLL ) ) ) )s ) )A1B777A OOAKKKKRKKKK ( ( ( ( *d!1:;  = = = *d!1MMMMMrN)rxryrzrrrrrrr rrsU 1 1 1 1 1 1 0 0 0NNNNNrrcg}|ttz } ddlmGfddt}|t|z }n}#t t f$ri}tjdkr tj dn/tj dt|zYd}~nd}~wwxYw ddl m Gfd d t}|t|z }nM#t t f$r9}tj d t|zYd}~nd}~wwxYw|ttz }|S) Nr IntegerGMPceZdZfdZdS)!get_tests..TestIntegerGMPc|_dSrr)r rs r r z'get_tests..TestIntegerGMP.setUps) rNr~rsr TestIntegerGMPrs. * * * * * * *rrwin32zSkipping GMP tests on Windows zSkipping GMP tests (%s)  IntegerCustomceZdZfdZdS)*get_tests..TestIntegerCustomModexpc|_dSrr)r rs r r z0get_tests..TestIntegerCustomModexp.setUps, rNr~rsr TestIntegerCustomModexprs. - - - - - - -rrz"Skipping custom modexp tests (%s) )rr|Crypto.Math._IntegerGMPrr ImportErrorOSErrorsysplatformstdoutwriter7Crypto.Math._IntegerCustomrr)configtestsrerrrs @@r get_testsrs E _^ , ,,E D666666 * * * * * * *_ * * * 000  !DDD <7 " " J  > ? ? ? ? J  83q66A C C C D J<<<<<< - - - - - - -o - - - !8999  !JJJ >QGIIIIIIIIJ _. / //E Ls0-A CACC -C77E/D<<E__main__cBtjtSr)unittest TestSuiterrrr rrsH&y{{33rsuite) defaultTest)__doc__rrCrypto.SelfTest.st_commonrCrypto.Util.py3compatCrypto.Math._IntegerNativerTestCaserr|rrrxrmainrrr rs8D! 555555####444444K *K *K *K *K *h'K *K *K *\%%%%%_%%% 7N7N7N7N7N)7N7N7Nr@ z 3 3EHMg&&&&&&r