Skip to content
Licensed Unlicensed Requires Authentication Published by De Gruyter October 11, 2016

Computing discrete logarithms using 𝒪((log q)2) operations from {+,-,×,÷,&}

  • Christian Schridde EMAIL logo

Abstract

Given a computational model with registers of unlimited size that is equipped with the set {+,-,×,÷,&}=:𝖮𝖯 of unit cost operations, and given a safe prime number q, we present the first explicit algorithm that computes discrete logarithms in q* to a base g using only 𝒪((logq)2) operations from 𝖮𝖯. For a random n-bit prime number q, the algorithm is successful as long as the subgroup of q* generated by g and the subgroup generated by the element p=2log2(q) share a subgroup of size at least 2(1-𝒪(logn/n))n.

MSC 2010: 68Q25; 68W40; 11Y16

A Appendix

A.1 Vanishing coefficients

It is

K=i=0u-1kipi=i=0u-1ki2ti=i=0u-1j=0t-1(cij2j)2ti

and for w=(u-1)/2 there are I1 and I2 with

I1(p-1)i=0wp2i(modpu)i=0(u-1)/2(2t-1)22ti(mod2tu)i=0(u-1)/2j=0t-1(2j)22ti(mod2tu),
I2(p-1)i=0wp2i+1(modpu)i=0(u-1)/2(2t-1)22ti+t(mod2tu)i=0(u-1)/2j=0t-1(2j)22ti+t(mod2tu).

Going from i=0 to w and taking always the value 2i is the same as going from i=0 to 2w and picking only the even values. Hence, we can use the indicator function 𝟣ieven and without loss of generality we assume u-1 is even:

I1i=0u-1𝟣ievenj=0t-1(2j)2ti(mod2tu).

Thus, it holds

&K1I1i=0u-1𝟣ievenj=0t-1&(2j)2tii=0u-1j=0t-1(cij2j)2tii=0u-1𝟣ievenj=0t-1(cij2j)2tii=0u-1𝟣ievenkipi(mod2tu).

Hence all odd coefficients vanish. The case for K2 is analogous.

A.2 Example

For further clarity, we add short examples for some of the key computation steps of our approach using a toy setup. We set

  1. q=37,g=5,

  2. (g,r,q)=(5,19,37).

It follows from q/2<p=2t<q that p=32. In order to solve (g,r,q), we compute (p,r,q) and (p,g,q), which allows us to derive the solution of (g,r,q). However, in this example we only show how to compute (p,r,q), since the case (p,g,q) is analogous and deriving the solution of (g,r,q) is standard. The solution for (p,r,q)=(32,19,37) is 7 since 32719(mod37).

It is |𝔾g|=18 and |𝔾p|=36=u, hence 𝔾g𝔾p. The integer Q37,36(32) in base-32 representation is equal to

Q37,36(32)=3236-137
=03235+273234+213233+193232+283231
+173230+9k^3229+163228+133227+263226
+253225+303224+83223+203222+243221
+63220+293219+123218+31k¯3217+43216
+103215+123214+33213+143212+223211
+153210+18329+5328+6327+1326
+23325+11324+7323+25322+2321+19320.

Since p is a primitive root in q*, the largest coefficient k¯ is k¯=31=p-1, and hence we get b=1, see Section 4.3. Now we can compute |SQ37,36(32)(32)| via Corollary 4:

|SQ37,36(32)(32)|=dsp(Q37,36(32))+dsp(𝖱32,36)-dsp(Q37,36(32)+𝖱32,36)31=558+36-56331=1.

Thus, k¯=31 only appears once. Next, we compute the r¯𝔾p via

φ2,q,p(k¯,i)=φ2,37,32(31,i)=-3731(mod32)+32i=5+32i.

Since |SQ37,36(32)(32)|=1, we have i=0 and hence

φ2,37,32(31,0)=5=r¯.

The coefficient k^ that is associated with the target residue r=19 is

φ1,q,p(r)=φ1,37,32(19)=-1937-1(mod32)=9=k^.

The next step is to apply the cyclic shift to shift k¯ to k^:

Q37,36(32)=Q37,36(32)[r¯r-1(modq)]
=Q37,36(32)[519-1(mod37)]
=Q37,36(32)10,

which is equal to

Q37,36(32)=83235+203234+243233+63232+293231
+123230+31k¯3229+43228+103227+123226
+33225+143224+223223+153222+183221
+53220+63219+13218+233217+113216
+73215+253214+23213+193212+03211
+273210+21329+19328+28327+17326
+9k^325+16324+13323+26322+25321+30320.

Now, the largest coefficient 31 is at the position of the former coefficient 9. Its position (starting from the largest monomial) is now, due to the cyclic shift, equal to the solution for (32,19,37), i.e., x=7=36-29.

To actually compute the position x, we split the Q37,36(32) into

