In group theory, the Pohlig–Hellman algorithm, sometimes credited as the Silver–Pohlig–Hellman algorithm,[1] is a special-purpose algorithm for computing discrete logarithms in a finite abelian group whose order is a smooth integer.
The algorithm was introduced by Roland Silver, but first published by Stephen Pohlig and Martin Hellman, who credit Silver with its earlier independent but unpublished discovery. Pohlig and Hellman also list Richard Schroeppel and H. Block as having found the same algorithm, later than Silver, but again without publishing it.
As an important special case, which is used as a subroutine in the general algorithm (see below), the Pohlig–Hellman algorithm applies to groups whose order is a prime power. The basic idea of this algorithm is to iteratively compute the
p
(Note that for readability, the algorithm is stated for cyclic groups — in general,
G
\langleg\rangle
g
Input. A cyclic group
G
n=pe
g
h\inG
Output. The unique integer
x\in\{0,...,n-1\}
gx=h
x0:=0.
pe-1 | |
\gamma:=g |
p
k\in\{0,...,e-1\}
-xk | |
h | |
k:=(g |
pe-1-k | |
h) |
p
hk\in\langle\gamma\rangle
dk\in\{0,...,p-1\}
dk | |
\gamma |
=hk
O(\sqrtp)
xk+1
kd | |
:=x | |
k |
xe
O(e\sqrtp)
O(\sqrt{pe})
e
In this section, we present the general case of the Pohlig–Hellman algorithm. The core ingredients are the algorithm from the previous section (to compute a logarithm modulo each prime power in the group order) and the Chinese remainder theorem (to combine these to a logarithm in the full group).
(Again, we assume the group to be cyclic, with the understanding that a non-cyclic group must be replaced by the subgroup generated by the logarithm's base element.)
Input. A cyclic group
G
n
g
h\inG
Output. The unique integer
x\in\{0,...,n-1\}
gx=h
i\in\{1,...,r\}
| |||||||
g | |||||||
i:=g |
ei | |
p | |
i |
| |||||||
h | |||||||
i:=h |
hi\in\langlegi\rangle
\langlegi\rangle
xi\in\{0,...,p
ei | |
i |
-1\}
xi | |
g | |
i |
=hi
\quad\forall i\in\\textThe Chinese remainder theorem guarantees there exists a unique solution
x\in\{0,...,n-1\}
x
g
h
ei | |
n/p | |
i |
ei | |
p | |
i |
The worst-case input for the Pohlig–Hellman algorithm is a group of prime order: In that case, it degrades to the baby-step giant-step algorithm, hence the worst-case time complexity is
lO(\sqrtn)
\prodi
ei | |
p | |
i |
n