Reconstructing noisy polynomial evaluation in residue rings

13
ARTICLE IN PRESS UNCORRECTED PROOF S0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.1 (1-13) YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 1 Journal of Algorithms ••• (••••) •••••• www.elsevier.com/locate/jalgor 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 Reconstructing noisy polynomial evaluation in residue rings Simon R. Blackburn a , Domingo Gomez-Perez b , Jaime Gutierrez b,, Igor E. Shparlinski c a Department of Mathematics, Royal Holloway, University of London, Egham, Surrey, TW20 0EX, UK b Faculty of Science, University of Cantabria, E-39071 Santander, Spain c Department of Computing, Macquarie University, Sydney, NSW 2109, Australia Received 9 September 2004 Abstract Let q> 1 be an integer and let a and b be elements of the residue ring Z q of integers modulo q . We show how, when given a polynomial f Z q [X] and approximations to v 0 ,v 1 Z q such that v 1 f (v 0 ) mod q one can recover v 0 and v 1 efficiently. This result has direct applications to predicting the polynomial congruential generator: a sequence (v n ) of pseudorandom numbers defined by the relation v n+1 f (v n ) mod q for some polynomial f Z q [X]. The applications lead to analogues of results known for the linear congruential generator x n+1 ax n + b mod q , although the results are much more restrictive due to nonlinearity of the problem. 2004 Published by Elsevier Inc. Keywords: Noisy interpolation; Lattice basis reduction; Polynomial congruences; Predicting pseudorandom generators * Corresponding author. E-mail addresses: [email protected] (S.R. Blackburn), [email protected] (D. Gomez-Perez), [email protected] (J. Gutierrez), [email protected] (I.E. Shparlinski). 0196-6774/$ – see front matter 2004 Published by Elsevier Inc. doi:10.1016/j.jalgor.2004.07.002

Transcript of Reconstructing noisy polynomial evaluation in residue rings

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.1 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 1

r

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43

44

45

K

ingtheess

OR

RE

CTE

D P

RO

OF

Journal of Algorithms••• (••••) •••–•••www.elsevier.com/locate/jalgo

Reconstructing noisy polynomial evaluationin residue rings

Simon R. Blackburna, Domingo Gomez-Perezb, Jaime Gutierrezb,∗,Igor E. Shparlinskic

a Department of Mathematics, Royal Holloway, University of London, Egham, Surrey, TW20 0EX, Ub Faculty of Science, Universityof Cantabria, E-39071 Santander, Spain

c Department of Computing, Macquarie University, Sydney, NSW 2109, Australia

Received 9 September 2004

Abstract

Letq > 1 be an integer and leta andb be elements of the residue ringZq of integers moduloq. Weshow how, when given a polynomialf ∈ Zq[X] and approximations tov0, v1 ∈ Zq such thatv1 ≡f (v0) modq one can recoverv0 andv1 efficiently. This result has direct applications to predictthe polynomial congruential generator: a sequence(vn) of pseudorandom numbers defined byrelationvn+1 ≡ f (vn) modq for some polynomialf ∈ Zq [X]. The applications lead to analoguof results known for the linear congruential generatorxn+1 ≡ axn + b modq, although the resultare much more restrictive due to nonlinearity of the problem. 2004 Published by Elsevier Inc.

Keywords:Noisy interpolation; Lattice basis reduction; Polynomial congruences; Predicting pseudorandomgenerators

* Corresponding author.E-mail addresses:[email protected] (S.R. Blackburn), [email protected] (D. Gomez-Perez),

[email protected] (J. Gutierrez), [email protected] (I.E. Shparlinski).

UN

C 43

44

450196-6774/$ – see front matter 2004 Published by Elsevier Inc.doi:10.1016/j.jalgor.2004.07.002

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.2 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 2

2 S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–•••

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

e,re

l

oblemnomial

tial

rop-raphic

tor as a

move

mialfen

tor isu-w

nalt.

10,15,en con-

given

CO

RR

EC

TE

D P

RO

OF

1. Introduction

For an integerq > 1 we denote byZq the residue ring of integers moduloq . We alwaysrepresent the residue classes fromZq by elements of the set{0,1, . . . , q −1}. As usual, wedenote byZ∗

q the set of invertible elements ofZq .Accordingly, for a primep, we denote byFp

∼= Zp the field ofp elements and as beforwe assume that it is represented by the set{0,1, . . . , p−1}. In particular, sometimes, wheobvious, we treat elements ofZq andFp as integers in the above range.

