• No results found

Improving on the Number Field Sieve

N/A
N/A
Protected

Academic year: 2022

Share "Improving on the Number Field Sieve"

Copied!
55
0
0

Laster.... (Se fulltekst nå)

Fulltekst

(1)

Improving on the Number Field Sieve

Per Kristian Ørke

Master of Science in Mathematics

Supervisor: Kristian Gjøsteen, MATH Submission date: May 2015

Norwegian University of Science and Technology

(2)
(3)

Abstract

We look at efficient methods for computing logarithms in finite fields of any type. To achieve this, we first develop methods for factoring integers and computing discrete logarithms in fields of prime order using algebraic number theory. Then we show how this can be improved in the general case.

Sammendrag

Vi studerer effektive metoder for ˚a regne ut diskrete logaritmer i vilk˚arlige, endelige kropper. For ˚a oppn˚a dette, utvikler vi først metoder for ˚a faktorise heltall og regne ut diskrete logaritmer i primtallskropper ved ˚a benytte algebraisk tallteori. Deretter viser vi hvordan dette kan forbedres i det generelle tilfellet.

(4)

Preface

During my year of writing this thesis, I have had limited contact with my super- visor, Kristian Gjøsteen, due to his paternity leave. This has led to situations in which I have been working on a certain problem for quite a long time, only to realize the solution was completely trivial after talking to him for two minutes.

He was always able to understand my more or less vague questions, and in most cases, he would immediately see the answer and guide me towards it. I am very grateful for having such a nice supervisor.

Also deserving my gratitude are the graduates whose previous work on the number field sieve I have built upon. Finally, I would like to thank the Norwegian University of Science and Technology for offering me the opportu- nity to study my favourite branch of science and and write this thesis.

(5)

Contents

1 Introduction 4

2 Algebraic theory 5

2.1 Number fields and number rings . . . 5

2.2 Dedekind domains . . . 6

2.3 Finite fields . . . 10

2.4 The norm . . . 11

2.5 First degree prime ideals . . . 12

2.6 The discriminant . . . 14

2.7 Module structure of number rings . . . 16

3 Factoring integers 18 3.1 General idea . . . 18

3.2 Sieving for smooth values . . . 19

3.3 Finding a square inZ . . . 20

3.4 Finding a square inZ[α] . . . 22

3.4.1 Exponent maps . . . 22

3.4.2 Quadratic characters . . . 25

3.5 The linear system . . . 26

3.6 The algorithm . . . 27

3.7 Complexity analysis . . . 28

4 Finding d-logs in fields of prime order 35 4.1 General idea . . . 35

4.2 Character maps . . . 37

4.3 The linear system . . . 39

4.4 The algorithm . . . 42

4.5 Some remarks . . . 42

5 Finding d-logs in more general finite fields 43 5.1 General idea . . . 43

5.2 Reducing the problem . . . 44

5.3 Logarithms of linear polynomials . . . 47

5.4 The algorithm . . . 48

5.5 Complexity analysis . . . 49

6 Concluding remarks 52

Bibliography 53

(6)

Chapter 1

Introduction

Several cryptographic systems and schemes are based on the assumptions that integer factorization and discrete logarithm computation is far from trivial. A standard example is the RSA cryptosystem, in which the public key contains a product of large prime numbers. To break the system directly, one would have to know the factorization. Similarly, the public key in the ElGamal cryp- tosystem contains a group generator raised to a certain power, and one needs to know the exponent, i.e. find the discrete logarithm, in order to decrypt.

A central objective in cryptography is therefore to analyze how difficult these problems really are. If one can find polynomial time algorithms for factoring integers and/or computing discrete logarithms, one would have to adjust these cryptosystems or stop using them entirely. So trying to find the fastest such algorithms possible is a vital part of modern cryptography.

Integer factorization and dicrete logarithm computation turn out to be closely related, and some of the same algorithms can be used to attack both prob- lems. In 1988, John Pollard introduced the number field sieve which exploits algebraic number theory to factor integers faster than ever before. Daniel M.

Gordon adapted in 1992 the algorithm to the discrete logarithm problem for prime fields, where it also became the fastest known method.

In 2013, Antoine Joux proposed a method for computing discrete logarithms in fields of any order, which reduces the problem to computing certain discrete logarithms in small underlying fields, and can therefore be built on top of the number field sieve. The running time of this algorithm relative to the size of the field was a significant improval of the prime case. In fact, it was later shown that the algorithm could obtain so-called quasi-polynomial complexity in cer- tain cases.

We will present and discuss all these algorithms in this thesis, along with their theoretical foundations. We will also provide analyses of their complexities.

(7)

Chapter 2

Algebraic theory

This chapter will deal with algebraic concepts and theoretical mathematics that will be necessary to understand the algorithms and proofs presented in later chapters. All definitions and related results will be stated here and then re- ferred to whenever needed.

Prerequisites for understanding this thesis is set theory, elementary num- ber theory (modular arithmetic), linear algebra, basic abstract algebra (groups, fields, rings, ideals, modules), some Galois theory and a certain amount of basic calculus. We we will also assume knowledge of Zorn’s lemma.

2.1 Number fields and number rings

Letf ∈Q[x] be a monic, irreducible polynomial of degreed, and assumeα∈C to be a root off. Consider the field extension

Q[α] =

a0+a1α+. . .+ad−1αd−1|ai∈Q∀i

