10.1515 - JMC 2013 0038
10.1515 - JMC 2013 0038
10.1515 - JMC 2013 0038
Quantum computation of
discrete logarithms in semigroups
Andrew M. Childs and Gábor Ivanyos
Communicated by Rainer Steinwandt
1 Introduction
AMC received support from NSERC, the Ontario Ministry of Research and Innovation, and the US
ARO. GI received support from the Hungarian Research Fund (OTKA, grant NK105645) and from
the Centre for Quantum Technologies at the National University of Singapore.
406 A. M. Childs and G. Ivanyos
is called the index of g. The index exists since S is finite. The value
r ´ min j 2 N W g t D g tCj
® ¯
Lemma 2.1. There is an efficient quantum algorithm to determine the index and
the period of an element g of a black-box semigroup.
p
Proof. First we find the period, as follows. Create the state jMD1 jj ijg j i= M
P
for some sufficiently large M (it suffices to take M > N 2 C N ). Note that we can
compute g j efficiently even for exponentially large j using repeated squaring, so
this state can be made in polynomial time. Next, we discard the second register.
To understand what happens when we do this, suppose we measure the second
register. If we obtain an element in the tail of g, then the first register is left in
a computational basis state, which is useless. However, with probability at least
.M t C 1/=M 1 N=M , we obtain an element in the cycle of g, and we are
left with an r-periodic state
L 1
1 X
p jx0 C jri
L j D0
408 A. M. Childs and G. Ivanyos
g g2 g3 g t−1 g t = g t+r
g t+r−1 g t+1
g t+r−2 g t+2
ˇL 1
1 ˇˇ X 2 ik.x0 Cjr/=M ˇˇ2 sin2 . krL
ˇ
M /
Pr.k/ D e D :
LM LM sin . kr
2
M /
ˇ ˇ
j D0
A simple calculation (see for example [5, equations (57)–(60)]) shows that the
probability of obtaining a closest integer to one of the r integer multiples of M=r
is at least 4= 2 . By efficient classical postprocessing using continued fractions,
we can recover r with constant probability by sampling from such a distribution
[19]. Since we are in the cycle of g with overwhelming probability, the overall
procedure succeeds with constant probability (which could be boosted by standard
techniques).
Given the period of g, we can find its index by an efficient classical procedure.
Observe that we can efficiently decide whether a given element g j is in the tail
or the cycle of g: simply compute g r by repeated squaring and multiply by g j to
compute g j Cr . If g j Cr D g j , then g j is in the cycle of g; otherwise it is in the
tail of g. Let
´
1 if g j Cr D g j (i.e., g j is in the cycle of g),
.g j / ´
0 otherwise (i.e., g j is in the tail of g):
Proof. First, we use Lemma 2.1 to compute the index t and the period r of g. Then
we determine whether x is in the tail or the cycle of g. As described in the proof
of Lemma 2.1, this can be done efficiently by determining whether xg r D x.
If x is in the tail of g, then we compute p, the smallest positive integer such that
.xg p / D 1. This can be done efficiently by using binary search to find the first 1
in the list .
.xg/;
.xg 2 /; : : : ;
.xg t //. Then we can compute logg x D t p.
On the other hand, suppose x is in the cycle of g. Then we use the well-known
fact (see for example [9]) that C ´ ¹g t Cj W j 2 Zr º is a group with iden-
tity element g t Cs where s D t mod r. In fact C is a cyclic group generated
by g t CsC1 ; in particular, for j t we have g t CsC1 g j D g j C1 . Now we use
Shor’s discrete logarithm algorithm to compute logg t CsC1 x. While we cannot
immediately compute the inverse of x in C , we know that the inverse of g tCsC1
is g t CsCr 1 , so we can compute the hiding function f W Zr Zr ! C with
f .a; b/ D x a g .tCsCr 1/b D x a .g t CsC1 / b , which suffices to efficiently com-
pute discrete logarithms in C . Thus we can compute
and period
rQ ´ min j 2 N W yg tQ D yg tQCj I
® ¯
we say that yg j is in the cycle if j tQ and in the tail if j < tQ. The period rQ
and the index tQ can be computed efficiently along the same lines as described in
Section 2.
The case where x is in the tail can be treated as in Section 3. If x is in the
cycle, so that x D yg tQC` for some nonnegative integer `, then we must solve a
constructive orbit membership problem for a permutation action of the group ZrQ
on the set of elements of the form yg tQCj . Specifically, the action of j 0 2 ZrQ is
0
multiplication by g j and we must find the element ` 2 ZrQ transporting yg tQ to x.
To this end, we consider the efficiently computable function f W Z2 Ë ZrQ ! S
with f .0; j / D yg tQCj and f .1; j / D xg j . The function f .0; j / is injective
since it has period r. Q Furthermore, f .1; j / D xg j D yg tQC`Cj D f .0; j C `/,
i.e., f .1; j / is a shift of f .0; j / by `. Therefore, f hides the subgroup h.1; `/i
of the dihedral group Z2 Ë ZrQ (i.e., it is constant on the cosets of this subgroup
and distinct on different cosets). It follows p that the Kuperberg sieve [12] finds
O. log rQ /
` (and hence a D t C `) in time 2
Q . Finally, since the dihedral hidden
subgroup problem can be solved with only polynomially many quantum queries
to the hiding function [6], we can solve the shifted discrete logarithm problem in
a black-box semigroup S with only poly.logjS j/ queries.
As in the proof of Theorem 3.1, given a candidate value a, we can check
whether x D yg a . If this check fails, we can conclude (with bounded error)
that no solution exists.
The dihedral hidden subgroup problem (DHSP) is apparently hard. Despite con-
siderable effort (motivated by a close connection to lattice problems [17]), Kuper-
berg’s algorithm remains the best known approach, and it is plausible that there
might be no efficient quantum algorithm. Note that the DHSP can be reduced to
a quantum generalization of the constructive orbit membership problem, namely,
Quantum computation of discrete logarithms in semigroups 411
defined by
enc.g1a1 gkak / ´ .a1 ; : : : ; ak / if a1 C C ak < n;
enc.g1a1 gkak 11 gkn a1 ak 1
/ ´ .a1 ; : : : ; ak 1 /;
enc.0/ ´ 0:
We can compute enc.gh/ using at most one call to given the encodings enc.g/;
enc.h/ of any g; h 2 S. Now suppose we can solve the constructive membership
problem for some semigroup element with encoding 2 †, with respect to the
generators g1 ; : : : ; gk with encodings .1; 0; : : : ; 0/; : : : ; .0; : : : ; 0; 1/. Then we can
find the values a1 ; : : : ; ak 1 such that enc.g1a1 gkak 11 gkn a1 ak 1 / D , so
that .a1 ; : : : ; ak 1 / D 1 ./, thereby inverting .
Note that Theorem 5.1 gives a lower bound on the worst-case query complexity.
In fact, the same lower bound holds if we are given a random element of †. How-
ever, we leave the problem of the average-case quantum query complexity where,
say, x is chosen uniformly from the semigroup, as an open problem.
While Theorem 5.1 shows that the constructive membership problem is prov-
ably hard in black-box semigroups, the problem is also known to be NP-hard in
explicit semigroups. In particular, Beaudry proved NP-completeness of member-
ship testing in abelian semigroups of transformations of (small) finite sets [4].
Quantum computation of discrete logarithms in semigroups 413
We show that for any fixed k, the lower bound of Theorem 5.1 is nearly tight.
Theorem 5.2. For any fixed k 2 N, there is a quantum algorithm to solve the
constructive membership problem for x 2 S D hg1 ; : : : ; gk i with respect to
1 1
g1 ; : : : ; gk in time jS j 2 2k Co.1/ . Furthermore, the quantum query complexity
1 1
of this problem is at most jS j 2 2k poly.logjSj/.
To prove this, we use the following simple observations.
This implies g1b1 gkbk D x. Also, for the first index i with ci ¤ di , we have
ci < di . Therefore .b1 ; : : : ; bk / is lexicographically smaller than .a1 ; : : : ; ak /, a
contradiction.
aD1 aD1
L
X
.L=a/. 23 log2 L/r 1
L. 23 log2 L/r ;
aD1
PL 1 3
where we used the fact that for every integer L > 1, aD1 a < 2 log2 L.
414 A. M. Childs and G. Ivanyos
We are now ready to prove the upper bound for constructive semigroup mem-
bership.
k 1
To see this, note that jkD1 i ¤j .ai C 1/ D
Qk 1.
jS jk
Q Q
j D1 .aj C 1/
Thus, for each j 2 ¹1; : : : ; kº, we perform a Grover search [8] over the set
° Y ±
.a1 ; : : : ; aj 1 ; aj C1 ; : : : ; ak / 2 N0k 1 W .ai C 1/ jS j.k 1/=k ;
i ¤j
where for each .k 1/-tuple we use Lemma 4.1 (with y D i ¤j giai and g D gj )
Q
to find aj such that x D g1a1 gkak (or to exclude its existence). By Lemma 5.4,
k 1 1 1
the running time of this procedure is kjS j 2k Co.1/ D jS j 2 2k Co.1/ . Using the
query-efficient (but not time-efficient) algorithm for the dihedral hidden subgroup
1 1
problem in place of Kuperberg’s algorithm, we require only jS j 2 2k poly.logjSj/
queries.
6 Discussion
We have considered quantum algorithms for the semigroup discrete logarithm
problem and some natural generalizations thereof. While discrete logarithms can
be computed efficiently by a quantum computer even in semigroups, the shifted
semigroup discrete logarithm problem appears comparable in difficulty to the di-
hedral hidden subgroup problem, and the constructive membership problem in a
black-box semigroup with respect to multiple generators is provably hard. Thus,
while hardness of the discrete logarithm problem in semigroups is not a good as-
sumption for quantum-resistant cryptography, one might build quantum-resistant
cryptosystems based on the presumed hardness of other problems in semigroups.
Testing membership in abelian semigroups is related to a cryptographic problem
known as the semigroup action problem (SAP) [13]. Given an (abelian) semigroup
S acting on a set M and two elements x; y 2 M , the SAP asks one to find an
element s 2 S such that x D sy. Constructive membership testing in a monoid
(i.e., a semigroup with an identity element, which can be adjoined artificially if
necessary) is an instance of SAP: consider S acting on itself by multiplication and
let y be the identity. (More precisely, to obtain a decomposition with respect to
Quantum computation of discrete logarithms in semigroups 415
Bibliography
[1] A. Ambainis, Quantum lower bounds by quantum arguments, J. Comput. System Sci.
64 (2002), no. 4, 750–767.
[2] L. Babai and E. Szemerédi, On the complexity of matrix group problems I, in: 25th
Symposium on Foundations of Computer Science, 229–240, 1984.
[3] M. Banin and B. Tsaban, A reduction of semigroup DLP to classic DLP, preprint
(2013), http://arxiv.org/abs/1310.7903.
[4] M. Beaudry, Membership testing in commutative transformation semigroups, In-
form. and Comput. 79 (1988), no. 1, 84–93.
[5] A. M. Childs and W. van Dam, Quantum algorithms for algebraic problems, Rev.
Modern Phys. 82 (2010), no. 1, 1–52.
[6] M. Ettinger and P. Høyer, On quantum algorithms for noncommutative hidden sub-
groups, Adv. in Appl. Math. 25 (2000), 239–251.
[7] K. Friedl, G. Ivanyos, F. Magniez, M. Santha and P. Sen, Hidden translation and
translating coset in quantum computing, SIAM J. Comput. 43 (2014), no. 1, 1–24.
[8] L. K. Grover, Quantum mechanics helps in searching for a needle in a haystack,
Phys. Rev. Lett. 79 (1997), no. 2, 325–328.
[9] J. M. Howie, Fundamentals of Semigroup Theory, London Math. Soc. Monogr. Ser.
12, Oxford University Press, 1995.
416 A. M. Childs and G. Ivanyos
[10] G. Ivanyos, F. Magniez and M. Santha, Efficient quantum algorithms for some in-
stances of the non-abelian hidden subgroup problem, Internat. J. Found. Comput.
Sci. 14 (2003), no. 5, 723–739.
[11] D. Kahrobaei, C. Koupparis and V. Shpilrain, Public key exchange using matrices
over group rings, Groups Complex. Cryptol. 5 (2013), no. 1, 97–115.
[12] G. Kuperberg, A subexponential-time quantum algorithm for the dihedral hidden
subgroup problem, SIAM J. Comput. 35 (2005), no. 1, 170–188.
[13] G. Maze, C. Monico and J. Rosenthal, Public key cryptography based on semigroup
actions, Adv. Math. Commun. 1 (2007), 489–507.
[14] A. J. Menezes and Y.-H. Wu, The discrete logarithm problem in GL.n; q/, Ars Com-
bin. 47 (1997), 23–32.
[15] M. Mosca and A. Ekert, The hidden subgroup problem and eigenvalue estimation on
a quantum computer, in: Proceedings of the 1st NASA International Conference on
Quantum Computing and Quantum Communication, Lecture Notes in Comput. Sci.
1509, Springer, Berlin (1999), 174–188.
[16] A. D. Myasnikov and A. Ushakov, Quantum algorithm for the discrete logarithm
problem for matrices over finite group rings, preprint (2012), http://eprint.
iacr.org/2012/574.
[17] O. Regev, Quantum computation and lattice problems, SIAM J. Comput. 33 (2004),
no. 3, 738–760.
[18] A. Schrijver, Theory of Linear and Integer Programming, John Wiley & Sons, Chich-
ester, 1986.
[19] P. W. Shor, Polynomial-time algorithms for prime factorization and discrete loga-
rithms on a quantum computer, SIAM J. Comput. 26 (1997), no. 5, 1484–1509.
Author information
Andrew M. Childs, Department of Combinatorics & Optimization and Institute
for Quantum Computing, University of Waterloo, 200 University Avenue West,
Waterloo, Ontario N2L 3G1, Canada.
E-mail: [email protected]
Gábor Ivanyos, Institute for Computer Science and Control, Hungarian Academy
of Sciences, Kende u. 13–17, 1111 Budapest, Hungary.
E-mail: [email protected]