Here we consider thenoisy polynomial evaluation problemin Zq : given a polynomiaf (X) ∈ Zq [X] and approximations tov0, v1 ∈ Zq , wherev1 ≡ f (v0) modq , recoverv0andv1. By an approximation to an integervi , we mean an integerwi such that|wi − vi | issmall.

The question has applications to, and has been motivated by, the predictability prfor nonlinear pseudorandom number generators. To be more precise, given a polyf (X) ∈ Zq [X], we define thepolynomial congruential generatorto be a sequence(vn) ofelements ofZq satisfying the recurrence relation

vn+1 ≡ f (vn) modq, n = 0,1, . . . , (1)

wherev0 is the initial value. If degf = m then we say that the polynomial congruengenerator isof degreem.

This generator exhibits very attractive uniformity of distribution and nonlinearity perties, see [26,27] for surveys or recent results. Here we study some of its cryptogproperties, namely the question of so-calledpredictabilityof such generators.

In the cryptographic setting, the initial valuev0 (and sometimes the polynomialf andthe modulusq) is assumed to be secret, and we want to use the output of the generastream cipher. In this setting, we output only the most significant bits of eachvn in the hopethat this makes the resulting output sequence difficult to predict. (Note that if we rethek least significant bits of eachvn, an evesdropper may easily find integerswn such that|wn − vn| � 2k−1 by examining the output. This is the connection to the noisy polynoevaluation problem.) The main result of this paper may be interpreted as saying that if

andq are public, and if too many bits of the elementsvn are output at each stage, ththe generator becomes insecure because the elementsvn may be efficiently recovered fromthe output. Slightly more precisely, we show that the polynomial congruential generapolynomial time (in logq and degf ) predictable if sufficiently many bits of its consective elements are revealed (even if the degreeof the generator is allowed to slowly grotogether with the size of the modulusq). Our results exclude a small set of polynomialsf ,and a small set of starting valuesv0: see Theorems 4 and 5 for the details. In the fisection of the paper, we discuss the case when the polynomialf forms part of the secrekey, and show that the unique recovery of the elementsvn from the output is not possible

For thelinear congruential generator

xn+1 ≡ axn + b modq, n = 0,1, . . . , (2)

similar problems have been introduced by Knuth [18] and then considered in [5,6,20]; see also surveys [7,21]. We remark that predicting nonlinear generators has besidered in some of these works as well, however only in the case when all terms are

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.3 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 3

S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–••• 3

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

n, has

ettices

e prob-mialy Cop-nown.omials

hult-

ectorthat

ing as a, and

ts.ly-s and

an

CO

RR

EC

TE

D P

RO

OF

in full. Thus the case we consider here, when only some bits of the output are givenot previously been studied for nonlinear generators.

Several nonlinear generators have recently been studied in [3,4]. Here, as in [3,4], wuse some lattice algorithms. However, in contrast to [3,4], the dimension of our lagrows as degf grows, and thus slightly different tools need to be applied.

In some sense the problem we solve can be considered as a special case of thlem of finding small solutions of multivariate polynomial congruences. For polynocongruences in one variable, an algorithm for solving this problem has been given bpersmith [8], see also [9,13]. However, in the general case only heuristic results are kHere we are able to obtain rigorous results, due to the special structure of the polyninvolved.

Throughout the paper, the constants in the ‘O ’-notation are absolute.

2. Preliminaries

2.1. Background on lattices

Here we review several related results and definitions concerning lattices, all of whiccan be found in [11]. For more details and more recent references, we recommend consing [15,16,23–25].

Let {b1, . . . ,bs} be a set of linearly independent vectors inRr . The set

L = {z: z = c1b1 + · · · + csbs , c1, . . . , cs ∈ Z}is called ans-dimensional latticewith basis{b1, . . . ,bs}. If s = r, the latticeL is of fullrank.

One basic lattice problem is theshortest vector problem: given a basis of a latticeL inR

s , find a nonzero lattice vectorf ∈ L which minimises the Euclidean norm‖f‖ among alllattice vectors. Unfortunately, there are several indications that this problem isNP-com-plete (when the dimension grows). In particular, it is shown in [1] that the shortest vproblem isNP-hard under randomized reductions, and so it is now widely believedthere is no polynomial time algorithm to solve SVP. For a slightly weaker task of findshort vector, the celebratedLLL algorithmof Lenstra, Lenstra and Lovász [22] providedesirable solution. We however use a slightly stronger result which follows from [28]which we state as Lemma 1.