of the rational numbers. We will refer to this as a number field. An element β∈Q[α] in a number field is analgebraic integerif there is a monic polynomial g∈Z[x] such that β is a root ofg.

Proposition 1. Let ab ∈ Q with a, b ∈ Z and gcd(a, b) = 1 be an algebraic integer. Then ab ∈Z.

Proof. Let

g(x) =xd0+

d0−1

X

i=0

cixi

(8)

be the minimal polynomial of ab overZ. We then have ga

b

=a b

d0 +

d0−1

X

i=0

cia b

i

= 0

=⇒

d0−1

X

i=0

ciai

bi =−ad0 bd0

=⇒

d0−1

X

i=0

ciaibd0−1−i=−ad0 b

from multiplying each side bybd0−1. The left hand side is now aZ-linear com- bination of elements in Z and is hence inZ, so the right hand side must also be an integer. Since gcd(a, b) = 1, this implies b = ±1, which means that

a

b =±a∈Z.

The collection of all algebraic integers in a number field Q[α] is denoted OQ[α]. In other words,OQ[α] is the integral closure of Zin Q[α]. We will refer toOQ[α] as anumber ring, and it is in fact a subring ofQ[α]. An important fact aboutOQ[α] is that every non-zero proper ideal can be factored (uniquely) into a product of prime ideals. This follows from the fact that the ring is a Dedekind domain, a preperty we will now study in detail.

2.2 Dedekind domains

ADedekind domainis an integral domain which is integrally closed, Noetherian and in which every non-zero prime ideal is maximal. To show the unique factor- ization property of Dedekind domains, we first need to establish a few lemmas.

We say that an ideal ispre-factorizableif it contains a product of non-zero prime ideals andfactorizable if it equals a product of prime ideals.

Lemma 2. Let D be a Dedekind domain. Then every non-zero ideal in D is pre-factorizable.

Proof. Let M = {J ideal in D | J not pre-factorizable}. It is then sufficient to show that this set is empty. We will assume that it is not and arrive at a contradiction.

Observe thatM is a poset under set inclusion. LetJ1J2. . .be a chain in M. Since D is Dedekind and hence Noetherian, there exists r such that Jr=Jr+1=. . ., this makesJran upper bound for the chain. Since every chain then has an upper bound inM, Zorn’s lemma tells ut that M has a maximal elementAwith respect to inclusion.

Clearly, A can not be a prime ideal, as it would then be trivially pre- factorizable and not lie in M. Because of this, there must exist b1, b2D

(9)

such thatb1b2A, butb1 6∈Aand b2 6∈A. Otherwise, Awould be prime by definition. Let A1 = hb1i+A and A2 = hb2i+A. Clearly, we have AA1

