For some cases of the discrete logarithm problem, gx≡ph, it is relatively easy to solve; for instance, when ordp(g) is "highly" composite, i.e. factorable by many small primes.
Sps. we have an algorithm (†) to solve the discrete log over (Zp)× when g has prime power order, and p prime. The generalised Pohlig-Hellman algorithm is dependent on the existence of (†).
About algorithm (†):
If using (†) on the discrete log described by gx≡ph, if ordp(g)=qe for some q∈P<p, then suppose we can solve it in O(Sqe) time.
In the case where e≪q, then the value of Sqe can be expressed as ep, which means (†) can also be done in O(ep) time.
// Replace g, h, p with values from the discrete log F<x> := FiniteField(p);// The value satisfying the discrete log is stored in the variable x.x := Log(F ! g, F ! h);
In step (1) of Pohlig-Hellman, we solve t discrete logs using (†); we assume that (†) is in O(Sqe).
Then, the upper bound of the first step is O(∑i=1tSqiei).
In step (2) we solve a system of congruences using CRT.
The CRT can be reduced into:
x≡i=1∑t(N/qiei)yibi,
where bi satisfies bi(N/qiei)≡1(modqiei). We compute t $b_i$s with each taking O(log(qiei)), for all $b_i$s the time is O(log(N)).
Then, the total runtime is indeed O(∑i=1tSqiei+logN).
Correctness
In step (2), by CRT x satisfies all the congruences. Then, x=yi+qieizi(‡) for some zi∈Z.