We always assume that the basis ofL consists of vectors with rational componenThus a polynomial time algorithm forL means an algorithm whose running time is ponomial in the total number of bits required for binary representation of numeratordenominators of all components of the basis.

Lemma 1. There exists a deterministic polynomial time algorithm which, when givens-dimensional full rank latticeL, finds a nonzero lattice vectorf ∈L satisfying the inequality

‖f‖ � λs min{‖z‖: z ∈ L, z �= 0

},

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.4 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 4

4 S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–•••

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

lattice(which

ly-

di-

omial

a

bound

e

-

CO

RR

EC

TE

D P

RO

OF

where

λs = exp

(O

(s(log logs)2

logs

)).

Many other results on both exact and approximate finding of a shortest vector in aare discussed in [11,15,16,23–25]; see also [2] for the most recent developmentshowever lead to probabilistic algorithms).

In fact, in this paper we consider only very special lattices. Namely, we consider onlattices which consist of integer solutionsx = (x0, . . . , xs−1) ∈ Z

s of the system of congruences

s−1∑i=0

aij xi ≡ 0 modqi, j = 1, . . . , �,

modulo some integersq1, . . . , q�. The lattices we consider are full rank lattices ofmensions. All the aforementioned algorithms become polynomial in log(q1 · · ·q�) whenapplied to such lattices.

2.2. Polynomial congruences

Our second basic tool is an upper bound on the number of solutions of polyncongruences.

For congruences modulo a prime we can use theLagrange theoremwhich asserts thatnonzero polynomial of degrees over any field has no more thans zeros in this field.

However for congruences modulo composite numbers we apply an upperfrom [19].

For a polynomial

F(X) =s∑

i=0

AiXi ∈ Z[X] (3)

of degrees and an integerQ � 1 we denote byT (F,Q) the number of solutions of thcongruence

F(x) ≡ 0 modQ, x ∈ ZQ.

We now defineNs(Q) as the largest possible value ofT (F,Q) taken over all polynomials (3) with gcd(A0, . . . ,As,Q) = 1. (Note that there is no restriction onA0.)

The following bound is a relaxed form of the main result of [19].

Lemma 2. The bound

Ns(Q) = O(sQ1−1/s

)holds.

Writing F(X) = DG(X) with D = gcd(A0, . . . ,As,Q) and G(X) ∈ Z[X], we alsohave thatT (F,Q) � DNs(Q/D) for any polynomial (3), so

T (F,Q) = O(sQ1−1/sD1/s

). (4)

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.5 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 5

S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–••• 5

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

a-undereden-

e mostbovef the

ues

CO

RR

EC

TE

D P

RO

OF

We apply the Lagrange theorem and Lemma2 to some families of polynomials parmetrised by small vectors in a certain lattice, thus the size of the family can be keptcontrol. Zeros of these polynomials correspond to potentially “bad” initial values of thpolynomial congruential generator (1). Thus, if all polynomials in this family are not itical to zero moduloq (or to be more precise, have a not too large value ofD in (4))then we have an upper bound on the number of such “bad” initial values. Hence, thcrucial part of our approach is to study possible vanishing of polynomials in the afamily and to show that this may happen only for very few values of the coefficients ogenerator (1).

2.3. Residues of small-height fractions

Some exceptional sets of parameters in our results can be described as sets of residof fractions with bounded numerator and denominator. Namely, letF(q,R,S) be the setof a ∈ Z

∗q that satisfy a congruence of the formar ≡ s modq for some integersr ands,

not both zero moduloq , where|r| � R and|s| � S.As usual, we useσ(q) to denote the sum of divisors ofq .

Lemma 3. For any1 � R,S < q , the bound

#F(q,R,S) � 4RSσ(q)

q

holds.

Proof. For everya ∈ Z∗q , the congruencear ≡ s modq implies

gcd(r, q) | gcd(s, q).

We count the elements ofF(q,R,S) by first choosing a divisord < q of q , then choosingr ands such that|r| � R, |s| � S, gcd(r, q) = d andd | s, and finally choosinga suchthatar ≡ s modq . Note that onced is chosen, there are at most 2R/d choices forr and atmost 2S/d choices fors (because 1� R,S < q we see thatrs �= 0). Moreover, oncer ands such that gcd(r, q) = d are fixed, there are at mostd choices fora. Hence

#F(q,R,S) �∑d |q

2R

d· 2S

d· d � 4RS

∑d |q

1

d= 4RS