andAA2, but there can not be equalities sinceb1A1 and b2A2, when none of them were inA. Hence we haveA(A1 and A(A2. But Awas the maximal element ofM, so this must mean thatA1 and A2 are not in M and are therefore pre-factorizable. Say that

r

Y

i=1

PiA1

s

Y

j=1

QjA2

wherePi andQj are prime ideals for alliandj.

We now claim thatA1A2A. Let a1A1 and a2A2, i.e. there exists c1, c2D anda10, a20Asuch thata1=c1b1+a10 anda2=c2b2+a20. Then

a1a2=c1c2b1b2+c2b2a10+c1b1a20+a10a20A sinceb1b2A. This shows thatA1A2A. Hence we have

r

Y

i=1

Pi s

Y

j=1

QjA1A2A

and A is pre-factorizable, a contradiction since it is in M. We conclude that M =∅and hence every ideal is pre-factorizable.

Lemma 3. Let D be a Dedekind domain and let P be a prime ideal inD. Let K be the field of fractions ofD andP0={k∈K|kPD}. LetI be an ideal inD. ThenIP06=I.

Proof. It is clear thatDP0, but do we have equality? Let 06=aP. Lemma 2 tells us that hai is pre-factorizable, so assume that Qr

i=1Pi ⊂ haiwhere all thePi are prime ideals and theris as small as possible.

Assume thatPi 6⊂P ∀i. Then there exists aiPi\P for alli. But then

r

Y

i=1

ai

r

Y

i=1

Pi⊂ hai ⊂P,

and sinceP is prime, there must be aj such that ajP. This is a contradic- tion, so we know that there is aj such that PjP. Now,Pj is a prime ideal and therefore maximal sinceD is a Dedekind domain. This means thatP must either be equal toPj or the whole ringD. SinceP is prime, we can conclude thatP =Pj.

(10)

Without loss of generality, we can assume that j = 1. Recall that r was chosen as small as possible, thereforeQr

i=2Pi6⊂ hai. So letb∈(Qr

i=2Pi)\ hai.

Consider the element ba in K. This is not in D, since then we would have a·ab =b∈ hai, a contradiction. But

bP

r

Y

i=2

Pi

! P =

r

Y

i=1

Pi⊂ hai,

so for allpin P, there is ac inD such thatbp=ca. Hence b

a·p=cD =⇒ b

aPD =⇒ b aP0 The conclusion is thatD6=P0.

In a Noetherian ring, every ideal is finitely generated. So, since D is a Dedekind domain, we have thatI=hα1, . . . , αnifor someαiI. Now assume that IP0 =I, the opposite of what we are trying to show. Let kP0. Then iIP0=I ∀i, so we can express these elements using the set of generators:

i=

n

X

j=1

aijαj

whereaijD∀i, j. Define δij=

(1 ifi=j 0 otherwise and consider the matrix A = ijaij

ij where i and j range from 1 to n.

Then

A αi

i = (k−aiii−P

j6=iaijαj

i

= i−P

jaijαj

i= ii

i

= 0

From [4], we have thatBx= 0 =⇒ det(B)x= 0, so we have in our case that det(A)αi= 0∀i. Since the αi are generators, they are non-zero, and sinceDis an integral domain, we then have that det(A) = 0. Now consider the polyno- mial g(X) = det ijaij

ijD[X], which is monic since X only appears on the diagonal and never with any coefficient (other than 1) in front of it. We have just shown thatkis a root of this polynomial. SinceDis integrally closed, being a Dedekind domain, andkis the root of a monic polynomial over D, we have thatkD.

This means thatP0Dand hence P0 =D. But we have already seen that this is not true, so we conclude that our assumptionIP0 =I was wrong.

(11)

We are ready for our main result concerning Dedekind domains.

Theorem 4. LetDbe a Dedekind domain. Then every non-zero, proper ideal in Dis factorizable and its factorization into prime ideals is unique up to ordering.

Proof. We first prove existence of the factorization. Mirroring the idea from the proof of Lemma 2, we consider the setM ={J ideal inD|J not factorizable}, which we assume is non-empty. The exact same argument gives us a maximal elementA, which again can not be a prime ideal. All ideals are contained in a maximal ideal, so letP be a maximal (and therefore prime) ideal withAP.

1P = PD and therefore 1 ∈ P0, so AAP0. Also, P P0D by definition ofP0. In total, we have AAP0P P0D. The second inclusion is clearly strict, and from Lemma 3, we also have that the first inclusion is. So we have A (AP0 (D. Since A was the maximal element of M, this means thatAP06∈M. It is therefore factorizable, so assume

AP0=

r

Y

i=1

Pi

Lemma 3 also tells us thatP 6=P P0. But clearlyPP P0, soP (P P0. Note that P P0 is an ideal in D. Since P was a maximal ideal, this means that we must haveP P0 =D. But then

A=AD=AP P0=P

r

Y

i=1

Pi,

and hence A is factorizable, a contradiction. We conclude that M = ∅ and hence every ideal is factorizable.

To prove uniqueness, assume that an idealI has two factorizations I=

r

Y

i=1

Pi=

s

Y

j=1

Qj,

where Pi and Qj are prime ideals for all i and j. Assume without loss of generality thatrs. Using the properties of prime ideals, we get

r

Y

i=1

Pi=

s

Y

j=1

QjQ1 =⇒ P1Q1 or

r

Y

i=2

PiQ1 =⇒ . . .

=⇒ P1Q1 or . . . or PrQ1

So assume without loss of generality thatP1Q1. Every prime ideal in D is maximal, soP1 is a maximal ideal. The inclusion then means thatQ1 is equal to eitherP1 orD, but sinceQ1is prime, we must haveP1=Q1.

(12)

Now, mutiplying the two factorizations with P10, we get P10

r

Y

i=1

Pi=P10

s

Y

j=1

Qj =⇒ P10P1 r

Y

i=2

Pi=P10P1 s

Y

j=2

Qj =⇒

r

Y

i=2

Pi=

s

Y

j=2

Qj

since P10P1 = D. We can continue eliminating prime ideals using the same argument until we are left withPr=Qs

j=rQj Assume thatr < s. Then we can use the argument again and multiply byPr0 to obtain

Pr0Pr=Pr0Pr s

Y

j=r+1

Qj =⇒ D=

s

Y

j=r+1

Qj,

an impossibility. Hencer=s. We have also shown thatPi=Qi for all iafter reordering. Therefore, the factorization is unique.

The important observation for us is thatOQ[α] is a Dedekind domain. For a proof of this, see [4]. This allows us to talk about factorization of ideals in OQ[α] and also the conceptramification. Letpbe a prime and

pOQ[α] =Y

i

Pifi

be the factorization of the ideal generated byp into prime ideals Pi. We say thatpis unramified iffi= 1 for alli, i.e. the ideal is ”square-free”.

2.3 Finite fields

Before proceeding with our number rings, we need to mention some topics on finite fields. To perform computations in a finite field, we need to have a model for it. For prime fields Fp we will useZp, the integers modulopwith addition and multiplication modulop. For fields on the form Fpk, we will use the model we already have for Fp together with an irreducible polynomialP over Fp[x] to form the model Fp/hPi. The context will decide whether we refer to the field or the model throughout this thesis.

Given a finite field Fn, define the projective line P1(Fn) to be the set P1(Fn) = F2n\ {(0,0)}

/∼,

where (a, b) ∼ (c, d) ⇐⇒ ∃f ∈ Fn such that (a, b) = f(c, d). Note that {(f,1)}f∈Fn∪ {(1,0)} is a set of representatives for P1(Fn). We will call this representation the homogenous coordinates of P1(Fn). Consequently, we have that

P1(Fn)

=n+ 1.

(13)

Proposition 5. Letqbe a prime and let{(α, β)}be the homogenous coordinates ofP1(Fq). Then the following equality holds in any field of cardinalityq:

XYqXqY = Y

(α,β)

(βX−αY) (2.1)

Proof. Recall that

XqX = Y

f∈Fq

(X−f) ReplacingX with XY, we obtain

X Y

q

X Y = Y

f∈Fq

X Yf

Multiplying each side by−Yq+1, we get XYqXqY =−Y Y

f∈Fq

(X−f Y)

= (0X−1Y) Y

f∈Fq

(1X−f Y)

=Y

(α,β)∈P1(Fq)

(βX−αY)

2.4 The norm

A concept that will be of great importance in the discussion of our algorithms, is thenorm of an element in a number field. We will first show that there are exactlyd embeddings ofQ[α] inCthat fix every element ofQ: Letα1, . . . , αd

be the roots of f. Consider the d homomorphisms σi : Q[α] → C defined by α7→αi. These are all embeddings, so there are at least dsuch. Now assume that we have another one, namely aσd+1 that sendsαto some β. If we write f asPd

i=0cixi, we have that f(β) =

d

X

i=0

ciβi =

d

X

i=0

ciσd+1(α)i=

d

X

i=0

σd+1(cid+1 αi

=σd+1 d

X

i=0

ciαi

!

=σd+1(f(α)) =σd+1(0)

= 0

Here we used that the ci are all in Q and hence will be fixed by σd+1. The conclusion is thatβ is a root off and therefore equals one of theαi, soσd+1is

(14)

one of thedembeddings we already had. Hence there can be no more.

Now we are ready to give the definition. Letθ∈Q[α]. The norm ofθis N(θ) =

d

Y

i=1

σi(θ)

First observe that the norm function maps elements inQ[α] toQand elements inOQ[α] to Z. Note that ifa+is inZ[α], then

N(a+bα) =

d

Y

i=1

σi(a+bα) =

d

Y

i=1

(a+i)

=

d

Y

i=1

ba b +αi

=−bd

d

Y

i=1

a bαi

=−bdf

a b

(2.2) sincef(x) =Qd

i=1(x−αi).

The norm of an ideal in Z[α] is a notion closely related to the norm of elements. We define the norm of an idealIto be

N(I) = [Z[α] :I]

Ideals are then mapped to positive integers. We claim that for θ ∈ Z[α], we haveN(hθi) =|N(θ)|. For a proof of this, see [2].

2.5 First degree prime ideals

Another important concept will be the setR(p), defined as R(p) ={r∈ {0,1, ..., p−1} |f(r)≡0 (modp)}

for a prime p. We first show that for the factors of N(a+bα), this set has a special property.

Proposition 6. Let a+∈Z[α]and letpbe a prime number. Assume thatp does not divideb. ThenpdividesN(a+bα)if and only if there is anr inR(p) such thata≡ −br (modp).

Proof. LetrR(p) be such that a≡ −br (mod p). Then N(a+bα)≡ −bdf

a b

≡ −bdf

−−br b

≡ −bdf(r)≡0 (mod p) from the definition of R(p) and since f is a polynomial. Assume now that p divides N(a+bα), so, −bdfab

≡ 0 (modp). Since p - b, we have that fab

≡0 (modp). Let r=−ab modp. Thena≡ −br (mod p) andf(r)≡0 (modp) sincef is a polynomial.

(15)

When we get to our algorithms, we will only consider elements a+ of Z[α] such that gcd(a, b) = 1. Note that ifpdoes indeed divideb, it cannot be a factor of any suchN(a+bα). Proposition 6 states that if that was the case, we would have anrR(p) such thata≡ −br≡0 (modp). Hence, we would have gcd(a, b)≥p > 1. Also note that we can only have one r such thata ≡ −br (modp). Ifa≡ −br1 ≡ −br2 (mod p), we must have r1r2 (mod p) since p does not divideb. This is clearly impossible whenr1 and r2 are both between 0 andp−1.

The set R(p) is also connected to certain prime ideals in Z[α]. We first observe that ifN(P) is a prime number for an idealP, thenP is a prime ideal.

To see this, we have the following chain of implications N(P) =p =⇒ [Z[α] :P] =p =⇒ Z[α]/P ∼=Zp

=⇒ Z[α]/P is a field =⇒ P is a maximal ideal

=⇒ P is a prime ideal

Conversely, we have that ifP is a prime ideal, its norm must be a prime power.

IfN(P) = pn for some prime pand some integer n, we say thatP is ann’th degree prime ideal. We will be particularly interested in first degree prime ide- als, i.e. P such that N(P) =p. As noted, this is equivalent toZ[α]/P being isomorphic to the field withpelements.

The crucial observation is that first degree prime ideals are in one-to-one correspondence with pairs (p, r) such thatrR(p). To see that a first degree prime ideal admits such a pair, first note that, by definition, its norm is a prime p. Then consider the homomorphism φ : Z[α] → Zp and letr =φ(α). Since φ(1) = 1, we have

φ(f(α)) =φ

d

X

i=0

ciαi

!

=

d

X

i=0

ciφ(α)i

!

modp=

d

X

i=0

ciri

! modp

=f(r) modp

Butf(α) = 0, andφ(0) = 0, sormust be a root off modulop. HencerR(p).

To go from a pair (p, r) to a first degree prime ideal is quite similar. We construct the homomorphismφ:Z[α]→Zp sendingαtor. Then we defineP to be ker(φ). Our map is clearly onto, so the first isomorphism theorem for rings tells us thatZ[α]/P is isomorphic to Zp. Hence N(P) = [Z[α] :P] =|Zp|=p andP is a first degree prime ideal. We note thatP is generated bypandαr:

For allθ1, θ2in Z[α], we have

φ(θ1p+θ2(α−r)) =φ(θ1)φ(p) +φ(θ2)φ(α)−φ(θ2)φ(r)

=φ(θ1)·0 +φ(θ2rφ(θ2r

= 0,

(16)

so the ideal generated bypand (α−r) is contained inP. For the other inclusion, assume thatθ=Pd−1

i=0aiαiP, i.e. φ(θ)≡0 (modp). Then there is an integer ksuch that

kp=φ(θ) =φ

d−1

X

i=0

aiαi

!

=

d−1

X

i=0

airi

=⇒ kp+θ=

d−1

X

i=0

airi+θ

=⇒ θ=kp+

d−1

X

i=0

aiαi

d−1

X

i=0

airi=kp+

d−1

X

i=0

ai αiri

and (α−r) is clearly a factor in the sum. Therefore,θ=kp+γ(αr) for some γ∈Z[α].

The next observation will be used as part of a proof in a later chapter, so we state is as a lemma:

Lemma 7. Let P be a first degree prime ideal inZ[α] corresponding to (p, r).

Thena+br≡0 (modp)if and only if a+P.

Proof. Assume there is a kinZsuch thata+br=kp. Then a+=a+br+br=kp+b(αr),

which is inP, sinceP is generated bypand (α−r). Now assume that a+ is inP. Letγbe the mapZ[α]→Zpwith kernelP. Sincea+P, we have that

γ(a+bα) =a+br= 0 inZp, which means thata+br≡0 (modp).

2.6 The discriminant

We will need more facts about the structure ofOQ[α], but then we first need more terminology. Letσ1, . . . , σd be the dembeddings ofQ[α] inC. Given elements θ1, . . . , θd ∈Q[α], we define thediscriminant of the elements, disc(θ1, . . . , θd), to be the square of the determinant of the matrix with the elementσij) in positionij. We will denote this matrix [σij)], so

disc(θ1, . . . , θd) =|[σij)]|2

We want to show that the discriminant maps intoQ. To do this, we first observe

(17)

that

disc(θ1, . . . , θd) =|[σij)]||[σij)]|=|[σij)]T||[σij)]|=|[σji)][σij)]|

=

" d X

k=1

σkiθj)

