Hurkyl's algorithm for division by
pk in finite, black-box, additive, cyclic groups of known order.
Let
G be an additive cyclic group of order
n. Let
g be an element of
G. The problem is to find an element
h such that
pkh=g, or to prove such an element doesn't exist.
Case 1:
G has no
p-torsion
Use the extended Euclidean algorithm to find
u, v such that
un + vpk = 1. Then, if we choose
h = v g, we have
pk h = pk v g = (1 - un) g = g
Case 2:
G has order
pe.
For group elements
x, let
v(x) denote the smallest natural number such that
pv(x) x = 0.
Let
z be a generator of
G (i.e.
v(z) = e). Note that some
h exists if and only if
v(g) <= e - k.
Construct the following lookup table, for
0 < n < p:
n <---> n pe-1 z
Suppose that
v(x) = d > 0. Then
pd-1 x appears in the right hand side of the lookup table, corresponding to some integer
n. Then, we have
pd-1 x = n pe-1 z
pd-1 (x - n pe-d-k pk z) = 0
We can compute
h with the following algorithm:
Set
h := 0
While
v(g - pk h) = d > 0:
... Look up
n such that
pd-1 (g - pk h) = n pe-1 z
... Set
h := h + n pe-d-k z
This loop eventually terminates, and the final value of
h satisfies
g - pk h = 0
as desired.
Case 3:
G is an arbitrary cyclic group
Let
n = pe m with
p,m relatively prime.. Use the extended Euclidean algorithm to compute
u,v such that
um+vpe=1.
Then
g = u(mg) + v(peg).
peg lies in a subgroup of order
m, and using case 1, we can find
h1 such that
pkh1 = peg.
mg lies in a subgroup of order
pe, and using case 2, we can find
h2 such that
pkh2 = mg.
Set
h = vh1 + uh2. Then
pk h = g.