Solns
Solns
Solns
Chapter 1: Introduction
1.3.3: Encryption is deterministic so one can compare the challenge ciphertext c with
me0 (mod N ).
1.3.4: Given c, submit c′ = c2e (mod N ) to the decryption oracle to get 2m (mod N )
and hence compute m.
1.3.5: If it does not have semantic security there is some function f : Mκ → {0, 1}
which can be computed given a ciphertext, so choose messages m0 , m1 such that f (mi ) = i
and then one can break IND security.
1.3.7: A UF-CMA adversary is a randomised polynomial-time algorithm which takes
as input a public key pk for a signature scheme, is allowed to query a signing oracle on
messages of its choice, and outputs a message m and a signature s. The adversary wins
if the signature s satisfies the verification algorithm on message m and key pk and if
m was not one of the queries to the signing oracle. A scheme has UF-CMA security if
every adversary succeeds with only negligible probability (in the security parameter). See
Definition 12.2 of Katz and Lindell [334].
1.3.8: Yes, if the RSA problem is hard.
1.3.9: Choose random s and set m = se (mod N ).
1.3.10: Given m call signing oracle on 2e m (mod N ) to get s′ . Output s = s′ 2−1 (mod N ).
605
606 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
2.4.6: Choose random 1 < a < p and compute ( ap ) until the Legendre symbol is −1.
Since the probability of success is at least 0.5 for each trial, the expected number of trials
is 2. This is a Las Vegas algorithm (it may never terminate, but the answer is always
correct). See the proof of Lemma 2.9.5 for further details.
2.4.9: This goes back to A. Cobham. See Shoup [557] or Bach and Sorensen [23] for
the analysis.
2.4.10: Computing Legendre symbols using quadratic reciprocity requires O(log(p)2 )
bit operations while computing a(p−1)/2 (mod p) needs O(log(p)M (log(p))) bit operations
(see Corollary 2.8.4). So using quadratic reciprocity is (theoretically) always better.
Q
2.5.5: First compute and store b2 , . . . , bm where bi = ij=1 aj , then b−1m , then, for
−1 −1 −1 −1
i = m downto 2 compute ai = bi−1 bi , bi−1 = ai bi . See Algorithm 11.15 of [16],
Section 2.4.1 of [100] or Section 2.2.5 of [274].
2.6.4:
2.8.6: For pseudocode of the algorithm see Algorithm IV.4 of [64] or Algorithm 9.10
of [16].
2.8.7: Consider a window of length w representing an odd integer. If the bits of m are
uniformly distributed then the probability the next most significant bit after the window
is 0 is 0.5. Hence Pthe expected number of zeroes before the first 1 is 0.5 · 0 + 0.25 · 1 +
∞
0.125 · 2 + · · · = i=1 i/2i+1 = 1.
2.8.10: For pseudocode see Section 2.2 of Möller [432]. The problem is that there is
no fixed precomputation of powers of g.
2.8.11: The values mi in addition chain satisfy mi ≤ 2i .
2.9.8: See Adleman, Manders and Miller [3].
2.10.2: See Chapters 2 and 3 of von zur Gathen and Gerhard [238].
2.10.4: Assume that F (0) 6= 0 so that x is coprime to F (x). Replace R = 2k in the
description of Montgomery reduction in Section 2.5 by R = xd (mod F (x)). See Koç and
Acar [349] for details and discussion.
2.10.5: See Section 9.6.3 of [162].
2.12.1: Compute F ′ (x). If F ′ (x) = 0 then, by Lemma A.5.2, F (x) = G(x)p where
p = charFq , and F (x) is not square-free. Otherwise, compute gcd(F (x), F ′ (x)) and if
this is not 1 then F (x) is not square-free. The computation requires O(deg(F )2 ) field
operations.
2.12.2: Given F (x) ∈ Fq [x] compute F ′ (x). If F ′ (x) = 0 then F (x) = G(x)p and
repeat process on G(x). Otherwise, compute F1 (x) = F (x)/ gcd(F (x), F ′ (x)) and factor
F1 (x). Once the factors of F1 (x) are known then one can factor F (x)/F1 (x) efficiently by
testing divisibility by the known factors of F1 (x).
2.12.3: One computes xq (mod F (x)) in O(log(q)d2 ) field operations and a further
O(d2 ) operations are needed for the gcd computation. The answer to the decision problem
is “yes” if and only if deg(R1 (x)) > 0.
2.12.5: One is essentially doing “divide and conquer” to separate the deg(R1 (x)) ≤ d
roots. Each trial is expected to split R1 (x) into two polynomials of degree ≈ deg(R1 (x))/2.
Hence, an expected O(log2 (deg(R1 (x)))) = O(log2 (d)) trials are required to factor R1 (x).
Since each trial involves computing u(x)(q−1)/2 (mod R1 (x)) (which has complexity
O(log(q)M (d)) operations in Fq ) and then computing the gcd of polynomials of degree ≤ d
(which requires O(d2 ) operations in Fq ) the total expected cost is O(log(q) log(d)d2 ) field
operations. For a detailed analysis of the probabilities see Section 21.3.2 of Shoup [556].
2.12.10: If F (x) is not irreducible then it has a factor of degree ≤ deg(F (x))/2.
i
Hence it is sufficient that gcd(F (x), xq − x) = 1 for 1 ≤ i ≤ d/2. To compute all these
polynomials efficiently one computes s1 (x) ≡ xq (mod F (x)) and then gcd(F (x), s1 (x) −
x). For the next step compute s2 (x) = s1 (x)q (mod F (x)) and gcd(F (x), s2 (x) − x),
607
and so on. There are d/2 steps, each taking O(log(q)d2 ) field operations, so the overall
complexity is O(d3 log(q)). See Algorithm IPT of Section 21.1 of [556] or Section 3 of
[370].
b
2.12.11: One first computes gcd(xq − x, F (x)) in time O(b log(q)) operations on poly-
nomials of degree at most d. The rest of the algorithm is the same as the root finding
algorithm of Exercise 2.12.5 where we raise polynomials to at most the power q b .
m−1
2.14.1: Construct {θ, θq , . . . , θq } in O(m3 ) operations in Fq (using the fact that
q-th powering is linear) and then O(m3 ) operations in Fq for the Gaussian elimination.
Hence the complexity is an expected O(m3 logq (m)) bit operations.
2.14.4: Suppose θ2 = d. Given g = g0 + g1 θ we must solve for x, y ∈ Fq such that
(x + θy)2 = g0 + g1 θ. Expanding gives x2 + dy 2 = g0 and 2xy = g1 and one can eliminate
y to get 4x4 − 4g0 x2 + dg12 = 0 which can be solved using two square roots in Fq .
2.14.5: See Fong-Hankerson-López-Menezes [207].
2.14.10: Computing Sm requires O(m3 ) operations in Fq . Computing a linear depen-
dence among m vectors can be done using Gaussian elimination in O(m3 ) field operations.
2.14.11: Since 1 − 1/q ≥ 1/2 the number of trials is at most 2. The complexity is
therefore an expected O(m3 ) operations in Fq .
2.14.12: Expected O(m3 ) operations in Fqm .
2.14.13: The cost of finding a root of the polynomial F1 (x) of degree m is an expected
O(log(m) log(q)m2 ) operations in Fq and this dominates the cost of the isomorphism
algorithm in the forwards direction. The cost of the linear algebra to compute the inverse
to this isomorphism is O(m3 ). (If one repeats the algorithm with the roles of F1 and F2
swapped then one gets a field isomorphism from Fq [y]/(F2 (y)) to Fq [x]/(F1 (x)) but it is
not necessarily the inverse of the function computed in the first step.
Qm
2.15.1: Writing q − 1 = i=1 liei we have m = O(log(q)) and then computing g (q−1)/li
requires O(log(q)3 ) bit operations.
2.15.8: The naive solution requires ≈ 2/3 log2 (N ) group operations in the precom-
putation, followed by ≈ 3 21 log2 (N 2/3 ) = log2 (N ) group operations. The same trick can
be used in the first stage of Algorithm 4, giving ≈ 23 log2 (N ) group operations. But the
three exponentiations in the second stage are all to different bases and so the total work is
≈ 32 log2 (N ) group operations. The naive solution is therefore better. The naive method
becomes even faster compared with Algorithm 4 if one uses window methods.
Chapter 5: Varieties
6.1.4: If p ∤ n then
Y
Φnp (x) = (xnp/d − 1)µ(d) (xn/d − 1)µ(dp)
d|n
609
and note that if d | np but d ∤ n then p2 | d and so µ(d) = 0. The final statement follows
since, when n is odd, z n = 1 if and only if (−z)2n = 1.
6.3.2: To compute (u + vθ)(u′ + v ′ θ) compute uu′ , vv ′ and (u + v)(u′ + v ′ ). To square
(u + vθ) compute u2 , v 2 and (u + v)2 . One inverts (u + vθ) by computing (u + vθ)/(u2 −
Auv + Bv 2 ).
6.3.3: The first two parts are similar to Exercise 6.3.2. For inversion, note that
(u + vθ)−1 = (u − vθ)/(u2 + v 2 ). For square roots, note that (u + vθ)2 = (u2 − v 2 ) + 2uvθ
so to compute the square root of a + bθ requires solving these equations. We assume here
2 2
that a + bθ is a square, and so ( a +b q ) = 1. One finds that u4 − au2 − b2 /4 = 0 and so
√
u2 = (a ± a2 + b2 )2−1 . √Only one of the two choices is a square, so one must compute
2 2
the Legendre symbol ( a+ aq +b ) to determine the answer (taking into account that ( 2q )
√
is known from q (mod 8)). One then multiplies the appropriate (a ± a2 + b2 ) by 2−1 ,
which is easy (either shift right or add q and shift right). Taking the square root gives u.
An inversion and multiplication gives v.
6.3.15: See Williams [634].
6.3.17: The characteristic polynomial of g is (x − g)(x − g q ) = x2 − TrFq2 /Fq (g)x + 1
so TrFq2 /Fq (g) = TrFq2 /Fq (g ′ ) implies g ′ is a root of the same polynomial as g.
6.3.22: 34.
6.3.23: Exercises 6.3.2 and 6.3.3 give costs of 3 squarings in Fq for computing a
squaring in Fq2 and 3 squarings plus 3 multiplications in Fq for a square-and-multiply.
Lucas sequences give just one multiplication and squaring for each operation; only one
third the number of operations in the worst case.
6.4.5: Need q ≡ 2 (mod 3) or else ζ3 ∈ Fq . Also need q 2 6≡ 1 (mod 9) or else ζ9 ∈ Fq2 .
2
6.4.7: Consider 0 = f (a)q = a3q −tq a2q +tq aq −1 = (−1+tq a−q −ta−2q +a−3q )(−a3q ).
This shows that f (a−q ) = 0. Now, suppose f (x) is neither irreducible nor split completely.
Then f (x) = (x − u)g(x) where u ∈ Fq2 and g(x) is an irreducible quadratic over Fq2 . Let
2
a ∈ Fq4 − Fq2 be a root of g(x). Then a−q is the other root, but then (a−q )−q = aq = a
and we have a ∈ Fq2 .
6.4.10: See Lenstra and Verheul [375].
6.4.11: Squaring requires computing (t2n+1 , t2n , t2n−1 ) which is one iteration of each
formula in the previous exercise. Square-and-multiply requires computing (t2n+2 , t2n+1 , t2n )
which is twice formula 2 and once formula 3 above. Let M (respectively S, P ) be the
costs of a multiplication (respectively, squaring, q-th powering) in Fq2 . Then a squaring
(i.e., going from tn to t2n ) requires 4M + S + 5P while a square-and-multiply requires
2M + 2S + 4P . The reader is warned that in practice it is often more efficient to use other
ladder algorithms than traditional square-and-multiply, see Chapter 3 of Stam [579].
6.4.12: The trick is to represent tn using the triple (tn+1 , tn , tn−1 ) as above when n is
odd, but (tn+2 , tn+1 , tn ) when n is even. One then must use formula 1 of Exercise 6.4.10.
For example, if n is even and one is computing (t2n+2 , t2n+1 , t2n ) then the middle term
is computed as t2(n+1)−1 . See Lenstra and Verheul [375] for details.
6.4.13: t6 = 7 + 48i, t7 = 35 + 65i, t8 = 6 + 8i.
6.4.14: One can represent the equivalence class of g n by (tn , t−n ). For the ladder one
can store the 6-tuple (tn+1 , tn , tn−1 , t−n−1 , t−n , t−n+1 ) and compute an analogous 6-tuple
610 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
centered at (t2n , t−2n ) or (t2n+1 , t−2n−1 ). See Gong and Harn [259] and also Stam [579]
for further details.
6.4.15: See Shirase et al [551].
6.6.2: Modulo each prime pi there are usually two values h such that TrFp2 /Fpi (h) =
i
TrFp2 /Fpi (g). Hence, by the Chinese remainder theorem, there are 2k values for h in
i
general.
The second claim follows immediately, or one can prove it using the same argument
as the first part: modulo each prime pi , 2 + (pi − 1)/2 ≈ pi /2 values arise as the trace of
an element in Gpi ,2 .
d(a1 x1 + · · · + an xn + g) = (a1 , . . . , an ).
7.7.9: Write f as a ratio of homogeneous polynomials of the same degree and then
factor them as in equation (7.8).
7.7.15: f /h ∈ k(C) has div(f /h) = 0 and so f /h ∈ k∗ .
7.9.6: See Cassels [122], Reid [497] or Silverman and Tate [567].
Conversely, if TrF2m /F2 (a6 /x2P ) = 0 then one can solve for xQ ∈ F2m the equation
x2Q +xP +a6 /x2Q = 0. Further, TrF2m /F2 (xQ +a2 +a6 /x2Q ) = TrF2m /F2 (xQ +x2Q +a2 +xP ) =
0 so there is an element yQ ∈ F2m such that Q = (xQ , yQ ) ∈ E(F2m ). It then follows that
P = [2]Q.
Finally, the formulae for point halving follow from substituting yQ = xQ (λQ + xQ )
into the formula yP = (xP + xQ )λQ + xQ + yQ .
9.1.5: We have λ = (y1 /z1 − y2 /z2 )/(x1 /z1 − x2 /z2 ) = (y1 z2 − y2 z1 )/(x1 z2 − x2 z1 ).
Similarly, putting x1 /z1 , x2 /z2 and y1 /z1 in the addition formulae in place of x1 , x2 and
y1 gives the above formulae.
9.3.2: There is an inverse morphism which is a group homomorphism, also defined
over k by definition, such that the composition is the identity.
9.3.8: From E1 to E2 is just φ(x, y) = (x + 1, y + x). From E1 to E3 is φ(x, y) =
(x+s2 , y +sx+t) where s ∈ F24 satisfies s4 +s+1 = 0 and t ∈ F28 satisfies t2 +t = s6 +s2 .
9.4.5: For t ∈ F24 show that TrF24 /F2 (s6 + s2 ) = 1 + u(s4 + s + 1)2 = 0. Theorem 9.3.4
implies every element of Aut(E) is of this form. Since there are 24 choices for (u, s, t),
each giving a different function on E(F2 ), one has #Aut(E) = 24. The fact that Aut(E) is
non-Abelian follows can be shown as follows. Let φi (x, y) = (u2i x+ s2i , u3i y + u2i si x+ ti ) for
i = 1, 2. One can check that the x-coordinates of φ1 ◦ φ2 and φ2 ◦ φ1 are u21 u22 x + u21 s22 + s21
and u21 u22 x + u22 s21 + s22 respectively. These are not equal when, for example, u1 = 1,
s1 = ζ3 , u2 = ζ3 and s2 is arbitrary.
9.5.5: The first part of the exercise follows from Theorem 9.3.4. Points P = (xP , yP )
either satisfy a1 xP + a3 = 0 and so P = −P or a1 xP + a3 6= 0 and so yP is a solution to
y 2 + y = F (x)/(a1 x + a3 )2 .
By Exercise 2.14.7 this is soluble if and only if TrF2n /F2 (F (xP )/(a1 xP + a3 )2 ) = 0. Hence,
every xP ∈ F2n is such that either a1 xP + a3 = 0 (in which case both E and E e have a
single point each with x-coordinate xP ) or precisely one of y 2 + y = F (xP )/(a1 xP + a3 )2
and y 2 + y = F (xP )/(a1 xP + a3 )2 + α has a solution. The result follows.
9.5.6: If σ(φ−1 ) ◦ φ = 1 = φ−1 ◦ φ for all σ then σ(φ−1 ) = φ−1 for all σ and φ−1 is
defined over k.
9.5.8: Follow the method of Lemma 9.5.7; also see Proposition 1 of Hess, Smart and
Vercauteren [284].
9.5.9: We have j(E) = 0 and the only elliptic curves E/F e 2 with j(E) e = 0 in short
2 3
Weierstrass form are y + y = x + a4 x + a6 with (a4 , a6 ) ∈ {(0, 0), (0, 1), (1, 0), (1, 1)}.
One can verify by direct calculation that for any pair E1 , E2 of distinct curves in this
form, the isomorphism between them is not defined over F2 .
9.6.2: Let E2 : y 2 + H(x)y = F (x). If φ(x, y) = (φ1 (x, y), φ2 (x, y)) is a morphism then
so is −φ(x, y) = (φ1 (x, y), −φ2 (x, y) − H(φ1 (x, y)).
9.6.7: We know that [0] and [1] are isogenies and that the inverse of an isogeny is an
isogeny, so we may assume that n ≥ 2. Lemma 9.6.6 shows that the sum of two isogenies
is an isogeny. It follows by induction that [n] = [n − 1] + [1] is an isogeny.
9.6.10: Use the fact that [2]P = OE if and only if P = −P = ι(P ). Everything is
direct calculation except for the claim that the quartic has distinct roots, which follows
by observing that if x1 is a repeated root then the corresponding point (x1 , y1 ) would be
singular.
9.6.16: There are many proofs: using differentials; showing that ker(πq ) = {OE };
determining k(E)/πq∗ (k(E)). The statement of the degree follows by Lemma 9.6.13.
9.6.20: This is an immediate consequence of Theorem 9.6.18 (the fact that λ is an iso-
morphism comes from considering degrees). The details are also given in Proposition 12.12
of Washington [626].
613
9.6.22: We have (ψ − φ)b ◦ φ = [0] and so the result follows by the same argument using
degrees as in the proof of Lemma 9.6.11. One can also use Theorem 9.6.18.
9.6.25: This follows since ρ∗ is essentially ρ−1 (x, y) = (ζ3−1 x, y) = (ζ32 x, y).
9.6.29: A point of order 3 means [2]P = −P and the subgroup being rational means
either P is defined over k or P is defined over k′ /k and σ(P ) = −P for all non-trivial
σ ∈ Gal(k′ /k). It follows that k′ /k is quadratic. Translating x to 0 gives a point (0, v).
Since char(k) 6= 2 we assume E : y 2 = x3 + a2 x2 + a4 x + a6 and clearly v 2 = a6 . The
condition [2](0, v) = (0, −v) implies a2 = (a4 /2v)2 = a24 /(4a6 ) and re-arranging gives the
first equation. For the twist write w = a4 /2a6 , X = wx, Y = w3/2 y and A = a6 w3 . Then
It is easy to check that this final equation is singular if and only if A = 0 or 27/4.
9.6.30: See Doche, Icart and Kohel [183].
e over a field k
9.7.6: Let φ(x, y) = (φ1 (x), cyφ1 (x)′ + φ3 (x)) be an isogeny from E to E
′
of characteristic 2. By definition, X = φ1 (x) and Y = cyφ1 (x) + φ3 (x) satisfy the curve
equation Y 2 + (e a3 )Y = X 3 + e
a1 X + e a2 X 2 + ea4 X + e
a6 . Now
It follows that φ3 (x) must satisfy the following quadratic equation over k(x)
φ3 (x)2 +c(e a3 )φ1 (x)′ φ3 (x)+(cφ1 (x)′ )2 (x3 +a2 x2 +a4 x+a6 )+φ1 (x)3 +e
a1 φ1 (x)+e a2 φ1 (x)2 +e
a4 φ1 (x)+e
a6 = 0.
Since k(x) is a field there are at most two possible values for φ3 (x).
9.8.3: [3]P = OE if and only if [2]P = −P . Hence, if P = (x, y) is such that [3]P = OE
then λ2 = 3x = 0 where λ = (3x2 + 2a2 x + a4 )/(2y) = (2a2 x + a4 )/(2y). The statements
all follow from this.
b = [t]
9.9.5: Use the fact that the dual isogeny of φ2 − [t]φ + [d] is φb2 − [t]φb + [d] since [t]
etc.
9.10.4: For each y ∈ Fp there is a unique solution to x3 = y 2 − a6 and so there are p
solutions to the affine equation. Counting the point at infinity gives the result.
9.10.5: Write the curve as y 2 = x(x2 + a4 ). Since −1 is not a square, for any x ∈ Fp
we have either x(x2 + a4 ) = 0 or exactly one of x(x2 + a4 ) and −x(x2 + a4 ) is a square.
Hence there are p solutions to the affine equation.
9.10.10: Maintain a pair of the form (ti , ti+1 ). So start with (t1 = t, t2 = t2 − 2q).
Given (ti , ti+1 ) we can compute (t2i , t2i+1 ) by first computing t2i and then t2i+1 using the
above formulae. To go from (ti , ti+1 ) to (t2i+1 , t2i+2 ) one computes t2i+1 = ti ti+1 − q i t
and t2i+2 = t2i+1 − 2q i+1 . One can then perform a ladder algorithm (working through the
binary expansion of n) as in Lemma 6.3.19.
9.10.11: The first statement is easy to verify by counting points. The second statement
follows since if m | n then Ea (F2m ) is a subgroup of Ea (F2n ) and so #Ea (F2m ) | #Ea (F2n ).
Also, if m ≥ 3 then #Ea (F2m ) > 4. Hence, it suffices to restrict attention to prime values
for n in the third part. The values for E1 are 5, 7, 11, 17, 19, 23, 101, 107, 109, 113, 163
and the values for E0 are 5, 7, 9, 13, 19, 23, 41, 83, 97, 103, 107, 131.
9.10.21: The possibilities are p + 1 ± 46 and p + 1 ± 60. One can test which arises by
choosing a random point P ∈ E(Fp ) and computing [p + 1 − t]P for each choice of t. One
finds that the orders are p + 1 + 46, p + 1 − 60, p + 1 − 46, p + 1 − 46 respectively.
614 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
y 2 + (1 − 2x3 )y = Y 2 + 3Y − x6 + x3 + 2
Y 2 + H(Xd−1 , . . . , X0 )y = F (Xd−1 , . . . , X0 )
in the Jacobian matrix, so to complete the proof we must show that either 2α + Hd 6= 0
or Hd−1 α + F2d−1 6= 0. Note that at least one of {F2d , F2d−1 , Hd } is non-zero, otherwise
we would replace d by d − 1.
If char(k) 6= 2 and both terms are zero then α = −Hd /2 which implies that F2d =
−(Hd /2)2 and F2d−1 = −Hd Hd−1 /2 which violates the condition of Lemma 10.1.8. If
char(k) = 2 then we must consider the three cases in Lemma 10.1.6. The first case is
α = 0 and F2d−1 6= 0 and so Hd−1 α + F2d−1 6= 0. The second and third cases have Hd 6= 0
and so 2α + Hd = Hd 6= 0.
10.1.23: The statement v∞ (x) = −2 follows from the fact that vρ(∞) (Z) = 2 as in
Lemma 10.1.21. The second claim follows since ∞ = (1 : 0 : 0) and 1/x = c(y/xd )2 for
some constant c, in which case c(y/xd ) = xd−1 /y. The third claim is immediate from
Lemma 10.1.22.
10.1.25: Write d = g + 1. Note that
the right hand side of which is a polynomial of degree at most g. It follows that the
negative integer v∞+ (y − G+ (x)) + v∞+ (−y − H(x) − G+ (x)) is at least −g.
10.2.4: This is similar to Exercise 9.5.5.
10.2.5: First take a root α of F (x) and move it to ∞. Then perform a change of
variable on the remaining roots so that one is 0, another is 1 and change y so that the
polynomial is monic.
10.2.7: Follows immediately from Theorem 10.2.1.
10.3.8: If P = (xP , yP ) 6= ι(P ) and (x − xP )eP ku(x) then the claim is immediate
from vP (u(x)) = eP and vP (y − v(x)) = vP ((y − v(x))(−y − H(x) − v(x)) = vP (v(x)2 +
H(x)v(x) − F (x)) ≥ vP (u(x)). If P = ι(P ) = (xP , yP ) then y − yP is a uniformizer at
P . We have vP (u(x)) = vP (x − xP ) = 2 and since v(x) = yP + (x − xP )G(x) for some
polynomial G(x) ∈ k[x] we have vP (y − v(x)) = vP ((y − yP ) − (x − xP )G(x)) = 1.
10.3.11: The first statement follows from the following two facts: (1) ifP D is effective
then so is σ(D);Q(2) σ(ι(P )) = ι(σ(P )). The second Q follows since σ(D)Q= P nP (σ(P ))
and if u(x) = P (x − xP )nP then σ(u(x)) = P (x − σ(xP ))nP = P (x − xσ(P ) )nP
etc. The third statement follows from the second and the uniqueness of the Mumford
representation.
10.3.12: Since the ui (x) are co-prime the composition does not have any special cases
and the equality of divisors is clear. This can also be seen by considering points over k.
10.3.15: Note that ι(6, 4) = (6, 4) and so 2D1 ≡ 2(0, 4). The answers are (x2 +
5x, 4), (x2 − x, −3x + 4), (x2 , 10x + 4), (x4 + 4x3 + 6x2 , 4 + 10x + 6x2 + 3x3 ).
10.3.16: All polynomials are of degree O(m) and multiplication, computing the ex-
tended gcd, and division can be performed
P in O(m2 ) fieldPmultiplications.
10.4.2: The inverse of D = P nP (P ) is ι∗ (D) = P nP (ι(P )). Hence, since the
points P in the divisor class represented by (u(x), v(x)) are of the form (xi , v(xi )) where
u(xi ) = 0 the corresponding points for the inverse of D are (xi , −v(xi ) − H(xi )). The
result follows.
10.4.5: Just re-arrange the equation D3 − d3 (∞) ≡ D1 − d1 (∞) + D2 − d2 (∞).
10.4.8: One has v∞− (y −v ‡ (x)) = v∞− (y −G+ (x)) = −d. The affine part of the second
claim is already proved in the proof of Lemma 10.4.6. Since deg(div(y − v ‡ (x))) = 0 it
617
follows that v∞+ (y − v ‡ (x)) = −(du + du† − d). (There is also a direct proof of this fact.)
10.4.15: This is very similar to the proofs of Lemma 10.4.6 and Lemma 10.4.11.
Let du = deg(u(x)). The leading d − (du − 1) coefficients of v ‡ (x) agree with G+ (x)
and hence deg(v ‡ (x)2 + H(x)v ‡ (x) − F (x)) ≤ 2d − (d − (du − 1)) = d + du − 1. It follows
that deg(u† (x)) ≤ d − 1. Since v∞− (y − v ‡ (x)) = −d and since div(y − v ‡ (x)) has degree
0 one has v∞+ (y − v ‡ (x)) = −(deg(u(x) + deg(u† (x)) − d). The result follows from the
analogue of equation (10.17).
10.4.17: Clearly,
ι∗ (D + n(∞+ ) + (g − du − n)(∞− ) − D∞ )
= ι∗ (D) + n(∞− ) + (g − du − n)(∞+ ) − ι∗ (D∞ ))
When g is even then ι∗ (D∞ ) = D∞ and the result is immediate by Exercise 10.4.2. When
g is odd note that ι∗ (D∞ ) = D∞ + (∞− ) − (∞+ ) and so
10.5.2: By Lemma 8.1.3 and Theorem 8.2.7 we know φ is surjective. Hence, for any
P ∈ E(k) choose any point P ′ ∈ C(k) such that φ(P ′ ) = P and let P ′′ ∈ C(k) be such
that φ(P ′′ ) = OE . Then φ∗ ((P ′ )−(P ′′ )) = (P )−(OE ) as required. The second statement
follows since the kernel of φ∗ is contained in the kernel of φ∗ φ∗ = [deg(φ)].
10.6.3: See Mumford [445] pages 3.31-3.32.
10.7.7: An elegant proof using power series is given in Exercises 17.19 and 17.20 of
Shoup [556].
10.7.8: One has t1 = 0, t2 = −42, t3 = 0. Hence a1 = 0, a2 = 21 and a3 = 0. It follows
that #Pic0F7 (C) = 512.
10.7.14: First, one needs to count various types of points in C(Fq ) and C(Fq2 ). Note
that there is a single point at infinity ∞ on C(Fqn ) for all n ∈ N. Write m for the number
of roots of F (x) in Fq . Let u = 21 (N1 − 1 − m) = 21 (q − t1 − m). Then there are u values
for xP ∈ Fq such that there are points P = (xP , yP ) ∈ C(Fq ) with P 6= ι(P ). Hence
#C(Fq ) = 1 + m + 2u. There are q possible values for xP ∈ Fq . We have shown that
m + u of them arise as x-coordinates of points in C(Fq ) (i.e., F (xP ) is a quadratic residue
for those values). For the remaining q − m − u values xP it follows that F (xP ) is not a
square in Fq . But F (xP ) is a square in Fq2 so xP must arise as the x-coordinate of a point
in C(Fq2 ). Hence there are q − m − u = 12 (q + t1 − m) such values for xP . Hence, there
are 21 (q − m + t1 ) points P = (xP , yp ) ∈ C(Fq2 ) with xP ∈ Fq , yP 6∈ Fq and P 6= ι(P ).
Exercise 10.4.4 classifies divisor classes so it is sufficient to count the number of rep-
resentatives for each case. Case 1 gives N1 divisor classes.
For case 2, let m be the number of roots of F (x) in Fq . Therefore, there are m + 1
points P ∈ C(Fq ) such that P = ι(P ). Hence, case 2 gives N1 − 1 − m divisor classes.
For case 3, we first count the set of pairs (P, Q) such that P, Q 6= ∞, and Q 6∈ {P, ι(P )}.
There are N1 − 1 choices for P , and for each there are either N1 − 2 or N1 − 3 choices
for Q (depending on whether P = ι(P ) or not). Finally, since in this case we always have
618 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
P 6= Q, the number of choices for {P, Q} is half the number of pairs (P, Q). Hence the
total number of divisor classes in case 3 is
1
2 ((N1 − m − 1)(N1 − 3) + m(N1 − 2)).
We finally consider case 4 of Exercise 10.4.4. Note that K = Fq2 is the unique quadratic
extension of Fq . We have P = σ(P ) if and only if P ∈ C(Fq ). Hence, the number of
choices for {P, σ(P )} is 21 (N2 − N1 ). From these choices we must subtract the number
of pairs {P, σ(P )} such that σ(P ) = ι(P ). This happens when xP ∈ Fq but yP 6∈ Fq and
by the above argument there are 21 (q − m + t1 ) such points. Hence, the total number of
divisor classes in case 4 is
1 2
2 (q + 1 − t2 − (q + 1 − t1 ) − (q − m + t1 )) = 21 (q 2 − 2q − t2 + m).
which simplifies to
q 2 − t1 q + (t21 − t2 )/2 − t1 + 1
as required.
10.9.4: This proof follows the same layout as Lemma 9.11.8 and Corollary 9.11.9. The
details are given in [218].
10.9.6: We have p | a1 and p | a2 , which is equivalent to the conditions for supersin-
gularity.
10.9.7: First, simply show that #C(F2nk ) is always odd and so t1 and t2 (notation
as in Lemma 10.7.6) are even. Hence a1 , a2 are even (for the details of this calculation
see Lemma 2 of [218]). The result then follows from part 1 of Theorem 10.9.5 and
Exercise 10.9.6.
an earlier value using one additional multiplication. The second claim of the exercise is
clear. Qn
11.2.3: For windows of length w one must precompute all ub1 ,...,bn = i=1 gibi for
0 ≤ bi < 2w under the constraint that at least one of the bi is odd. The number of such
values is 2nw − 2n(w−1) of which n come for free. Hence the precomputation requires
2nw − 2n(w−1) − n multiplications (actually, when w > 1 the computation can be arranged
so that some of these are squarings). See Yen, Laih and Lenstra [638] for details.
11.2.4: See Algorithm 3.51 of [274].
11.3.1: Given P = (xP , yP ) compute a solution to λ2Q + λQ = xP + a2 , determine
whether the corresponding value of x2Q satisfies the trace condition (and if not, replace
λQ by λQ + 1), compute a square root (which is easy in finite fields of characteristic two),
and solve for yQ . See Knudsen [342] for details.
11.3.4: The cost depends on the number of non-zero values for ai , which is the weight.
The number of elliptic curve additions is one less than the weight. We ignore the cost of
computing the Frobenius maps.
11.3.10: Let n0 = 107 and n1 = 126 so a0 = −1 and the new values for (n0 , n1 ) are
(180, −54). The Frobenius expansion is
−1 − π 5 − π 7 − π 9 + π 11 + π 13 + π 16 .
11.3.13: P ∈ E(Fpm ) if and only if (πm − 1)P = OE .
11.3.16: It is clear that P is in the kernel of the endomorphism corresponding to this
polynomial. Now, note that (x19 − 1)/(x − 1) ≡ −457 + 314x (mod x2 − x + 2) and that
−457 + 314π has norm r. Rounding n(−457 + 314π̄)/r gives −67 − 148π from which we
get
n − (−67 − 148π)(−457 + 314π) = −107 − 126π
as was found using the GLV method. P
11.3.19: One first precomputes all w−1 j
j=0 [aj ]π (P ). To do this one computes all [aj ]P ,
which needs one doubling and (when q is odd) (q − 5)/2 additions or (when q is even)
q/2 − 2 additions. One computes [aj ]π j (P ) as π j ([aj ]P ) and we ignore the cost of this.
To compute all the terms requires at most q w−1 additions. Hence, the total cost of
precomputation is at most q/2 + q w−1 group operations.
The exponentiation itself then requires at most (l + 1)/w additions.
11.3.20: First compute integers a′0 , a′1 such that a′0 + a′1 π ≡ a(π) (mod π 2 − tπ + q)
(this can be done efficiently using Lucas sequences). Then find the eigenvalue λ for π by
computing gcd(x2 − tx + q, xm − 1). Finally, compute a ≡ a′0 + a′1 λ (mod r). See Brumley
and Järvinen [112].
11.3.23: Analogous to the method at the end of Section 11.3.2.
11.3.24: The first claims are immediate since #E(Fp2 ) = (p + 1 − t)(p + 1 + t). The
map ψ is an endomorphism since ψ, π and φ−1 are endomorphisms (alternatively, because
ψ is a morphism fixing OE ′ ). One can directly compute that ψ 2 = [−1]. The formula
ψ 2 − [t]ψ + [p] = 0 follows since π satisfies this formula and ψ is just a conjugation of π.
Since r2 ∤ #E ′ (Fp2 ) it follows that ψ(P ) ∈ hP i and so λ exists. The formula for λ follows
from solving the simultaneous equations λ2 ≡ −1 (mod r) and λ2 − tλ + p ≡ 0 (mod r).
11.4.7: Let S be the set of integer k-tuples (a1 , . . . , ak ) with 0 ≤ ai < mi for 1 ≤ i ≤ k.
Let
Q Tai be Q the set of (a1 , . . . , ak ) ∈ S in such that the value of equation (11.2) is 1. Then
bi
g
i i = i gi if and only if the vector with entries ai − bi (mod mi ) for 1 ≤ i ≤ k lies
in T . It follows that #G = #S/#T and that the method samples uniformly from the
group G.
11.4.9: A simple solution is to choose a, b ∈ Fq uniformly at random and reject if
a2 − ab + b2 = 1. This happens with probability roughly 1/q. One can then use the
620 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
decompress map to obtain an element of G6,q . This process misses several points in G6,q ,
such as the element 1 and the element θ2 of order 3 (which corresponds to the point
(0, 0, 0) not appearing in the image of the map g in Example 6.4.4).
11.4.10: The expected number of trials to get a soluble quadratic equation is roughly
√
2 (precisely, there are at least (q − 2 q)/2 values for x0 such that y 2 + H(x0 )y − F (x0 ) is a
√
square in Fq and so the probability to be successful is at least (q − 2 q)/(2q) ≈ 1/2). One
solves the quadratic equation either by computing square roots using Exercise 2.14.3 (ex-
pected complexity of O(log(q)2 M (log(q))) bit operations) or, in the case of characteristic
2, by Lemma 2.14.8 (complexity O(log(q)3 ) bit operations). The goto statement in line
14 occurs with probability at most 12 q3 < 12 and so the expected number of repeats is less
than 2. Hence, the algorithm for finding random points on elliptic curves has expected
complexity O(log(q)4 ) bit operations.
11.4.12: See Section 5 of Shallue and van de Woestijne [545].
11.4.13: The first claim is checked by an elementary calculation. For the second claim
equate y − ux = v = (3A − u4 )/(6u) and compute the roots in Fq of the polynomial
6u(y − ux) − (3A − u4 ).
11.4.17: Set l′ = l/n and use the method of Example 11.4.2 n times with l′ -bit strings.
11.5.2: When the algorithm ends, the points P and Q generate the subgroup of E(Fq )
of order N0 . One simply adds to P a point R of order N1 (found using an analogue of
Algorithm 5).
11.5.3: If the group is cyclic then the probability that a random element is a generator
is ϕ(le )/le = 1 − 1/l. Hence, the probability that among two elements at least one of
them is a generator is 1 − (1 − (1 − 1/l))2 = 1 − 1/l2 .
If the group is not cyclic, suppose its structure is (Z/lf Z) × (Z/le−f Z) where 1 ≤
f ≤ e − f . Consider the projection of points {P, Q} to elements {(p1 , p2 ), (q1 , q2 )} of this
group. The points generate E(Fq )[le ] if and only if the vectors {(p1 , p2 ), (q1 , q2 )} are a
basis for the vector space (Z/lZ)2 . Hence, one needs the first vector to be non-zero (this
occurs with probability 1−1/l2) and the second vector to not lie on the line corresponding
to the first vector (this occurs with probability 1 − 1/l).
The probability of success overall is therefore the product for all primes li , which gives
the stated formula. Finally, ϕ(N0 )/N0 > 1/(3 log(log(N0 ))) = O(1/ log(log(q))) and
Y Y
1 − l12 > 1 − l12 = ζ(2)−1 = 6/π 2 = O(1)
l|N0 l
where the second product is over all primes l. Hence one expects O(log(log(q))) iterations
overall.
For generalisations and more detail see Section 6.1 of Miller [429].
11.6.2: Use point halving to attempt r − 1 halvings and then check whether the point
can be halved further over Fq (this is only possible if the original point has odd order).
11.7.2: First, we know that Tr(xP ) = Tr(a2 ) = 0. We may assume that xP 6= 0 and
so
(yP /xP )2 + (yP /xP ) = xP + a2 + a6 /x2P .
√ √
Hence, Tr(a6 /x2P ) = 0 and so Tr( a6 /xP ) = 0. It is immediate that (0, a6 ) has order
2, and since Tr(0) = 0 it follows that it can be halved in E(F2n ). The statement about
√
(xP , yP ) + (0, a6 ) follows from the formulae for the group law. Since (xP , yP ) and
√
(0, a6 ) can both be halved, their sum can also be halved; this also follows directly since
√
Tr( a6 /xP ) = 0.
√
The receiver gets an n − 1 bit string representing either xP or a6 /xP . The receiver
√
then computes the corresponding value z ∈ {xP , a6 /xP }. One can verify that, in both
621
12.3.7: List the primes B < Q1 < Q2 < · · · < Qk ≤ B and use the fact that
bQi+1 ≡ bQi bQi+1 −Qi (mod N ). One precomputes all the increments bQi+1 −Qi (mod N ).
12.3.8: Apply Theorem 2.16.1.
12.3.9: See Williams [634] (note that he credits Guy and Conway for the suggestion).
12.5.1: Exercise 2.2.9 showed that one can determine if N is a prime power (and factor
it) in polynomial time. So suppose N has at least two distinct prime factors. If p2 | N
then either p < N 1/3 or N/p2 < N 1/3 . Use the Pollard-Strassen method with B = ⌈N 1/6 ⌉
to find all prime factors of N that are less than N 1/3 in Õ(N 1/6 ) bit operations. Then
test whether the remaining unfactored part of N is a perfect power.
Let N1 = #S1 · · · #Sm and N2 = #Sm+1 · · · #Sl . Compute and store the left hand side
of the equation in time and space O(N1 ) then compute the right hand side and check for
623
a match. The running time is O(N1 + N2 ) group operations and the storage is O(N1 )
group elements.
13.5.5: Define S1′ = {a1 · · · a⌊l/2⌋ : aj ∈ Sj for 1 ≤ j ≤ l/2} and S2′ = {a⌊l/2⌋+1 · · · al :
aj ∈ Sj }. We assume #S1′ ≤ #S2′ . Compute and store (g a1 , a1 ), sorted according to
−1
the first component, for all a1 ∈ S1′ then compute each ha2 for a2 ∈ S2′ and check for a
match with the earlier list. The running time is O(#S1′ + #S2′ ) group operations and the
storage is O(#S1′ ) group elements.
⌈αn⌋
13.6.10: Find the largest α ∈ R such that α ≤ 1/2 and M ≥ ⌊αw⌋ . Compute M
n−⌈αn⌋
“baby steps” and then w−⌊αw⌋ “giant steps”.
13.8.2: A solution is to sort L1 and then, for each x2 ∈ L2 to check whether x2 ∈ L1 .
For the “hash-join” solution see Wagner [625].
13.8.5: See Wagner [625].
13.8.7: D = {x ∈ {0, 1}n : LSBm (x) = 0}.
13.8.9: See Wagner [625].
14.5.10: If w ≥ πr/8 ≈ 0.4r then one should use the rho algorithm. If w is significantly
smaller than 0.4r then one would use the kangaroo method. Determining the exact
crossover would require careful experimentation.
14.5.12: See Galbraith, Pollard and Ruprai [226]. p
14.6.3: The heuristic cost is w/(2m) + 4m/NP2 , which is minimised by m = NP w/8.
14.7.6: We always√ have #(T ∩ W ) √ = r where r = #G. The heuristic complexity is
therefore (1 + o(1)) πr ≈ (1.77 + o(1)) r group operations, which is slower than Pollard
rho.
14.7.7: See Galbraith and Ruprai [227].
14.8.1 See van Oorchot and Wiener [473].
14.9.5: x2 + 1 is fast to compute and does not have any trivial fixed points or short
cycles. The other suggestions have fixed points independent of p | N .
14.9.6: The idea is that f (x) is now m-to-1, so the expected length of the rho is
shorter (this is the same as the reason why taking nS > 3 is a good idea; see the end of
Section 14.2.5). For more discussion of this specific case see Brent and Pollard [99].
14.9.7: One cannot “see” a match modulo p without computing a gcd.
17172 ≡ 22 · 33 · 5 · 7 (mod N )
2
2365 ≡ 23 · 32 · 5 · 7 (mod N )
17572 ≡ 27 · 33 (mod N )
5192 ≡ 25 · 3 · 52 (mod N )
Adding the first three rows modulo 2 gives the all zero vector (again, we are lucky that
5 relations are not required) and let X = 1717 · 2365 · 1757 (mod N ) and Y = 26 · 34 · 5 ·
7 (mod N ). Then gcd(X − Y, N ) = 73. One has N = 53 · 73.
15.2.5: See Exercise 16.5 of Shoup [556].
15.2.8: First note that (#B)2 = LN (1/2, 1 + o(1)) as required. For the second part,
write u = log(N 1/2+o(1) )/ log(B) and note that one expects TB ≈ uu . Now,
p p
u = ( 12 + o(1)) log(u)/( 12 log(N ) log(log(N ))) = (1 + o(1)) ln(N )/ ln(ln(N )).
Hence, p
log(uu ) = u log(u) = ( 21 + o(1)) log(N ) log log(N ).
Hence #BTB = O(LN (1/2, 1 + o(1))) = LN (1/2, 1 + o(1)). See Section 6.1 of [162] or
Section 16.4.2 of [556]
√ for further details. √
15.2.10: If x = kN +ǫ then either x2 −kN or kN −x2 is a positive integer ≤ 2 kN ǫ.
The algorithm then proceeds the same way.
15.3.4: One expects to make LN (1/3, 1/(2c)+o(1)) trials until the value x is L√N (2/3, c)-
smooth. One can use ECM to factor the numbers (if they are smooth) in Lp (1/2, 2+o(1))
operations. Inserting p = LN (2/3, c) gives the result.
15.5.1: Let u ∈ hgi ∩ G′ = {1}. The order of u divides r and (p − 1)/r. Since
gcd(r, (p − 1)/r) = 1 it follows that the order of u is 1.
15.5.2: If r < (p − 1)/r is large then one can efficiently generate a random element
δ ∈ G′ by choosing a random element w ∈ F∗p and computing δ = wr (mod p). If
r ≥ (p − 1)/r then it is better to precompute an element g1 ∈ F∗p of order (p − 1)/r and
then compute δ = g1i (mod p) for a random value of i (one can speed this up further using
a Pollard-style pseudo-random walk, which is also a good solution when r is small).
15.5.3: See Algorithm 16.1 and Lemma 16.2 of Shoup [556].
15.5.7: Let B = Lp (1/2, c). By Corollary 15.1.8, TB = Lp (1/2, 1/(2c) + o(1)). Hence
the running time of the relation collection is O(Lp (1/2, 2c + 1/(2c) + o(1))) bit operations
and the running time of the linear algebra is O(Lp (1/2, 2c + o(1))) bit operations. The
optimal value of c is 1/2 and the complexity is as stated.
15.5.8: Let re k(p − 1) and let γ ∈ Fp∗ have order re . Let G′ be the subgroup of order
(p − 1)/re . Generate relations of the form γ z δ (mod p) with 1 < z < re and δ ∈ G′ .
One needs a relation featuring g and a relation featuring h. The linear algebra is now
modulo re (see Exercise 15.4 of [556]). One finds γ Z1 g Z2 = 1 from which it follows that
Z′ e−1
re−1 | A and so γ1 1 g Z2 = 1 with γ1 = γ r and Z1′ = Z1 /re−1 . One therefore compute
the logarithm of g to the base γ1 and similarly for h.
15.5.9: Once the first s relations are found only one relation is needed for each hi , and
this takes O(uu #BM (log(p))) = O(Lp (1/2, c + 1/(2c) + o(1))) = O(Lp (1/2, 3/2 + o(1))
bit operations (using trial division for the relations). With our current formulation the
full linear algebra has to be repeated each time (actually, this can be avoided by using a
different approach), but this only costs O(Lp (1/2, 1 + o(1))) bit operations.
√
15.5.10: We are testing numbers of size p for B-smoothness so the number of
′ √
trials before getting a B-smooth value for w1 is (u′ )u where u′ = log( p)/ log(B) =
1
2 log(p)/ log(B). However, since we need both w1 and w2 to be smooth the number of
′
trials is (u′ )2u = (u/2)u . For B = Lp (1/2, c) it follows that log((u/2)u ) = u log(u/2) ≈
u log(u) and so one gets the same complexity as before (but a smaller o(1) term).
15.5.14: Suppose b is even. One can write the sum as pb /b + pb−1 /(b − 1) + · · · +
pb/2 /(b/2) plus fewer than 2b terms which are all O(pb/2 ). Since pb−i /(b−i) ≤ pb−i /(b/2) =
2pb−i /b for 0 ≤ i ≤ b/2 the first result follows.
626 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
For the approximation just note that pb /b + pb−1 /(b − 1) + · · · ≈ pb /b(1 + 1/p + 1/p2 +
· · · ) = pb /b(1 − 1/p). p
15.5.16: Following
p the discussion earlier in this section, let b = c n log(n)/ log(p) and
u = n/b = 1c n log(p)/ log(n). Then #B < pb and so #B = O(Lpn (1/2, c)). Now
p
log(uu ) = u log(u) = 1c n log(p)/ log(n) log(1/c) + 12 (log(n) + log(log(p)) − log(log(n))
1
p
= 2c + o(1) n log(n) log(p).
Hence uu = O(Lpn (1/2, 1/(2c) + o(1))) as usual. The total running time is therefore
O(Lpn (1/2, c + 1/(2c) + o(1)) √ + Lpn (1/2, 2c + o(1))) bit operations. This is minimised
when 2c2 = 1, i.e., c = 1/ 2, which gives the stated complexity. We refer to Section
4 of Odlyzko
p [469] for more details, but note that Odlyzko writes the complexity as
O(exp(c n log(n)) = O(Lpn/ log(n) (1/2, c)).
15.5.18: Note that F2d = F2 [x]/(A(x)) where d = deg(A(x)). Let α ∈ F2d be a root
of A(x). If the equation x2 + x = α has no solutions then A(x2 + x) is irreducible. If the
equation x2 + x = α has two solutions (namely, α and α + 1) in F2d then A(x2 + x) is the
product of their minimal polynomials.
15.5.22: For example F1 (t) = t4 + t2 + t + 1 and F2 (t) = t4 + t2 .
15.5.23: Note that φ1 (ψ1 (x)) = t, φ1 (ψ1 (y)) = φ1 (F1 (x)) = F1 (t), φ2 (ψ2 (x)) =
φ2 (F1 (y)) = F2 (F1 (t)) ≡ t (mod F (t)) and φ2 (ψ2 (y)) = φ2 (y) = F1 (t).
15.6.2: Set b = ⌈logq (Lqg (1/2, c))⌉. Construct the factor base B as above, generate
random group elements using the algorithm of Section 15.5.1 and use Theorem 15.6.1 to
determine the expected number of trials to get a smooth relation. The group operations
and polynomial factorisation are all polynomial-time and can be ignored. The algo-
rithm therefore has the usual complexity #BLqg (1/2, 1/(2c) + o(1)) + (#B)2+o(1) which
is Lqg (1/2, c + 1/(2c) + o(1))√ + Lqg (1/2, 2c + o(1)) when g is sufficiently large. This is
optimised by taking c = 1/ 2, giving the stated running time. For the technical details
see Enge and Gaudry [195] or Section VII.6.1 of [65].
15.6.3: See page 36 of Adleman, DeMarrais and Huang [4] for the case of one point at
infinity.
15.6.4: Clearly degree 1 prime divisors are points and #C(Fq ) = q + 1 + t where |t| ≤
√
2g q = o(q). As we know, there are approximately q g divisor classes and #C(Fqg)+g−1 =
q(1+o(1))+g−1
g = q g (1 + o(1))/g! divisors formed by taking sums of prime divisors of
degree 1 (and subtracting a suitable divisor at infinity to get a degree 0 divisor).
For hyperelliptic curves with a single point at infinity, Lemma 10.3.24 shows the
Mumford representation is unique and the above argument therefore proves the result.
However, for general hyperelliptic curves uniqueness does not necessarily hold and so this
argument needs some care. To deal with this one uses the fact that there are #Pic0Fq (C) =
q g (1 + o(1)) divisor classes and hence only o(q g ) divisor classes contain more than one
reduced divisor. It follows that only o(q g ) sums of g points in C(Fq ) can yield divisor
classes containing more that one reduced divisor, and so the above arguments do prove
what is required.
15.6.5: See [242] or Section VII.6.2 of [65].
15.8.3: One can easily check all three properties for n = 2. The case n = 3 follows
directly from the group law: if x1 6= x2 , then x1 + x2 + x3 = λ2 where λ = (y2 − y1 )/(x2 −
x1 ). Expanding gives 2y1 y2 = y12 + y22 + (x2 − x1 )(x1 + x2 + x3 ); squaring both sides and
substituting x3i + a4 xi + a6 for yi2 gives (x1 − x2 )2 times the stated equation. The case
x1 = x2 follows by using λ = (3x21 + a4 )/(2y1 ).
The general case follows since P1 + · · · + Pn = OE if and only if P1 + · · · + Pn−2 = −R
and Pn−1 + Pn = R for some point R on the curve. In other words, P1 + · · · + Pn−2 + R =
627
Pn−1 + Pn + (−R)) = OE . The symmetry is obvious, and the statement about degrees
follows by induction and using the fact that the resultant of a quadratic and a degree
2n−2 polynomial is a degree 2n−1 polynomial.
Chapter 18: Algorithms for the Closest and Shortest Vector Problem:
18.1.9: The complexity of computing the Gram-Schmidt basis is given by Theorem 17.3.4.
Using the same techniques, one can show that wi can be represented using exact Q-
arithmetic with denominators bounded by X n−1 and numerator bounded by X n .
628 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
18.1.10: The inductive process uses the fact that the orthogonal complement of bn is
the span of {b∗1 , . . . , b∗n−1 }. If one starts at b1 instead of bn then one needs an analogue
of Lemma 18.1.1. P P P
18.2.5: If w = ni=1 li bi and u = ni=1 li′ bi then kw − uk2 = ni=1 (li − li′ )2 kbi k2 . The
result follows.
√ 18.2.7: w ≈ 24.09b1 +12.06b2 +26.89b3 so v = (99, 204, 306) and kv−wk = k(1, 1, −1)k =
3.
18.3.4: (100, 77, 104).
18.4.5: See Figure 1 of Hanrot and Stehlé [275] or Algorithm 10.6 of Joux [317].
18.4.7: See Section 3 (under “Combinatorial methods”) of Micciancio and Regev [423].
q̃ = ⌊N/(p̃ + X)⌋
means q̃ ≤ q ≤ N/p̃, which is an interval of width N X/(p̃(p̃ + X)) < qX/p̃. Hence
q = q̃ + y0 with 0 ≤ y0 ≤ q(X/p̃).
19.4.12: Let p̃ = 5000 and X = 10. We seek a small root of F (x) = (p̃ + x)3 modulo
a large factor of N . Reducing the matrix
N 0 0 0 0
0 NX 0 0 0
0 0 NX 2
0 0
3
p̃ 3p̃2 X 3p̃X 2 X3 0
0 p̃3 X 3p̃2 X 2 3p̃X 3 X 4
≤ c(log(n) + log log(pn )); whereas if e > log(n) then the logarithm of the running time of
the algorithm is ≥ log((n/e)e ) > log(n)2 − log(n) log log(n).
19.4.16: pn ≈ n log(n) so P > n! > (n/e)n (warning: the p e here is 2.71828... from
Stirling’s
p formula) and so log(P
p ) > n(log(n) − 1). Then log(X)/ log(P ) log(pn ) ≈
log(X)/(n log(n)) log(n) = log(X) log(n)/n. The claimed value for e follows. This is
obviously > log(n) for large n and sufficiently small X.
19.4.17: Let m = ⌈log2 (U )⌉. Then 2m ≤ U < 2m+1 and 2m+1 ≤ 2U ≤ V .
19.4.19: For the first case we get x = −347641 and for the second x = 512.
19.5.2: Given q let pi = ⌊qαi ⌉ so that |qαi − pi | ≤ 1/2.
19.5.4: The first row output by LLL on the matrix is approximately (−0.0000225, 0.0002499, 0.0002499, 0.0007500
Now compute q = 0.0000225Q/ǫ = 2250. One finds p1 = 3499, p2 = 1735, p3 = 750.
19.6.1: Note that 21 b1/3 < qb < b1/3 and so |y| < 21 qb as required. Also, note that
the continued fraction method finds qa /qb as long as |(ã/b̃) − (qa /qb )| < 1/(2qb2 ). First
note that b−1/3 < 1/qb < 2b−1/3 so 12 b−2/3 < 1/(2qb2 ). Now, the difference (ã/b̃) − (qa /qb )
is given by equation (19.6), whose numerator is bounded by 2 12 b1/3 14 b1/3 . Since 1/qb <
2b−1/3 we have the difference bounded by 21 b1/3 /b̃. It follows that the difference is less
than 1/(2qb2 ) as required and so Euclid solves the problem.
19.6.2: If α < β then the target gcd is smaller than the errors – one therefore expects
very many solutions.
The first condition comes from the Diophantine approximation step: Namely that the
right hand side of equation (19.6) (which is 1/b̃1−β ) is at most 1/(2qb2 ) ≈ 1/b̃2(1−α) . The
second condition comes from the requirement that |y| < 21 qb .
19.6.3: The process is the same as the generalisation of Diophantine approximation
β
in Section 19.5. The lattice is b̃0 ãb̃ which has determinant roughly b̃1+β and a short
vector (qa b̃β , qb x − qa y) of length roughly b̃1+β−α . The result follows.
19.7.4: See [496] for the first reduction. The second is almost immediate, but needs
some care.
32−20 = 12. We then take 12−7 = 5. Hence, we have computed that 112 = 5+7+20+80,
which is the solution vector (0, 1, 1, 1, 0, 1, 0).
19.13.10: n/(n − 1) = 1 + 1/(n − 1).
19.13.11: 8/ log2 (430) ≈ 0.9145.
19.13.12: By Exercise 19.13.8 bn ≥ 2n−1 and so the density is at most n/(n − 1) =
1 + 1/(n − 1).
19.13.15: 0110010.
19.13.16: 0.782
19.13.17: (154, 184, 43, 69, 125, 62), c = 384.
19.13.18: Encryption is deterministic.
19.13.19: Given a ciphertext c one can call c + a1 and c − a1 to the decryption oracle.
One of them is a valid ciphertext and corresponds to the original message with the first
bit flipped.
19.13.21: Since 0 < ai < M we expect an average ciphertext to be a sum of around
n/2 integers of size M/2. Hence c ≈ nM/4 on average (and, in all cases, 0 ≤ c < nM ).
Since M ≥ 2n we expect c to require at least log2 (nM/4) > log2 (n) + n − 2 bits.
19.13.22: Take bi = 2i−1 for 1 ≤ i ≤ n, M = 2n + 1 and any W such that W bi 6≡
n
2 (mod M ) for all i. Then the density is > 1. Of course, it is easy to compute the
private key corresponding to such a public key.
Pn19.13.24: Since the integers ai,j are like random integers modulo t
Mi we expect
t n
j=1 ai,j ≈ nMi /2 and so Mi+1 > nMi /2. Hence, Mt > (n/2) M1 ≥ (n/2) 2 . The
ciphertext is expected to be a sum of around n/2 integers of size Mt /2 and so around
nMt /4. Therefore, on average,
log2 (c) = log2 (n(n/2)t M1 /4) > log2 (n) + t(log2 (n) − 1) + n − 2.
Since the at,i are somewhat like randomly chosen integers modulo Mt we expect to have
max{at,i } ≈ Mt . We conservately assume in what follows that, on average, max{at,i } >
Mt /2. Hence the density is at most n/ log2 (Mt /2) < n/(t(log2 (n) − 1) + n − 1). For
example, n = 200 and t = 5 gives expected density less than 0.87; in any case, the density
of an iterated Merkle-Hellman knapsack is always significantly less than 1.
19.13.25: From Exercise 19.13.8 we have bn > 2n−2 b1 and so M > (2n−2 + · · · + 2 +
1 + 1)b1 = 2n−1 b1 . So b1 b2 > M > 2n−1 b1 implies b2 > 2n−1 . Exercise 19.13.8 also shows
M > 2n−3 b2 and so M > 22n−4 . Then log2 (nM/4) > log2 (n) + (2n − 4) − 2.
19.13.26: See if W −1 ai (mod M ) are small and allow efficient solution to the subset
sum problem using a greedy algorithm.
19.13.28: a1 b2 − a2 b1 = 7 · 233 · 37589 · 143197. The only factor of size ≈ a3 is
M = 233 · 37589 = 8758237. This gives W = a1 b−1 1 (mod M ) = 5236910. One verifies
that W −1 ai (mod M ) is a superincreasing sequence.
19.13.30: Suppose W is known and assume no permutation is used. Note that there
are integers ki for 1 ≤ i ≤ n such that
ai = bi W + ki M
that a generic algorithm for Fixed-CDH with respect to g r1 , even when given a perfect
√
Fixed-CDH oracle with respect to g, takes Ω( r2 ) group operations.
21.1.20: For the proof, historical references and a major generalisation of such prob-
lems see [102].
21.4.12: For example, with a perfect Fixed-CDH oracle, Pohlig-Hellman only and
using projective coordinates the number of oracle queries is O(log(r) log log(r)) oracle
queries and O((l12 + l2 ) log(r)2 / log(max{l1 , l2 })) group operations.
21.4.13: We give the results only for the case of Pohlig-Hellman combined with ex-
haustive search. Note that not every a ∈ Fr corresponds to an element a + bθ of G2,r ,
whereas every a ∈ A1 (Fr ) corresponds to an element of T2 (Fr ). Hence, embedding the
DLP instance into the algebraic group G2,r requires an expected O(log(r)) oracle queries
(computing Legendre symbols and taking square roots).
The group operation using the first representation requires no inversions but the group
operation for the second representation requires inversions. The number of Fixed-CDH
oracle queries respectively is O(log(r) log log(r)) and O(log(r)2 log log(r)). Hence, the
first representation is better. If one has a CDH oracle then inversions are a single oracle
query and so the number of oracle queries is O(log(r) log log(r)) in both cases.
21.5.5: See Cheon [131].
21.5.9: See Brown and Gallant [111].
21.6.4: See Kaliski [327] or Fischlin and Schnorr [203].
21.6.9: Let A be a perfect oracle which, given h = g x for x ∈ {0, 1, . . . , r − 1} outputs
b(x). It suffices to show how to use A to determine the least significant bit of x. We may
assume that h 6= g −1 , since if h = g −1 then we know x. If A(h) = 1 then (x1 , x0 ) = (0, 1)
or (1, 0), so A(gh) determines the LSB. Similarly, if A(h) = 0 then (x1 , x0 ) = (0, 0) or
(1, 1) and so A(gh) determines the LSB (since h 6= g −1 there is no carry when computing
gh).
21.6.11: The integer r in binary begins as 11000 · · · so the highest order 2 bits of a
random integer modulo r are essentially 00, 01 or 10 with probability close to 1/3 each.
Hence, both predicates are 0 with probability close to 2/3.
21.6.13: Let A be an oracle such that A(g x ) = b(x). Let h = g a . Set j = 1 and if
A(h) = 0 then set l = 1, and if A(h) = 1 then set l = 2. Given, at step j, (l − 1)r/2j ≤
j j
a < lr/2j one calls A(h2 ). If A(h2 ) = 0 then (2l − 2)r/2j+1 ≤ a < (2l − 1)r/2j+1 ,
otherwise, (2l − 1)r/2j+1 ≤ a < 2lr/2j+1 .
We remark that Blum and Micali [73](generalised by Long and Wigderson [393]) use
Legendre symbols and square roots modulo p to show this predicate is hardcore in the
group F∗p when g is a primitive element (their method does not work in a prime order
cyclic subgroup).
21.6.15: See Section 7 of Li, Näslund and Shparlinski [387].
21.7.4: This is the same argument as Exercise 21.6.13. One bounds α as (l − 1)p/2j ≤
α < lp/2j and refines (l, j) by computing A1 (2j (mod p)) = MSB1 (α2j (mod p)).
21.7.6: Use the same argument as Exercise 21.6.4. See Fischlin and Schnorr [203] for
details.
21.7.13: Given a DDH instance (g, g a , g b , g c ) one can compute MSB1+ǫ (g c ) and com-
pare with the result of the oracle. If g c = g ab then the results will agree. Repeating
for random self-reduced versions of the original DDH instance gives the result. We refer
to Blake and Garefelakis [62]and Blake, Garefelakis and Shparlinski [63]for details and
generalisation to small subgroups of F∗p and to elliptic curve groups.
i
21.7.14: Just call A(g, (g a )2 , g b ) to get the i-th bit of the representation of g ab .
21.7.15: Call A(g, g a g z , g b ) about m times for uniformly random z. Each output
yields a linear equation over F2 in the unknown bits of g ab . Solving the system of linear
633
If s1 = 0 then the signature is valid for all public keys. If s1 6= 0 then h−s s2 −s1
A 6= g hB
1
and
so we have a hash collision of a very special form: namely H(mkR1 ) = H(mkR2 ) where
R1 and R2 are distinct elements of hgi. If the bit-length of the hash output is l such that
2l < r then, by the pigeonhole principle, there must be distinct R1 , R2 ∈ hgi such that
H(mkR1 ) = H(mkR2 ). Indeed, one expects many such pairs if 2l is significantly smaller
than r.
Even when 2l is significantly larger than r then, by the birthday paradox, one expects
there to be a collision of the form H(mkR1 ) = H(mkR2 ). However, if 2l is larger than r2
then the probability of such a collision is rather low.
As for security, the existence of two keys for which the same signature is valid on
the same message is not considered to lead to any practical attack in any real-world
application. In any case, it appears to be impossible to construct the actual signatures,
given the hash collision H(mkR1 ) = H(mkR2 ), without solving at least two instances of
the discrete logarithm problem.
22.1.12: Change s2 to k − as1 (mod r). All the security arguments are unchanged by
this.
22.2.2: Write the verification equation as
If gcd(s2 , #G) = 1, and h is known to lie in hgi then this equation (together with the
possibly simpler check that s1 ∈ G) implies s1 ∈ hgi.
One sees that Verify is computing a 3-dimensional multi-exponentiation with expo-
nents all general elements of Z/rZ and only one base fixed. Using basic methods (i.e.,
not windows or signed expansions) this computation will require roughly twice the cost
of the computation in Example 22.1.13. Even when using more advanced methods such
as windows, the fact that s1 is a variable base in the multi-exponentiation is always a
disadvantage. An additional cost in Elgamal signature verification (also for signing) is
computing a hash function whose image is Z/rZ rather than {0, 1}l .
22.2.3: Hint: Set s1 = g u h for random 0 ≤ u < r.
Set s1 = g u h for random 0 ≤ u < r. and s2 = −F (s1 ) (mod r). One checks that
Hence, taking m = −uF (s1 ) (mod r) gives the existential forgery, More elaborate versions
of this attack are given in Section 4.2.3 of Elgamal [192].
634 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
Note that, under our assumptions, F (s1 ) = s′1 and that sr1 ≡ 1 (mod p). Then hF (s1 ) ss12 =
′ ′
hs1 g H(m) h−s1 ≡ g H(m) (mod p) as required.
22.2.6: Hint: If s1 = ur for any u ∈ N then hF (s1 ) = 1.
Set s1 = ur where u ∈ N is such that r divides the order of s1 modulo p (this is easy).
The trick is to set
(p−1)/r
g = s1 (mod p)
which is a generator for the subgroup of order r. Use g as part of the system parameters
of the scheme. The signature forgeries will all use the same value for s1 (actually, s1 can
be varied by multiplying s1 by any integer of order dividing (p − 1)/r modulo p, as long
as one always treats s1 as an integer and does not reduce modulo p). Note that, for any
public key h, we have hF (s1 ) = 1. Finally, set s2 = H(m)(p − 1)/r ∈ N so that
A nice extension of the attack, which works even when the checks on s1 and s2 are
performed, is to choose s1 = ur so that 1 < s1 < p and so that the order of s1 modulo p
is equal to r. One can then take g = s1 . Though it is easy to arrange that the order of
s1 equals r, it does not seem to be easy to do this while still keeping the integer ur less
than p.
More details of these attacks, and variants in the case where g is a primitive root, are
given in Bleichenbacher [66].
22.2.7: Try random m1 , m2 until r = |H(m1 ) − H(m2 )| is prime. See Vaudenay [615].
22.2.8: The signatures are all valid with probability at most 1/r. So suppose signature
j is not valid. Choose all wi for i 6= j randomly. Then there is at most a 1/(r − 1) chance
that wj is chosen so that the equation is satisfied.
Qt w F (s ) �t
When all hi = h just replace i=1 hi i 1,i by h i=1 wi F (s1,i ) . One can now break
the equation into t/3 3-dimensional multi-exponentiations, so the total cost is about 1/3
of the naive case.
For the third part see Yen and Laih [637].
It seems to be impossible to do something similar for Schnorr signatures since each
g s2 h−s1 needs to be computed separately. √
22.2.12: First, precompute and store g1 = g ⌈ r⌉ . Then, for each signature (s0 , s2 )
to be verified run Euclid’s algorithm√on inputs u2 = F (s0 )s−1 2 (mod r) and r until the
current remainder is approximately r. Write v for the resulting coefficient of u2 (in
the notation of Section 2.3 this is v = si which clashes horribly with the√notation of this
chapter). By part √ 6 of Lemma 2.3.3 it follows that √ v, vu2 (mod r) ≈ r. Also, write
u1 v ≡ w0 + w1 ⌈ r⌉ (mod r) with 0 ≤ w0 , w1 < r. Equation 22.6 can therefore be
written as
g w0 g1w1 hu2 v s−v
0 =1
√
All exponents in this 4-dimensional multi-exponentiation are of size roughly r. For
further details see Antipa et al [11]. A further improvement in [11] (assuming the public
key also contains a suitable power of h) leads to a 6-dimensional multi-exponentiation
with exponents of size r1/3 .
635
23.1.5: The proof proceeds almost identically to the previous case, except that when a
decryption query is made then only one call to the oracle is required. This variant is
studied in Section 10.4 of Cramer and Shoup [161].
23.1.7: Given a Hash-DH instance (g, g a , g b ), if one can compute g ab then one can
compute kdf(g ab ). Given a DDH instance (g, g a , g b , g c ) one can compute K = kdf(g c )
and, using an oracle for Hash-DH, distinguish it from kdf(g ab ).
23.2.2: For the first statement note that for each 0 ≤ z1 < r there is a unique choice
for z2 . The second statement is straightforward. For the final statement write g2 = g1w ,
′
h = g1v and u2 = g k with 0 ≤ k ′ < r and k ′ 6= k. The fact that (z1 , z2 ) ∈ Xg1 ,g2 ,h imposes
the linear equation z1 + wz2 ≡ v (mod r). To prove the result we need to show that one
can simultaneously solve kz1 + k ′ wz2 ≡ x (mod r) for any 0 ≤ x < r. The result follows
since the determinant of the matrix k1 kw ′
w is not zero modulo r.
23.2.7: First has v 6∈ G, second does not satisfy equation (23.1), third has message
m = 1.
23.2.11: The adversary returns eu1−z1 u2−z2 just as the Decrypt algorithm does.
23.2.12: Given a challenge ciphertext (u1 , u2 , e, v) compute u′1 = u1 g1 , u′2 = u2 g2 and
e = eh (these are g1k+1 , g2k+1 and mhk+1 respectively). Then compute α′ = H(u′1 , u′2 , e′ )
′
′ ′
and set v = (u′1 )x1 +y1 α (u′2 )x2 +y2 α . Calling the decryption oracle on (u′1 , u′2 , e′ , v ′ ) gives
m.
23.2.13: Let u1 be a random element of F∗p of order l. Set u2 = ua1 and v = ub1 for
random 1 ≤ a, b < l and choose any e ∈ F∗p . Call the decryption oracle on (u1 , u2 , e, v).
With probability 1/l the decryption oracle does not return ⊥, and indeed returns some
message m. One therefore has
r−z1 +a(r−z2 )
u1 = me−1 .
Since it is easy to compute the discrete logarithm of me−1 to the base u1 when l is small
one obtains a linear equation in z1 and z2 modulo l. Repeating the attack and solving
gives z1 (mod l) and z2 (mod l).
Q
If p − 1 has distinct small prime factors l1 , . . . , lt so that ti=1 li > r then, by repeating
the above attack, one can determine the private key uniquely using the Chinese remainder
theorem.
23.3.7: Just set c′2 = c2 ⊕ s for some non-zero string s ∈ {0, 1}l and query the
decryption oracle on (c1 , c′2 ) to get m ⊕ s.
23.3.8: Given Qid = H1 (id) set R = ψ(g)Qid . Invert the hash function to find an
identity id′ such that H1 (id′ ) = R. Then request the private key for identity id′ to receive
R′ = Rs = (ψ(g)Qid )s . One can obtain Q′id = Qsid as R′ ψ(g ′ )−1 .
23.3.10: If one can solve CDH in GT then compute z = e(Q, g), z1 = e(Q, g a ) = z a
and z2 = e(Q, g b ) = z b . Then the solution to the CDH instance (z, z1 , z2 ) is the required
value. The case of CDH in G2 is similar.
636 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
also similar to the discrete logarithm problem in an interval; see Exercise 13.3.6 and
Section 14.5 for algorithms to solve this problem in O(2k/2 ) multiplications.
Suppose a user’s public key consists of elements hi = uN 2
i (mod N ) for 1 ≤ i ≤ l
(i−1)/l
(where the ui are all random, or perhaps ui = u⌊N ⌋
(mod N 2 ) for a randomly chosen
1 < u < N ). To encrypt to the user one could compute c = (1 + N m)ha1 1 · · · hal l (mod N 2 )
using a sliding window multi-exponentiation method, where 0 ≤ a1 , . . . , al < 2k for some
value k (one possibility would be 2k ≈ N 1/l ).
24.3.11: One encrypts 0 ≤ m < N k as
k
c = (1 + mN )uN (mod N k+1 )
where 1 < u < N k is chosen randomly. Decryption requires some care since
λ(N )
cλ(N ) ≡ 1 + λ(N )mN + m2 N 2 + · · · (mod N k+1 ).
2
Hence, one first determines m (mod N ) from the coefficient λ(N )mN , and then m (mod N 2 )
from the coefficients of N and N 2 , and so on. This variant is not used in practice, since
messages are usually small for public key encryption.
24.3.12: Since (uN )p−1 ≡ 1 (mod p2 ) for any u ∈ (Z/N Z)∗ we have
Let G be the subgroup of (Z/N Z)∗ of order (p − 1)(q − 1) containing all p-th powers
in (Z/N Z)∗ . In other words, g 6∈ G. This subgroup is unique. Determining whether a
ciphertext c encrypts a message m is precisely determining whether cg −m ∈ G. Okamoto
and Uchiyama call this the p-subgroup problem.
Finally, suppose one has a decryption oracle for this scheme. Choose an integer x >
N 1/3 , compute c = g x (mod N ), and let m be the message returned by the decryption
oracle. Then m ≡ x (mod p) and so p = gcd(x − m, N ).
24.4.4: One uses the formula c(m−1 e e
1 ) ≡ m2 (mod N ) to obtain a time/memory
tradeoff. We refer to [82] for discussion of the success probability of this attack.
24.4.5: 535573983004, 7873538602921, 8149260569118, 3195403782370.
24.4.6: Either set F1 (x) = xe − c1 and F2 (x) = (ax + b)e − c2 as before, or reduce to
the previous case by multiplying c2 by a−e (mod N ).
24.4.7: To find m we construct the polynomials F1 (x) = x3 − c1 and F2 (x) = (x +
10 3
2 ) − c2 and compute their gcd as polynomials in the ring ZN [x]. The result is
G(x) = x − 1234567890
(P + x) ≡ (P + m)(P + y) (mod N ).
639
If r is known then one can determine p + q modulo r, and hence perform a similar attack
to Exercise 24.5.12 that will split N in O(N 1/4 /r) ring operations if p and q are of similar
size.
24.6.2: See Appendix A of Coron [149].
h
24.6.3: If ( N ) = −1 then set f = 2, otherwise f = 1. Then ( fNh ) = 1. Now, if
( fph ) = −1 then set e = −1, otherwise e = 1. It follows that ( efph ) = 1 and ( efqh ) = 1.
24.6.5: Use the fact that, for any 1 ≤ a < p, (a(p+1)/4 )2 ≡ ( ap )a (mod p).
24.6.13: If e | H2 (mks1 ) then one can compute the e-th root of H1 (id), which is the
private key of the user.
24.6.14: Generating a signature is the same as the original Shamir scheme. For the
selective forgery, suppose (s1 , s2 ) is a valid signature for identity id on a message m where
gcd(e, H2 (m)) = 1. Let m′ be the message to forge. There are integers a, b ∈ Z such that
640 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
ae − bH2 (m′ ) = −H2 (m). Set s′1 = sb1 and s′2 = s2 sa1 so that (s′1 , s′2 ) is a valid signature on
m′ .
H (m)
24.6.15: The signature is s = sid 2 (mod N ).
For the attack, suppose s1 and s2 are valid signatures for identity id on messages m1 and
m2 such that gcd(H2 (m1 ), H2 (m2 )) = 1. Let a, b ∈ Z be such that aH2 (m1 )+bH2 (m2 ) = 1.
Then e
sa1 sb2 ≡ H1 (id) (mod N )
and the user’s private key is obtained.
24.7.2: In the case where both top and bottom bits are 1 then let c′ = c2e (mod N ).
Depending on the precise sizes of N and r, the decryption oracle on c′ returns either
m′ = 2 + 4m + 2258 r + 23072 or m′ − N . Since N is odd it is easy to determine which
case has arisen and, in the latter case, one simply adds N back again. Solving for m is
immediate.
24.7.6: For the proof to go through it is necessary that κ1 > 2(κ + 2)/3 and n =
κ − κ0 − κ1 < κ/9. For full details see Boneh [74].
case being when q is prime and large) O(ℓ log(ℓ) log(q)) or O(M (ℓ log(ℓ))) bit operations.
We also need to multiply each coefficient by a suitable power of j(E). The total cost
is therefore O(ℓ2 (ℓ log(ℓ) log(q) + M (log(q))) bit operations. The resulting polynomial
requires O(ℓ log(q)) bits. The claim about root finding is immediate from Exercise 2.12.5.
25.2.3: The first statement follows since j(E) = j(E ′ ) and the Fq -rational ℓ-isogenies
are given by the roots of Φℓ (j(E), y). For the second statement, let φ : E → E ′ be the
isomorphism and consider the map EndFq (E) → EndFq (E ′ ) given by ψ 7→ φ ◦ ψ ◦ φ−1 .
One can check that this is a ring homomorphism and, since φ is an isomorphism, it is
surjective.
√ √ √
25.3.15: The eigenvalues are 3, 2, 1, 0, − 2, −2. We have λ(X) = 2 < 2 3 − 1 so
the graph is Ramanujan. We have δv ({1}) = {2, 4}, δv ({1, 2}) = {3, 4, 5} and δv ({1, 3}) =
{2, 4, 6}. The√expander property is easy√to verify. It also follows from equation (25.5)
and λ1 (X) = 2; giving #δv (A) ≥ (3 − 2)/6#A > 0.26#A.
25.3.16: Let n > 2/c be even and let X be the 2-regular “line” on n vertices (vertex
1 < i < n connected to vertex i − 1 and i + 1, and vertices 1 and n having single loops).
Let A = {1, . . . , n/2} so that #A = n/2 and c#A > 1 . But δv (A) = {n/2 + 1}.
25.3.18: We have h(−p) = 5 and ⌊p/12⌋ + 1 = 9, so there are nine isomorphism classes
of supersingular elliptic curves over Fp2 , five of which are defined over Fp .
Label the vertices of the graph as 24, 80, 23, 69, 34, α, α, β and β. The values α and
α are the roots of t2 + 84t + 73, while β and β are roots of t2 + 63t + 69. The graph is
3-regular. Vertices 24 and 80 have two loops, and an edge to 23. Vertex 23 has an edge
to 69. Vertex 69 has a loop and an edge to 34. Vertex 34 has edges to α and α. Vertex
α has edges to α and β. Vertex α has edges to α and β. Finally, vertex β has two edges
to β.
25.3.19: The graph has ⌊p/12⌋ + 1 = 2 vertices. So the vertices are j = 0 and
j = 1728 ≡ 1 (mod 11). Using the modular polynomial Φ2 (x, y) one finds there are three
edges from 0 to 1 and two edges from 1 to 0 (and a loop from 1 to itself). Hence, at least
two of the three isogenies from 0 to 1 have the same dual isogeny.
25.3.20: Take p = 131. There are 10 supersingular j-invariants in Fp . Taking 2-
isogenies gives two components: one containing the j-invariants {25, 82} and the other
with {0, 10, 28, 31, 50, 62, 94, 113}.
25.4.9: The graph has two components. Both are trees with a root and 4 leaves. One
component has root 42 and leaves 33, 51, 35, 57. The other component has root 14 and
leaves 44, 4, 18, 32. The diameter of XE,Fq ,{2,3} is 2.
25.4.10: Clearly, j = 11
√ and j = 31 are on the floor.√ It follows that End(E) is the
order of index 2 in Z[(1 + −7)/2]. Hence, End(E) ∼= Z[ −7].
Since the isogenies from j = 10 to 11 and 31 are descending it follows that the
ascending isogeny is to j = 29 and so this curve is on the surface.
25.5.2: The solution to the isogeny problem is a chain of length O(log(q)) of prime-
degree isogenies. Assuming that the chain is represented as a sequence of j-invariants, the
cost of the Elkies and Vélu steps is O(ℓ2+ǫ log(q)1+ǫ ) bit operations. Since ℓ = O(log(q)m )
the cost for each isogeny is bounded by O(ℓ2m+1+ǫ ) bit operations. The total cost is
therefore O(ℓ2m+2+ǫ ) bit operations.
25.5.3: Dijsktra’s algorithm has complexity linear in the number of vertices, so it needs
√
more than q operations to find the chain. The advantage is that the isogeny itself can
be computed faster, but probably only by a constant factor.
642 APPENDIX B. HINTS AND SOLUTIONS TO EXERCISES
(this is essentially the same argument as in equation (26.5)). The additive property follows
from the fact that the divisor of a product is the sum of the divisors. The multiplicative
property follows from the additive property and from part 3.
26.5.3: Given P, [a]P, [b]P choose a point Q such that e(P, Q) 6= 1 and one can invert
pairings with respect to that point Q. Compute z = e(P, Q)ab as in Lemma 26.5.2, then
call the pairing inversion oracle on (Q, z) to get [ab]P .