#

Define thetraceof an elementθ∈Q[α] to be T(θ) =

d

X

k=1

σk(θ) Hence we can rewrite disc(θ1, . . . , θd) =|[T(θiθj)]|.

Now we claim that the trace maps intoQ. We study the number fieldQ[θ], which is a subfield of Q[α]. Let d0 = [Q[θ] : Q] and let σ10, . . . , σ0d0 be the embeddings of Q[θ] in C. We use the notation t(θ) = Pd0

i=1σi0(θ). Now, the minimal polynomial ofθoverQwill look likeQd0

i=1(x−σi(θ)). The coefficient in front ofxd0−1 will then bet(θ), so we conclude thatt(θ) lies in Q.

Lemma 8. T(θ) =dd0t(θ).

Proof. From Galois theory, we know that every embedding σ0 of Q[θ] in C extends to exactly dd0 embeddings of Q[α] in C, i.e. embeddings σ such that σ(γ) =σ0(γ)∀γ∈Q[θ].. Letσ0j be extended toσ(j−1)d

d0+1, σ(j−1)d

d0+2, . . . , σjd d0

forj∈ {1, . . . , d0}. Then we have

T(θ) =

d

X

i=1

σi(θ) =

d0

X

j=1

d d0

X

k=1

σ(j−1)d d0+k(θ)