σ(q)

q

which finishes the proof. �Recall that

σ(q) = O(q log logq),

see [12, Theorem 323]. In particular,

#F(q,R,S) = O(RS log logq).

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.6 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 6

6 S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–•••

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

d

nyizelyd

CO

RR

EC

TE

D P

RO

OF

3. Main results

3.1. Predicting the polynomial generator modulo an arbitrary integer

Let ∆ be a positive integer. We say an integerw is a∆-approximationto an integerv if|w − v| � ∆.

Recall that we useσ(q) to denote the sum of the divisors of an integerq , and we defineλs to be the “stretch” factorλs given in Lemma 1.

We are now ready to state the main theorem of the paper.

Theorem 4. There exists an algorithm with the following properties. Letq and∆ be inte-gers such thatq > ∆ � 1 andgcd(q,∆) = 1. Let

f (X) =m∑

i=0

aiXi ∈ Zq [X]

be a polynomial of degreem � 2 overZq whose leading coefficientam lies inZ∗q\Am(q,∆),

for some setAm(q,∆) of cardinality at most

16(m + 2)λ2m+2∆

m+1σ(q)

q.

The algorithm, when givenf and ∆-approximationsw0, w1 to v0, v1 where v1 ≡f (v0) modq , recoversv0, v1 in time polynomial inm and logq provided thatv0 doesnot lie in a certain setV(f ) ⊆ Zq of cardinality#V(f ) = O((2∆)ϑmq1−1/(m−1)), where

ϑm = m3 + 3m − 2

2(m − 1).

Proof. We may assume that

q > 2m+1√

m + 2λm+2∆m−1 and q > ∆m (5)

for if either of these inequalities fail to hold the result is trivially true (by examining bounon the cardinality of the setAm(q,∆)).

We define the setAm(q,∆) = F(q,R,S), with R = 2√

m + 2λm+2∆m and S =

2√

m + 2λm+2∆, whereF(q,R,S) is defined in Section 2.3. By (5) we see thatR <

S < q . Now the bound on #Am(q,∆) is immediate by Lemma 3.An outline of the algorithm is as follows. The algorithm first constructs a latticeL from

the information it is given. This lattice has a short nonzero vectore which may be usedto derivev0 andv1 from w0 andw1. The latticeL has the additional property that areasonably short vector inL is parallel toe. It is also important to observe that the bit-sof all coordinates of the basis vectors ofL is O(logq). The algorithm finds a reasonabshort nonzero vectorf ∈ L by using the techniques of Lemma 1. It is then easy to fineand hencev0 andv1.

Let εj = vj − wj , j = 0,1. Then we have

w1 + ε1 ≡m∑

ai(w0 + ε0)i modq.

UNi=0

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.7 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 7

S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–••• 7

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

it is

y

CO

RR

EC

TE

D P

RO

OF

If we expand the right hand side of this equation in terms of powers ofε0 using Taylor’sformula, and then introduce various powers of∆ that cancel each other, we obtain

A∆m + B∆m−1ε1 +m∑

i=1

Ci∆m−i εi

0 ≡ 0 modq,

where

A ≡ (f (w0) − w1

)∆−m modq,

B ≡ −∆−m+1 modq,

Ci ≡ f (i)(w0)

i! ∆−m+i modq, i = 1, . . . ,m,

andf (i) denotes theith derivative off .Let L be the lattice consisting of integer solutionsx = (x0, . . . , xm+1) ∈ Z

m+2 of thesystem of congruences:

Ax0 + Bx1 +m∑

i=1

Cixi+1 ≡ 0 modq,

x0 ≡ 0 mod∆m,

x1 ≡ 0 mod∆m−1,

xi+2 ≡ 0 mod∆m−i−1, i = 0, . . . ,m − 1.

(6)

Note thatL can be computed from the information given to the algorithm and in facteasy to see that it is a simple linear algebra problem to compute a basis ofL whose basisvectors consist of elements of bit-sizeO(logq).

Clearly,L contains the nonzero vector

e = (∆m,∆m−1ε1,∆

m−1ε0, . . . ,∆m−i εi

0, . . . , εm0

)= (

∆me0,∆m−1e1,∆

m−1e2, . . . ,∆m−i+1ei, . . . , em+1

).

We have

e0 = 1, |e1| � ∆, |ei | � ∆i−1, i = 2, . . . ,m + 1.

Since∆ � 2 andm � 2, we see that the Euclidean norm‖e‖ of e satisfies the inequalit

