Jump to content
Wikipedia The Free Encyclopedia

Pohlig–Hellman algorithm

From Wikipedia, the free encyclopedia
Algorithm for computing logarithms
Pohlig Hellman Algorithm
Steps of the Pohlig–Hellman algorithm.

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.[2]

Groups of prime-power order

[edit ]

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 {\displaystyle p} {\displaystyle p}-adic digits of the logarithm by repeatedly "shifting out" all but one unknown digit in the exponent, and computing that digit by elementary methods.

(Note that for readability, the algorithm is stated for cyclic groups — in general, G {\displaystyle G} {\displaystyle G} must be replaced by the subgroup g {\displaystyle \langle g\rangle } {\displaystyle \langle g\rangle } generated by g {\displaystyle g} {\displaystyle g}, which is always cyclic.)

Input. A cyclic group G {\displaystyle G} {\displaystyle G} of order n = p e {\displaystyle n=p^{e}} {\displaystyle n=p^{e}} with generator g {\displaystyle g} {\displaystyle g} and an element h G {\displaystyle h\in G} {\displaystyle h\in G}.
Output. The unique integer x { 0 , , n 1 } {\displaystyle x\in \{0,\dots ,n-1\}} {\displaystyle x\in \{0,\dots ,n-1\}} such that g x = h {\displaystyle g^{x}=h} {\displaystyle g^{x}=h}.
  1. Initialize x 0 := 0. {\displaystyle x_{0}:=0.} {\displaystyle x_{0}:=0.}
  2. Compute γ := g p e 1 {\displaystyle \gamma :=g^{p^{e-1}}} {\displaystyle \gamma :=g^{p^{e-1}}}. By Lagrange's theorem, this element has order p {\displaystyle p} {\displaystyle p}.
  3. For all k { 0 , , e 1 } {\displaystyle k\in \{0,\dots ,e-1\}} {\displaystyle k\in \{0,\dots ,e-1\}}, do:
    1. Compute h k := ( g x k h ) p e 1 k {\displaystyle h_{k}:=(g^{-x_{k}}h)^{p^{e-1-k}}} {\displaystyle h_{k}:=(g^{-x_{k}}h)^{p^{e-1-k}}}. By construction, the order of this element must divide p {\displaystyle p} {\displaystyle p}, hence h k γ {\displaystyle h_{k}\in \langle \gamma \rangle } {\displaystyle h_{k}\in \langle \gamma \rangle }.
    2. Using the baby-step giant-step algorithm, compute d k { 0 , , p 1 } {\displaystyle d_{k}\in \{0,\dots ,p-1\}} {\displaystyle d_{k}\in \{0,\dots ,p-1\}} such that γ d k = h k {\displaystyle \gamma ^{d_{k}}=h_{k}} {\displaystyle \gamma ^{d_{k}}=h_{k}}. It takes time O ( p ) {\displaystyle O({\sqrt {p}})} {\displaystyle O({\sqrt {p}})}.
    3. Set x k + 1 := x k + p k d k {\displaystyle x_{k+1}:=x_{k}+p^{k}d_{k}} {\displaystyle x_{k+1}:=x_{k}+p^{k}d_{k}}.
  4. Return x e {\displaystyle x_{e}} {\displaystyle x_{e}}.

The algorithm computes discrete logarithms in time complexity O ( e p ) {\displaystyle O(e{\sqrt {p}})} {\displaystyle O(e{\sqrt {p}})}, far better than the baby-step giant-step algorithm's O ( p e ) {\displaystyle O({\sqrt {p^{e}}})} {\displaystyle O({\sqrt {p^{e}}})} when e {\displaystyle e} {\displaystyle e} is large.

The general algorithm