=

d0

X

j=1

d d0

X

k=1

σj0(θ) =

d0

X

j=1

d

d0σ0j(θ) = d d0

d0

X

j=1

σ0j(θ)

= d d0t(θ)

We conclude from the lemma that the trace is a product of rational numbers and hence itself lies in Q. Since disc(θ1, . . . , θd) = |[T(θiθj)]|, and [T(θiθj)]

only consists of rational elements, we have shown that disc(θ1, . . . , θd) ∈ Q. Furthermore, ifθiis an algebraic integer for alli, we have that disc(θ1, . . . , θd)∈ Z, see [3]. We will use the discriminant and the properties we have proven about it, to show thatOQ[α] is in fact a freeZ-module.

(18)

2.7 Module structure of number rings

Lemma 9. Let θ∈Q[α]. Then there existsm∈Zsuch that ∈ OQ[α]. Proof. Letg(x) =Pd0

i=0aixi∈Z[x] be such thatg(θ) = 0. Definem=ad0 and h(x) =xd0 +Pd0−1

i=0 aim(d0−1−i)xi. Then h(x) is a monic polynomial inZ[x]

and

h(mθ) = (mθ)d0+

d0−1

X

i=0

aim(d0−1−i)(mθ)i=md0θd0+

d0−1

X

i=0

aim(d0−1)θi

=m(d0−1)

mθd0 +

d0−1

X

i=0

aiθi

=m(d0−1)

d0

X

i=0

aiθi=m(d0−1)g(θ)

= 0

Hence, is an algebraic integer.

Lemma 10. There exists a basis forQ[α] overQwhere all basis elements are algebraic integers.

Proof. Let {θ1, . . . , θd} be a basis forQ[α] over Q. Fori= 1, . . . d, let mi ∈Z be such thatmiθi ∈ OQ[α] using Lemma 9. Letm =Qd