‖e‖ �√

(m + 2)∆2m = √m + 2∆m.

The algorithm of Lemma 1 applied to the latticeL returns a nonzero vector

f = (∆mf0,∆

m−1f1,∆m−1f2, . . . ,∆

m−i+1fi, . . . , fm+1) ∈ L

such that‖f‖ � λm+2‖e‖ �√

m + 2λm+2∆m. In particular, we have the inequalities

|f0| �√

m + 2λm+2, |f1| �√

m + 2λm+2∆,

|fi | �√

m + 2λm+2∆i−1, i = 2, . . . ,m + 1.

We aim to show thatf is parallel toe, provided thatv0 does not lie in a setV(f ) which wedefine below.

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.8 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 8

8 S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–•••

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

ence

ll

CO

RR

EC

TE

D P

RO

OF

The vectorf0e − e0f ∈ L has first component zero, and so using the first congruin (6) we obtain

B∆m−1d1 +m∑

i=1

Ci∆m−idi+1 ≡ 0 modq,

wheredi = f0ei − e0fi = f0ei − fi , i = 1, . . . ,m + 1. Hence

|d1| � 2√

m + 2λm+2∆,

|di| � 2√

m + 2λm+2∆i−1, i = 2, . . . ,m + 1.

(7)

Using the definitions ofB andC1, . . . ,Cm (and the fact thatCm is equal to the leadingcoefficientam of f (X)) we have

m−1∑i=1

f (i)(w0)

i! di+1 ≡ d1 − amdm+1 modq. (8)

We remark that ifd2 ≡ · · · ≡ dm ≡ 0 modq , then (8) implies thatd1 ≡ amdm+1 modq .Recalling thatam ∈ Z

∗q\Am(q,∆) we then derive thatd1 ≡ dm+1 ≡ 0 modq . Taking into

account the bound (7) we conclude that in this casedi = 0, i = 1, . . . ,m + 1. Hencef0e −e0f = 0, and sof ande are parallel. Hence we may assume that one ofd2, d3, . . . , dm isnonzero moduloq .

Substitutingw0 = v0 − ε0 in the congruence (8), we obtain the congruence

F(v0) ≡ α0 modq, (9)

where

F(X) =m−1∑i=1

αiXi

andαi , i = 0, . . . ,m − 1, are polynomials inε0, d1, . . . , dm+1. We place any solutionv0

to (9) for any possible values ofd1, . . . , dm+1 andε0 into the setV(f ). Thuse andf areparallel, so long asv0 /∈ V(f ). We need to show that the cardinality ofV(f ) is as claimedin the statement of the theorem.

We defineν by the conditionsd2 = · · · = dν = 0,dν+1 �= 0. We are assuming that not aof d2, . . . , dm are zero, and soν � m − 1. ThenF is of degree degF = degf (ν) = m − ν

and the leading coefficient ofF is

αm−ν =(

m

ν

)amdν+1.

Note that this coefficient is nonzero moduloq sinceam ∈ Z∗q and that by (7)

∣∣∣∣(

m

ν

)dν+1

∣∣∣∣ � 2mdν+1 � 2m+1√

m + 2λm+2∆ν < q

by our assumption (5). Moreover we see that

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.9 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 9

S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–••• 9

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

he

r

CO

RR

EC

TE

D P

RO

OF

gcd(α1, . . . , αm−1, q) � gcd(αm−ν , q) = gcd

((m

ν

)dν+1, q

)

�∣∣∣∣(

m

ν

)dν+1

∣∣∣∣ � 2m+1√

m + 2λm+2∆ν.

Thus by (4) we see that each congruence (9) can be satisfied by at most

O((m − ν)q1−1/(m−ν)

(2m+1

√m + 2λm+2∆

ν)1/(m−ν))

valuesv0. Note that, for 1� ν � m − 1,

(m − ν)q1−1/(m−ν)(2m+1

√m + 2λm+2∆

ν)1/(m−ν)

= O(m2mλm+2q

1−1/(m−ν)∆ν/(m−ν))

= O(m2mλm+2q∆−1(∆m/q

)1/(m−ν))= O

(m2mλm+2q∆−1(∆m/q

)1/(m−1)),

where the last equality follows from (5).Thus we have placed at mostO(m2mλm+2q

1−1/(m−1)∆1/(m−1)) values ofv0 in V(f )

for each choice ofε0, d1, . . . , dm+1. By (7) the total number of possible choices for tintegersdi , i = 1, . . . ,m + 1, is at most