[edit ]

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 {\displaystyle G} {\displaystyle G} of order n {\displaystyle n} {\displaystyle n} with generator g {\displaystyle g} {\displaystyle g}, an element h G {\displaystyle h\in G} {\displaystyle h\in G}, and a prime factorization n = i = 1 r p i e i {\textstyle n=\prod _{i=1}^{r}p_{i}^{e_{i}}} {\textstyle n=\prod _{i=1}^{r}p_{i}^{e_{i}}}.
Output. The unique integer x { 0 , , n 1 } {\displaystyle x\in \{0,\dots ,n-1\}} {\displaystyle x\in \{0,\dots ,n-1\}} such that g x = h {\displaystyle g^{x}=h} {\displaystyle g^{x}=h}.
  1. For each i { 1 , , r } {\displaystyle i\in \{1,\dots ,r\}} {\displaystyle i\in \{1,\dots ,r\}}, do:
    1. Compute g i := g n / p i e i {\displaystyle g_{i}:=g^{n/p_{i}^{e_{i}}}} {\displaystyle g_{i}:=g^{n/p_{i}^{e_{i}}}}. By Lagrange's theorem, this element has order p i e i {\displaystyle p_{i}^{e_{i}}} {\displaystyle p_{i}^{e_{i}}}.
    2. Compute h i := h n / p i e i {\displaystyle h_{i}:=h^{n/p_{i}^{e_{i}}}} {\displaystyle h_{i}:=h^{n/p_{i}^{e_{i}}}}. By construction, h i g i {\displaystyle h_{i}\in \langle g_{i}\rangle } {\displaystyle h_{i}\in \langle g_{i}\rangle }.
    3. Using the algorithm above in the group g i {\displaystyle \langle g_{i}\rangle } {\displaystyle \langle g_{i}\rangle }, compute x i { 0 , , p i e i 1 } {\displaystyle x_{i}\in \{0,\dots ,p_{i}^{e_{i}}-1\}} {\displaystyle x_{i}\in \{0,\dots ,p_{i}^{e_{i}}-1\}} such that g i x i = h i {\displaystyle g_{i}^{x_{i}}=h_{i}} {\displaystyle g_{i}^{x_{i}}=h_{i}}.
  2. Solve the simultaneous congruence x x i ( mod p i e i ) i { 1 , , r } . {\displaystyle x\equiv x_{i}{\pmod {p_{i}^{e_{i}}}}\quad \forall i\in \{1,\dots ,r\}{\text{.}}} {\displaystyle x\equiv x_{i}{\pmod {p_{i}^{e_{i}}}}\quad \forall i\in \{1,\dots ,r\}{\text{.}}}The Chinese remainder theorem guarantees there exists a unique solution x { 0 , , n 1 } {\displaystyle x\in \{0,\dots ,n-1\}} {\displaystyle x\in \{0,\dots ,n-1\}}.
  3. Return x {\displaystyle x} {\displaystyle x}.

The correctness of this algorithm can be verified via the classification of finite abelian groups: Raising g {\displaystyle g} {\displaystyle g} and h {\displaystyle h} {\displaystyle h} to the power of n / p i e i {\displaystyle n/p_{i}^{e_{i}}} {\displaystyle n/p_{i}^{e_{i}}} can be understood as the projection to the factor group of order p i e i {\displaystyle p_{i}^{e_{i}}} {\displaystyle p_{i}^{e_{i}}}.

Complexity

[edit ]

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 O ( n ) {\displaystyle {\mathcal {O}}({\sqrt {n}})} {\displaystyle {\mathcal {O}}({\sqrt {n}})}. However, it is much more efficient if the order is smooth: Specifically, if i p i e i {\displaystyle \prod _{i}p_{i}^{e_{i}}} {\displaystyle \prod _{i}p_{i}^{e_{i}}} is the prime factorization of n {\displaystyle n} {\displaystyle n}, then the algorithm's complexity is O ( i e i ( log n + p i ) ) {\displaystyle {\mathcal {O}}\left(\sum _{i}{e_{i}(\log n+{\sqrt {p_{i}}})}\right)} {\displaystyle {\mathcal {O}}\left(\sum _{i}{e_{i}(\log n+{\sqrt {p_{i}}})}\right)} group operations.[3]

Notes

[edit ]

References

[edit ]
Primality tests
Prime-generating
Integer factorization
Multiplication
Euclidean division
Discrete logarithm
Greatest common divisor
Modular square root
Other algorithms
  • Italics indicate that algorithm is for numbers of special forms

AltStyle によって変換されたページ (->オリジナル) /