i=1mi. SinceOQ[α] is a ring, and all integers are algebraic integers,i is in OQ[α] for all i. Hence, we have a basis{mθ1, . . . , mθd}forQ[α] overQwhere all basis elements are in OQ[α].

We will proceed to show that there are freeZ-modulesM1 andM2, both of rankd, such that M1 ⊂ OQ[α]M2. Since submodules of freeZ-modules are themselves free Z-modules of smaller or equal rank, this will prove thatOQ[α]

is a freeZ-module of rankd.

Using Lemma 10, let {θi}di=1 be a basis for Q[α] over Q such that θi ∈ OQ[α] ∀i. Define

M1=

d

M

i=1

Zθi

We haveZθi∼=Z∀i, soM1 is a free Z-module of rankd. Again, sinceOQ[α] is a ring, we haveM1⊂ OQ[α]. We will constructM2 usingM1, but we will need a result about the discriminant.

Proposition 11. Leti}di=1 be a basis for Q[α] over Q consisting only of algebraic integers. Let θ ∈ OQ[α] and denote disc(θ1, . . . , θd) by disc. Then there existm1, . . . , md∈Zsuch that

θ=m1 θ1

disc+. . .+md θd disc

(19)

Proof. We writeθas a linear combination of the basis elements: θ=Pd i=1xiθi, xi∈Q∀i. Now we apply our embeddingsσi to getdequations on the form

σi(θ) =σi

d

X

i=1

xiθi

!

=

d

X

i=1

σii)xi

We write these equations as the linear system Ax=bwhere A= [σij)], x= (xi)di=1 andb= (σi(θ))di=1. Denote by Aj the matrix where thej’th column of Ais replaced byb. Cramer’s Rule gives us the solutionxj= |A|A|j|. Observe that

|A|2= disc, so

discxj =|A|2xj =|A|2|Aj|

|A| =|A||Aj|

Sinceσmaps any algebraic integer to another one, we have that|A|and|Aj|are both inOQ[α], and hence discxj ∈ OQ[α]. But we know that both disc andxj

are rational, so their product is also inQ. And since we have from Proposition 1 that the only rational numbers that are algebraic integers are the integers themselves, we must have discxj ∈Z∀i. Define mj = discxj forj = 1, . . . , d.

Then

m1

θ1

disc+. . .+md

θd

disc =x1θ1+. . . xdθd=θ

Since theθiare all algebraic integers, we have from Section 2.6 that disc∈Z. DefineM2= disc1 A, i.e.

M2=

d

M

i=1

Z θi disc

Proposition 11 tells us thatOQ[α]M2. Again,M2 is clearly a freeZ-module of rankd. Hence, we have achieved the ”squeezing”M1⊂ OQ[α]M2 and can conclude thatOQ[α] is a freeZ-module of rankd.

(20)

Chapter 3

Factoring integers

3.1 General idea

The number field sieve (NFS-fact) is an algorithm for factoring integers. Assume thatn∈Zis not a power of a prime. (If it was, the prime would be relatively easy to find). We attempt to findx, y∈Zsuch thatx2y2 (mod n). Then it is quite likely that gcd(x−y, n) is a non-trivial factor ofn.

Letf ∈Z[x] be monic and irreducible of degree d. Letm∈Zbe such that f(m)≡ 0 (modn). Let α ∈ C be a root of f. Consider the projection map π:Z→Zn and the homomorphism

φ:Z[α]→Zn

α7→mmodp

The NFS-fact attempts to find a square inZ(sayx2) and a square inZ[α] (say β2) such that φ β2

= π x2

. If we can find this connection, we have also found the congruence we wanted: Simply lety ∈Zbe such that π(y) =φ(β).

Then

π y2

=π(y)2=φ(β)2=φ β2

=π x2 , which means thatx2y2 (modn).

So how do we search for such elements? Observe that if the square in Z is on the form x2 =Q

(a,b)∈S(a+bm) and the square in Z[α] is on the form

(21)

β2=Q

(a,b)∈S(a+bα) for the same set S⊂Z×Z, then φ β2

=φ

 Y

(a,b)∈S

(a+bα)

= Y

(a,b)∈S

φ(a+bα) = Y

(a,b)∈S

((a+bm) modn)

=

 Y

(a,b)∈S

(a+bm)

modn=π

 Y

(a,b)∈S

(a+bm)

=π x2

So finding squares on this form will be sufficient.

Now we need to know how to find the set S. Assume that we have a set T ⊂Z×Z, with gcd(a, b) = 1∀(a, b)∈T, such that we know the factorization of both a+bm and N(a+bα) for all (a, b) in T. We then proceed to find a subset ST that satisfies four criteria. Two of these together assure that Q

(a,b)∈S(a+bm) is a square in Z, while the last two together make it very likely thatQ

(a,b)∈S(a+bα) is a square inZ[α]. Finding a subset that satisfies all these criteria can be formulated as finding a linearly dependent subset of certain vectors e(a, b) defined for all (a, b) inT. In particular, the vectors are defined over Z2 in such a way that a subset ST satisfies a criterion if and only ifP

(a,b)∈Se(a, b)i= 0 for certaini’s.

In addition to all the missing details here, it still remains to explain where we get the setTfrom. This is done through a couple of sieving procedures, from which the algorithm gets its name. Also, it is not obvious how we should choose or find the parametersf,d,mandα. We will elaborate on all this, present the algorithm and analyze its complexity.