(4√

m + 2λm+2∆ + 1)m+1∏

i=2

(4√

m + 2λm+2∆i−1 + 1

)

<(5√

m + 2λm+2)m+1

∆m(m+1)/2+1

and the total number of possible choices forε0 is at most 2∆ + 1. Thus the total numbeof values ofv0 that we have placed inV(f ) is

O(m

(10

√m + 2λm+2

)m+2q1−1/(m−1)∆m(m+1)/2+2+1/(m−1)

)= O

((2∆)ϑmq1−1/(m−1)

),

where

ϑm = m(m + 1)

2+ 2+ 1

m − 1= m3 + 3m − 2

2(m − 1).

We have shown thate and f are always parallel, for otherwisev0 would lie in the setV(f ) of values which we have excluded. Sincee0 = 1, we find thate = f/f0 and thus thealgorithm may now recovere from f. Obviously, given the third component∆m−1ε0 of ethe algorithm can findv0. This completes the proof.�3.2. Predicting the polynomial generator modulo a prime

Let p be a prime. Let∆ andm be integers such thatp � ∆ � 1 andm � 2. We also usethe notion of a∆-approximation given in Section 3.1.

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.10 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 10

10 S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–•••

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

that

alcu-ons

-prime)o-

nting

covery

CO

RR

EC

TE

D P

RO

OF

Theorem 5. There exists an algorithm with the following property. Letp be a prime num-ber, and let∆ be an integer such thatp > ∆ � 1. Let

f (X) =m∑

i=0

aiXi ∈ Fp[X]

be a polynomial of degreem � 2 overFp whose leading coefficientam lies inF∗p\Am(p,∆)

for some setAm(p,∆) of cardinality

#Am(p,∆) < 17λ2m+2(m + 2)∆m+1.

Then the algorithm, when givenf and ∆-approximationsw0,w1 to v0, v1 wherev1 ≡f (v0) modp, recoversv0, v1 in time polynomial inm and logp provided thatv0 does notlie in a certain setV(f ) ⊆ Fp of cardinality#V(f ) = O((2∆)m(m+1)/2+2).

Proof. The proof of this theorem is almost identical to that of Theorem 4.In particular, we defineAm(p,∆) = F(p,R,S) whereR = 2

√m + 2λm+2∆

m, S =2√

m + 2λm+2∆ andF(p,R,S) is defined as in Section 2.3. Again, we can assume2√

m + 2λm+2∆m < p, and also thatp � 17, so thatσ(p)/p = (p + 1)/p < 17/16. Now

the bound on #Am(p,∆) follows from Lemma 3.The only other place where the proof differs from that of Theorem 4 is when we c

late the cardinality of the setV(f ); so we need to count the number of possible solutito congruences of the form

F(v0) ≡ α0 modp, (10)

where

F(X) =m−1∑i=1

αiXi

