Suppose that p,q1,q2 are prime numbers such that p1=q1q2 with q1q2. Suppose that we can solve gx=h in O(Sq) if |g|=q for any g,eFp.

Note that an element in Fp has an order of 1,q1,q2,q1q2. Therefore, we don’t have to worry about prime powers.

We claim that we can solve gx=h in O(Sq1+Sq2).

Let g,h be given.

We assume |g|=q1q2 as the other cases are trivial.

Now we solve the following two equations:

  • (gq2)x1=hq2.
  • (gq1)x2=hq1.

We can solve them in O(Sq1+Sq2) as |gq2|=q1 and |gq1|=q2. As gcd(q1,q2)=1, the CRT guarantees the existence of x such that xx1(modq1) and xx2(modq2).

Let k1,k2,c1,c2Z be chosen such that:

  • x=x1+k1q1
  • x=x2+k2q2
  • c1q1+c2q2=1

Then we have

gx=(gx)1=(gx)c1q1+c2q2=(gx)c1q1(gx)c2q2=((gq1)x)c1((gq2)x)c2=((gq1)x2+k2q2)c1((gq2)x1+k1q1)c2=(gq1x2+k2q1q2)c1(gq2x1+k1q1q2)c2=(gq1x2gk2q1q2)c1(gq2x1gk1q1q2)c2=(gq1x2)c1(gq2x1)c2=(hq1)c1(hq2)c2=hc1q1+c2q2=h1=h.