3.2 Sieving for smooth values

As explained in Section 3.1, we need to start by finding a setT ⊂Z×Zsuch that we know the factorization ofa+bmand N(a+bα) for all (a, b) inT. In fact, we want to require that the factorizations yield only small primes, since this will speed up the algorithm. So lety be an integer. We say that an integer isy-smoothif all of its prime factorspsatisfypy. Thus we wantT such that a+bmandN(a+bα) arey-smooth for all (a, b) inT. We now need to decide which pairs of integers (a, b) we should search through. Let u be an integer whose optimal value will be discussed later. We require|a| ≤uand 0< bu.

There is no need for checking negativeb’s, because then −(a+bm) would al- ready have been checked, and clearly this isy-smooth if and only if a+bmis y-smooth. Furthermore, we should only search among pairs with gcd(a, b) = 1.

Again, ifk∈ {2, . . . , y}is a common factor, thena+bmk would already have been checked and isy-smooth if and only ifa+bmis.

(22)

We have to do two different searches, first for a set T1 such that alla+bm arey-smooth, then for a setT2 such that allN(a+bα) arey-smooth. The set T will then quite simply be T = T1T2. The first search will be called the rational sieve and the second one the algebraic sieve.

Let us begin with the rational sieve. We call the set {pprime|py}

therational factor base. For a possibleb, we list the valuesa+bmfor all possible a. Now, a primepdividesa+bmif and only ifa≡ −bm (modp) (by definition), so we start by calculating−bm. Then, for a primepin the factor base, we find allasuch that the congruence holds. For any sucha, we find the corresponding entry in the list and divide it out with pas many times as possible. After we have done this for allpin the factor base, we locate the entries in the list that are equal to±1. (Since we have divided out by all our small primes, any entry that is not equal to ±1 can not originally have been y-smooth.) We save the corresponding pairs (a, b). This procedure is repeated for all possibleb, and we end up with the setT1.

The algebraic sieve is similar, but we cannot use the same congruence. Recall from Section 2.5 the setR(p). Define thealgebraic factor baseto be the set

{(p, r)|pprime,rR(p)}

We use the same idea as in the rational sieve. Fix ab, list the valuesN(a+bα) for all possiblea. For a pair (p, r) in the factor base, we find all a such that a≡ −br (modp). Again, divide out the corresponding entries in the list with the highest possible power of p. When this is done for all possible (p, r), we locate the entries that are equal to±1 and save the corresponding pairs (a, b).

After doing this for all possibleb, we have found the setT2. Notice that whenever we come across a primepthat dividesb, we can just skip it, as there can be no possible a with p| N(a+bα) in this case. This is because if b ≡0 (modp), then

p|N(a+bα) ⇐⇒ a≡0 (mod p) ⇐⇒ p|gcd(a, b) and we don’t consider such pairs (a, b).

As noted, we can now find the setT by calculatingT =T1T2.

3.3 Finding a square in Z

We have found a setT where botha+bmandN(a+bα) arey-smooth for all (a, b) inT. Now we want a subsetST such that Q

s∈S(a+bm) is a square inZandQ

s∈S(a+bα) is a square inZ[α]. We will deal with these tasks sepa- rately, so let’s first consider the rational side.

(23)

Denote by π(y) the number of primes in the rational factor base. Assume that we have|T|> π(y) + 1. (Whether this is true will be affected by howuand y are chosen, which will be discussed later.) Now, from the rational sieve, we have the factorization of everya+bmin T in terms of our primesp1, . . . , pπ(y). Define maps

ep:T →Z

(a, b)7→ordp(a+bm) Also define

ep0 : (a, b)7→