andαi , i = 0, . . . ,m−1, are polynomials inε0, d1, . . . , dm+1. Just as in the proof of Theorem 4, all these congruences are nontrivial, and so (since we are working modulo aeach instance of (10) has at mostm − 1 solutions. Moreover, as in the proof of Therem 4 we see by (7) that there are at most(5

√m + 2λm+2)

m+1∆m(m+1)/2+1 possibilitiesfor d1, . . . , dm+1 and at most 2∆ + 1 possibilities forε0 and hence at most

(m − 1)(2∆ + 1)(5√

m + 2λm+2)m+1

∆m(m+1)/2+1 = O((2∆)m(m+1)/2+2)

solutions to a congruence of the form (10). The proof of Theorem 4, with this couargument changed, now suffices to prove Theorem 5.�

4. Remarks and open questions

It would be very natural to study the case when the polynomialf is not known andforms a part of the secret key. However, we observe that in this case the unique re

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.11 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 11

S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–••• 11

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

-

a-

ients;ca-ue

er-edence

equen-an

nysost

tore

ular

e

CO

RR

EC

TE

D P

RO

OF

of v0 (andf ) is not possible. Indeed, it is easy to see that given any numberk of ‘appro-ximations’ wj , which are actually the exact valueswj = vj , j = 0, . . . , k − 1, and anintegerh, each of the sequences,

v(h)0 = v0 − h and v

(h)j ≡ fh

(v

(h)j−1

)modq, j = 1, . . . , k − 1,

wherefh(X) = f (X + h) − h satisfiesv(h)j = vj − h. Therefore, for any integerh with

|h| � ∆ we have|wj − v(h)j | � ∆. Thus each of the sequencesv

(h)j−1 (and each polyno

mial fh) may give rise to the same sequence of approximationswj . We remark that thisargument works for any familyF of functions which is closed under the transformtion f (X) → f (X + h) − h. The fact that the family of functionsfa,b(X) = aX−1 + b

does not satisfy this property explains why theinversive congruential generator, un+1 ≡au−1

n + b modq , can be completely recovered even in the case of unknown coefficsee [3,4] for the case whereq = p is prime. On the other hand, in cryptographic applitions we do not need to completely recoverv0 andf : we merely need to be able to continto generate the sequence of “approximations”wj (formed, say, by taking the� > 0 mostsignificant bits ofvj , that iswj = 2�2−�vj �). In the case of the linear congruential genator (2), that is, for the family of functionsf (X) = aX + b, this issue has been discussin Section 3 of [10]. In particular it has been noted in [10] that the difference sequyn = xn+1 − xn satisfies the homogeneous relations

yn+1 ≡ ayn (modq), n = 0,1, . . . ,

and can be recovered, which can then be used for finding approximations to the scexn. However, for nonlinear functionsf this method no longer applies, and findinganalogous method (even a heuristic one) remains an open problem.

In Theorem 4 we have the technical condition that gcd(∆,q) = 1. This condition isneeded to be able to define the coefficientsA,B,C1, . . . ,Cm. However, the condition israther an artificial one: the value∆ in the algorithm of Theorem 4 may be replaced by aslightly larger value∆0 without significantly altering the algorithm’s performance, andwe may ensure that gcd(∆0, q) = 1. For example,∆0 can be chosen to be the smalleprime number which is greater than∆ and does not divideq . Becauseq has at mosO(logq/ log logq) prime divisors this would lead to only slightly weaker estimates. Mprecisely, the largest distanceJ (q) between two integers relatively prime toq is calledthe Jacobsthal functionand has been extensively studied in the literature, in particJ (q) = O((logq)2), see [14].

We have not used the full power of the bound onλs in Lemma 1. However using thoriginal estimateλs � 2(s−1)/2 of [22] would force us to replace 2∆ in our bounds onAm(p,∆) andV(f ) in Sections 3.1 and 3.2 with a slightly larger multiple of∆.

Uncited references

[17]

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.12 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 12

12 S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–•••

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32

33 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45

is pa-byrtedsup-

33rd

tor, in:8,

er

141.ol-

ss,

p-

nd

ariables

9.

g,

5–

2.2

in

1

CO

RR

EC

TE

D P

RO

OF

Acknowledgments

The authors thank Harald Niederreiter for his interest and helpful discussions. Thper was written during visits of I. Shparlinski to the University of Cantabria (supportedMECD grant SAB2000-0260) and to Royal Holloway, University of London (suppoby an EPSRC Visiting Fellowship). D. Gomez-Perez and J. Guitierrez were partiallyported by Spanish Ministry of Science grant BFM2001-1294. The support and hospitalityof all these organisations are gratefully acknowledged.

References

[1] M. Ajtai, The shortest vector problem inL2 is NP-hard for randomized reductions, in: Proc. 30th ACMSymposium on Theory of Computing, ACM, 1998, pp. 10–19.

[2] M. Ajtai, R. Kumar, D. Sivakumar, A sieve algorithm for the shortest lattice vector problem, in: Proc.ACM Symposium on Theory of Computing, ACM, 2001, pp. 601–610.

[3] S.R. Blackburn, D. Gomez-Perez, J. Gutierrez, I.E. Shparlinski, Predicting the inversive generaProc. 9th IMA Internat. Conf. on Cryptography and Coding, in: Lecture Notes in Comput. Sci., vol. 289Springer-Verlag, Berlin, 2003, pp. 264–275.

[4] S.R. Blackburn, D. Gomez-Perez, J. Gutierrez, I.E.Shparlinski, Predictingnonlinear pseudorandom numbgenerators, Math. Comp., in press.

[5] J. Boyar, Inferring sequences produced by pseudo-random number generators, J. ACM 36 (1989) 129–[6] J. Boyar, Inferring sequences produces by a linear congruential generator missing low-order bits, J. Crypt

ogy 1 (1989) 177–184.[7] E.F. Brickell, A.M. Odlyzko, Cryptanalysis: a survey of recent results, in: Contemp. Cryptology, IEEE Pre

New York, 1992, pp. 501–540.[8] D. Coppersmith, Small solutions to polynomial equations, and low exponent RSA vulnerabilities, J. Cry

tology 10 (1997) 233–260.[9] D. Coppersmith, Small solutions of small degree polynomials, in: Proc. Internat. Conf. on Cryptography a

Lattices, in: Lecture Notes in Comput. Sci., vol. 2146, Springer-Verlag, Berlin, 2001, pp. 20–31.[10] A.M. Frieze, J. Håstad, R. Kannan, J.C. Lagarias, A. Shamir, Reconstructing truncated integer v

satisfying linear congruences, SIAM J. Comput. 17 (1988) 262–280.[11] M. Grötschel, L. Lovász, A. Schrijver, GeometricAlgorithms and Combinatorial Optimization, Springer-

Verlag, Berlin, 1993.[12] G.H. Hardy, E.M. Wright, An Introduction to the Theory of Numbers, Oxford Univ. Press, Oxford, 197[13] N.A. Howgrave-Graham, Finding small roots of univariate modularequations revisited, in: Proc. 6th IMA

Internat. Conf. on Cryptography and Coding, in: Lecture Notes in Comput. Sci., vol. 1355, Springer-VerlaBerlin, 1997, pp. 131–142.

[14] H. Iwaniec, On the problem of Jacobsthal, Demonstratio Math. 11 (1978) 225–231.[15] A. Joux, J. Stern, Lattice reduction: a toolboxfor the cryptanalyst, J. Cryptology 11 (1998) 161–185.[16] R. Kannan, Algorithmic geometry of numbers, Ann. Review Comput. Sci. 2 (1987) 231–267.[17] R. Kannan, Minkowski’s convex body theorem andinteger programming, Math. Oper. Res. 12 (1987) 41

440.[18] D.E. Knuth, Deciphering a linear congruential encryption, IEEE Trans. Inform. Theory 31 (1985) 49–5[19] S.V. Konyagin, On the number of solutions of an univariate congruence ofnth degree, Matem. Sbornik 10

(1979) 171–187 (in Russian).[20] H. Krawczyk, How to predict congruential generators, J. Algorithms 13 (1992) 527–545.[21] J.C. Lagarias, Pseudorandom number generators in cryptography and number theory, in: Proc. Symp.

Appl. Math., vol. 42, Amer. Math. Soc., Providence, RI, 1990, pp. 115–143.[22] A.K. Lenstra, H.W. Lenstra, L. Lovász, Factoring polynomials with rational coefficients, Math. Ann. 26

(1982) 515–534.[23] D. Micciancio, S. Goldwasser, Complexity of Lattice Problems, Kluwer Acad. Publ., 2002.

UN

ARTICLE IN PRESSS0196-6774(04)00115-4/FLA AID:1388 Vol.•••(•••) [DTD5] P.13 (1-13)YJAGM:m1 v 1.20 Prn:6/08/2004; 8:28 yjagm1388 by:JOlanta p. 13

S.R. Blackburn et al. / Journal of Algorithms••• (••••) •••–••• 13

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

Al-0,

nd

era-2,

.ci.,

87)