Q(1)=Q37,36(32)(mod3218)
=233217+113216+73215+253214+23213
+193212+03211+273210+21329+19328
+28327+17326+9k^325+16324+13323
+26322+25321+30320,
Q(2)=Q37,36(32)3218(mod3218)
=83217+203216+243215+63214+293213
+123212+31k¯3211+43210+10329+12328
+3327+14326+22325+15324+18323
+5322+6321+1320.

Next, we test which integer does contain the coefficient 31. We add 𝖱32,18 and test if a carry occurs. For Q(1) it is

dsp(Q(1))+dsp(𝖱32,18)=?dsp(Q(1)+𝖱32,18),
318+18=336,
336=336,

i.e., no carry occurs in this case, but

dsp(Q(2)+dsp(𝖱32,18)=?dsp(Q(2)+𝖱32,18),
240+18227,
258227.

Hence Q(2) contains the coefficient and we keep Q(2) and drop Q(1). So the position of the coefficient 31 must be somewhere in the interval [18,35]. This procedure is repeated with Q(2) as the input integer until the position of 31 is determined. Note that the final output is then |Qq,u(p)|p minus the computed position, in this case 36-29=7. Algorithm 2 considers that by reducing the bounds in the opposite way, but only for minor technical reasons.

Digit sum example.

We use the integer Q(1) to give an example for the digit sum computation. Since

|Q(1)|p=18<33=p+1

(Requirement 1), we do not need to split it, and hence we have

ds(Q(1))Q(1)8(mod31)

as the first input to the Chinese Remainder Theorem. Then the four integers I1, I2, K1, K2 from equation (4.2), equation (4.3) and equation (4.4), equation (4.5) are computed:

I1=313236-1322-1(mod3218)=37513334523799402269670431,
I2=31323236-1322-1(mod3218)=1200426704761580872629453792,
K1=&I1K=1200426704761580872629453792,
K2=&I2K=890033929547123901742875424,

which yields the next remainder of ds(Q(1))(modp+1):

ds(Q(1))K1-K221(mod33).

Finally, the application of the Chinese remainder theorem yields

CRT({8,21},{31,33})=318,

which indeed is the correct base-p digit sum of Q(1).

References

[1] Allender E., Bürgisser P., Kjeldgaard-Pedersen J. and Miltersen P. B., On the complexity of numerical analysis, Proceeding of the 21st Annual IEEE Conference on Computational Complexity (CCC 2006), IEEE Press, Piscataway (2006), 331–339. 10.1109/CCC.2006.30Search in Google Scholar

[2] Baran I., Demaine E. D. and Pǎtraşcu M., Subquadratic algorithms for 3SUM, Algorithms and Data Structures, Lecture Notes in Comput. Sci. 3608, Springer, Berlin (2005), 409–421. 10.1007/11534273_36Search in Google Scholar

[3] Du X., Klapper A. and Chen Z., Linear complexity of pseudorandom sequences generated by Fermat quotients and their generalizations, Inf. Process. Lett. 112 (2012), no. 6, 233–237. 10.1016/j.ipl.2011.11.017Search in Google Scholar

[4] Goresky M., Klapper A., Murty R. and Shparlinski I. E., On decimations of l-sequences, SIAM J. Discrete Math. 18 (2004), no. 1, 130–140. 10.1137/S0895480102403428Search in Google Scholar

[5] van Lint J. H., Introduction to Coding Theory, 3rd ed., Springer, Berlin, 1999. 10.1007/978-3-642-58575-3Search in Google Scholar

[6] Lürwer-Brüggemeier K. and Ziegler M., On faster integer calculations using non-arithmetic primitives, Proceedings of the 7th International Conference on Unconventional Computation (UC’08), Lecture Notes in Comput. Sci. 5204, Springer, Berlin (2008), 111–128. 10.1007/978-3-540-85194-3_11Search in Google Scholar

[7] Pomerance C. and Shparlinski I., Smooth orders and cryptographic applications, ANTS-V Proceedings of the 5th International Symposium on Algorithmic Number Theory, University of Sydney, Sydney (2002), 338–348. 10.1007/3-540-45455-1_27Search in Google Scholar

[8] Pratt V. R., Rabin M. O. and Stockmeyer L. J., A characterization of the power of vector machines, STOC – Sixth Annual ACM Symposium on Theory of Computing, ACM, San Diego (1974), 122–134. 10.1145/800119.803892Search in Google Scholar

[9] Shamir A., Factoring numbers in 𝒪(log(n)) arithmetic steps, Inf. Process. Lett. 8 (1979), no. 1, 28–31. 10.1016/0020-0190(79)90087-5Search in Google Scholar

Received: 2015-9-8
Published Online: 2016-10-11
Published in Print: 2016-11-1

© 2016 by De Gruyter

Downloaded on 18.5.2024 from https://www.degruyter.com/document/doi/10.1515/gcc-2016-0009/html
Scroll to top button