(1 ifa+bm >0

−1 otherwise Now, for all (a, b) inT, consider the vector

e1(a+bm) = (ep0(a+bm) mod 2, . . . , epπ(y)(a+bm) mod 2)

in Zπ(y)+12 . (The significance of the subscript 1 will be made clear in a later chapter.) DefineB=π(y) + 1. We now have|T|> B vectors inZB2, and hence we are guaranteed to have dependent vectors. So letS1 be a subset ofT such thatP

(a,b)∈S1e1(a+bm) = 0. We have X

(a,b)∈S1

ordpj(a+bm) mod 2 = 0∀j, which means that for allj, we can find an integersj such that

X

(a,b)∈S1

ordpj(a+bm) = 2sj

Now we can actually conclude thatQ

(a,b)∈S1(a+bm) is a square inZ! Because Y

(a,b)∈S1

(a+bm) = Y

(a,b)∈S1

k

Y

j=0

pordj pj(a+bm)

=

k

Y

j=0

 Y

(a,b)∈S1

pordj pj(a+bm)

=

k

Y

j=0

p P

(a,b)∈S1ordpj(a+bm)

j =

k

Y

j=0

p2sj j =

k

Y

j=0

(psjj)2

=

k

Y

j=0

psjj

2

We have thus used the set ofy-smooth values to produce a square on the form we presented in Section 3.1.

(24)

3.4 Finding a square in Z [α]

3.4.1 Exponent maps

On the rational side, we were ”lucky”: Having enough smooth values was suf- ficient for finding a square. Now that we start working in Z[α], we find that things are not so simple. In fact, it turns out that the best we can hope for are necessary conditions. As explained in Section 3.1, we will develop two such criteria and convince ourselves that they together will almost guarantee the ex- istence of a square on the form we want.

The first criterion is reminiscent of what we did on the rational side, we attempt to find certain ”exponents” that sum up to 0. If we try the exact same idea, and use our factorizations of theN(a+bα), we will end up with a setS2 such thatQ

(a,b)∈S2N(a+bα) is a square in Z, but that’s not what we’re after since it turns out not to be sufficient to conclude that Q

(a,b)∈S2(a+bα) is a square inZ[α].

We will still use the exponent of a primepin the factorization ofN(a+bα), but in order to utilize it, we need to associate it not only withp, but with a certain element ofR(p). Recall from Proposition 6 that pdivides N(a+bα) if and only if there is anrin R(p) such thata≡ −br (modp). Thisr will then clearly be unique. Defineep,r :Z[α]→Zby

ep,r : (a+bα)7→

(ordp(N(a+bα)) ifa≡ −br (modp)

0 otherwise.

We trivially observe that

|N(a+bα)|= Y

(p,r)

pep,r(a+bα)

The idea behind this is that ifep,r turned out to be a group homomorphism, we could prove a necessary condition for the squareness property, stated below as Theorem 15. Unfortunately, this is not the case. However, we can still obtain the result by finding a group homomorphism that ”imitates”ep,rin a sense that will become clear. Recall the notion of first degree prime ideals in Z[α] from Chapter 2, specifically that they correspond to pairs (p, r). We want to use this correspondence when finding the mentioned group homomorphism.

Proposition 12. Let P ⊂ Z[α] be a prime ideal. Then there exists a group homomorphismlP :Q[α]→Zsuch that:

1. If 06=β∈Z[α], thenlP(β)≥0.

2. If 06=β∈Z[α], thenlP(β)>0 if and only ifβP.

(25)

3. If β∈Q[α], then{P prime ideal|lP(β)6= 0} is a finite set and Y

P prime ideal inZ[α]

N(P)lP(β)=|N(β)|

For a proof of Proposition 12, see [2]. These lp’s have some interesting properties regarding first degree prime ideals that we will exploit.

Lemma 13. Let a, b∈Zbe such that gcd(a, b) = 1. LetP ⊂Z[α] be a prime ideal that is not of first degree. ThenlP(a+bα) = 0.

Proof. Assume lP(a+bα)6= 0. Then, by Proposition 12, part 1, we have that lP(a+bα)>0. Proposition 12, part 2, now gives us thata+P. Consider the projection map

π:Z[α]→Z[α]/P θ7→θ+P =: ¯θ

Sincea+P, we have π(a+bα) = ¯0. Z[α]/P is a finite field, so assume Z[α]/P ∼= Fpk. We claim thatp-b. Assume that p|b. Thenp|bα, sobαP andπ(bα) = ¯0. Now,

π(a) =π(a+bα) =π(a+bα)π(bα) = ¯0−¯0 = ¯0

Hence, aP and p | a. But then gcd(a, b)p > 1, a contradiction. We conclude that p-b and thusb /P, which meansπ(b)6= ¯0. Thenπ(b) has an inverse inZ[α]/P, we define it to be ˆb. This gives us

π(α) =π(bα)π(b)−1= (π(a+bα)π(a))π(b)−1= ¯0−¯aˆb=−¯aˆb, which is an element in Fp. Hence, all linear combinations of powers ofα, i.e. all elements inZ[α], are also mapped to Fp byπ. π is surjective, so we conclude that

Fp∼=π(Z[α]) =Z[α]/P ∼= Fpk

Hence,k= 1 and P is a first degree prime.

This is then used to show thatlp”imitates” ep,r:

Proposition 14. Let a, b∈Zsuch that gcd(a, b) = 1. LetP ⊂Z[α] be a first degree prime ideal corresponding to(p, r). Then lP(a+bα) =ep,r(a+bα).

Proof. Let us start by showing thatlP(a+bα) = 0 if and only ifep,r(a+bα) = 0.

By Proposition 12, part 2, lP(a+bα) 6= 0 ⇐⇒ a+P. By Lemma 7, a+P ⇐⇒ a +br ≡ 0 (modp). By definition, a+br ≡ 0 (modp) ⇐⇒ ep,r(a+bα)6= 0.

Referanser

RELATERTE DOKUMENTER

(yanatuvunja moyo) – like poor economic rewards and the lack of staff which means that we are left with a lot of

degree of clarity of the documents; and their hierarchical position. Desk review and interviews with relevant staff working with quality assurance in Norad and the MFA. 4)

Having described our methods for computing the metric space of barcodes, we examine our shape descriptor for PCDs of families of algebraic curves.. Throughout this sec- tion, we use

However, a shift in research and policy focus on the European Arctic from state security to human and regional security, as well as an increased attention towards non-military

In this section we study some mathematical problems arising in statistical testing theory, and show how some of the results concerning the cone C are useful.. First we give the

This text will discuss variants of the general number field sieve algorithm used to solve discrete logarithm problems in finite fields of both prime and prime power order.. That is,

We also develop conditions for conservation of quadratic invariants for both stochastic Runge-Kutta (SRK) methods and SPRK methods, and show how the rooted trees in the order

We also give two algorithms for the discrete logarithm problem in fields F q , q a prime, the index-calculus method (ICM) and the number field sieve for the discrete logarithm