F

[24] P.Q. Nguyen, J. Stern, Lattice reduction in cryptology: an update, in: Proc. 4th Internat. Symp. ongorithmic Number Theory, in: Lecture Notes in Comput. Sci., vol. 1838, Springer-Verlag, Berlin, 200pp. 85–112.

[25] P.Q. Nguyen, J. Stern, The two faces of lattices in cryptology, in: Proc. Internat. Conf. on Cryptography aLattices, in: Lecture Notes in Comput. Sci., vol. 2146, Springer-Verlag, Berlin, 2001, pp. 146–180.

[26] H. Niederreiter, I.E. Shparlinski, Recent advances in the theory of nonlinear pseudorandom number gentors, in: Proc. Conf. on Monte Carlo and Quasi-Monte Carlo Methods, 2000, Springer-Verlag, Berlin, 200pp. 86–102.

[27] H. Niederreiter, I.E. Shparlinski, Dynamical systems generated by rational functions, in: Proc. 15th Sympon Appl. Algebra, Algebraic Algorithms, and Error-Correcting Codes, in: Lecture Notes in Comput. Svol. 2643, Springer-Verlag, Berlin, 2003, pp. 6–17.

[28] C.P. Schnorr, A hierarchy of polynomial lattice basis reduction algorithms, Theoret. Comput. Sci. 53 (19201–224.

UN

CO

RR

EC

TE

D P

RO

O 12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45