• Aucun résultat trouvé

Introduction to finite fields

Dans le document Guide to Elliptic Curve Cryptography (Page 46-50)

Finite Field Arithmetic

2.1 Introduction to finite fields

Fieldsare abstractions of familiar number systems (such as the rational numbersQ, the real numbersR, and the complex numbersC) and their essential properties. They con-sist of a setFtogether with two operations, addition (denoted by+) and multiplication (denoted by·), that satisfy the usual arithmetic properties:

(i) (F,+)is an abelian group with (additive) identity denoted by 0.

(ii) (F\ {0},·)is an abelian group with (multiplicative) identity denoted by 1.

(iii) The distributive law holds:(a+b)·c=a·c+b·cfor alla,b,c∈F. If the setFis finite, then the field is said to befinite.

This section presents basic facts about finite fields. Other properties will be presented throughout the book as needed.

Field operations

A fieldFis equipped with two operations, addition and multiplication.Subtractionof field elements is defined in terms of addition: fora,b∈F,ab=a+(−b)where

bis the unique element inFsuch thatb+(−b)=0 (−bis called thenegativeofb).

Similarly,divisionof field elements is defined in terms of multiplication: fora,b∈F withb =0,a/b=a·b−1whereb−1is the unique element inFsuch thatb·b−1=1.

(b−1is called theinverseofb.) Existence and uniqueness

Theorder of a finite field is the number of elements in the field. There exists a finite fieldFof orderq if and only ifq is a prime power, i.e.,q= pm where pis a prime number called thecharacteristicofF, andm is a positive integer. Ifm=1, thenFis called aprime field. Ifm≥2, thenFis called anextension field. For any prime power q, there is essentially only one finite field of orderq; informally, this means that any two finite fields of orderq are structurally the same except that the labeling used to represent the field elements may be different (cf. Example 2.3). We say that any two finite fields of orderqareisomorphicand denote such a field byFq.

Prime fields

Let p be a prime number. The integers modulo p, consisting of the integers {0,1,2,...,p−1} with addition and multiplication performed modulo p, is a finite field of order p. We shall denote this field byFpand call pthemodulusofFp. For any integera,amod pshall denote the unique integer remainderr, 0≤rp−1, obtained upon dividingaby p; this operation is calledreduction modulo p.

Example 2.1(prime fieldF29) The elements ofF29are{0,1,2,...,28}. The following are some examples of arithmetic operations inF29.

(i) Addition: 17+20=8 since 37 mod 29=8.

(ii) Subtraction: 17−20=26 since−3 mod 29=26.

(iii) Multiplication: 17·20=21 since 340 mod 29=21.

(iv) Inversion: 17−1=12 since 17·12 mod 29=1.

Binary fields

Finite fields of order 2mare calledbinary fieldsorcharacteristic-two finite fields. One way to constructF2m is to use apolynomial basis representation. Here, the elements of F2m are the binary polynomials (polynomials whose coefficients are in the field F2= {0,1}) of degree at mostm−1:

F2m = {am−1zm−1+am−2zm−2+ ··· +a2z2+a1z+a0 : ai ∈ {0,1}}.

An irreducible binary polynomial f(z)of degreemis chosen (such a polynomial exists for anym and can be efficiently found; see §A.1). Irreducibility of f(z)means that f(z)cannot be factored as a product of binary polynomials each of degree less than m. Addition of field elements is the usual addition of polynomials, with coefficient arithmetic performed modulo 2. Multiplication of field elements is performed modulo thereduction polynomial f(z). For any binary polynomiala(z),a(z)mod f(z)shall denote the unique remainder polynomialr(z)of degree less thanmobtained upon long division ofa(z)by f(z); this operation is calledreduction modulo f(z).

Example 2.2(binary fieldF24) The elements ofF24are the 16 binary polynomials of degree at most 3:

0 z2 z3 z3+z2

1 z2+1 z3+1 z3+z2+1

z z2+z z3+z z3+z2+z z+1 z2+z+1 z3+z+1 z3+z2+z+1.

The following are some examples of arithmetic operations in F24 with reduction polynomial f(z)=z4+z+1.

(i) Addition:(z3+z2+1)+(z2+z+1)=z3+z.

(ii) Subtraction:(z3+z2+1)(z2+z+1)=z3+z. (Note that since−1=1 inF2, we have−a=afor alla∈F2m.)

(iii) Multiplication:(z3+z2+1)·(z2+z+1)=z2+1 since (z3+z2+1)·(z2+z+1)=z5+z+1 and

(z5+z+1)mod(z4+z+1)=z2+1.

(iv) Inversion:(z3+z2+1)−1=z2since(z3+z2+1)·z2mod(z4+z+1)=1.

Example 2.3(isomorphic fields) There are three irreducible binary polynomials of de-gree 4, namely f1(z)=z4+z+1, f2(z)=z4+z3+1 and f3(z)=z4+z3+z2+z+1.

Each of these reduction polynomials can be used to construct the fieldF24; let’s call the resulting fieldsK1,K2andK3. The field elements ofK1,K2andK3are the same 16 binary polynomials of degree at most 3. Superficially, these fields appear to be dif-ferent, e.g.,z3·z=z+1 in K1,z3·z=z3+1 in K2, and z3·z=z3+z2+z+1 in K3. However, all fields of a given order are isomorphic—that is, the differences are only in the labeling of the elements. An isomorphism betweenK1andK2may be con-structed by findingcK2 such that f1(c)≡0 (mod f2)and then extending zc to an isomorphismϕ:K1K2; the choices forcarez2+z,z2+z+1,z3+z2, and z3+z2+1.

Extension fields

The polynomial basis representation for binary fields can be generalized to all exten-sion fields as follows. Let p be a prime andm ≥2. Let Fp[z]denote the set of all polynomials in the variablezwith coefficients fromFp. Let f(z), thereduction poly-nomial, be an irreducible polynomial of degreeminFp[z]—such a polynomial exists for any pandmand can be efficiently found (see §A.1). Irreducibility of f(z)means that f(z)cannot be factored as a product of polynomials inFp[z]each of degree less thanm. The elements ofFpm are the polynomials inFp[z]of degree at mostm−1:

Fpm = {am−1zm−1+am−2zm−2+ ··· +a2z2+a1z+a0 : ai ∈Fp}.

Addition of field elements is the usual addition of polynomials, with coefficient arith-metic performed in Fp. Multiplication of field elements is performed modulo the polynomial f(z).

Example 2.4(an extension field) Letp=251 andm=5. The polynomial f(z)=z5+ z4+12z3+9z2+7 is irreducible inF251[z]and thus can serve as reduction polynomial for the construction ofF2515, the finite field of order 2515. The elements ofF2515 are the polynomials inF251[z]of degree at most 4.

The following are some examples of arithmetic operations inF2515. Leta=123z4+ 76z2+7z+4 andb=196z4+12z3+225z2+76.

(i) Addition:a+b=68z4+12z3+50z2+7z+80.

(ii) Subtraction:ab=178z4+239z3+102z2+7z+179.

(iii) Multiplication:a·b=117z4+151z3+117z2+182z+217.

(iv) Inversion:a−1=109z4+111z3+250z2+98z+85.

Subfields of a finite field

A subset k of a field K is a subfield of K if k is itself a field with respect to the operations of K. In this instance, K is said to be anextension fieldofk. The subfields of a finite field can be easily characterized. A finite fieldFpmhas precisely one subfield of orderplfor each positive divisorlofm; the elements of this subfield are the elements a∈Fpm satisfyingapl =a. Conversely, every subfield ofFpm has order pl for some positive divisorlofm.

Bases of a finite field

The finite fieldFqn can be viewed as a vector space over its subfieldFq. Here, vectors are elements ofFqn, scalars are elements ofFq, vector addition is the addition operation inFqn, and scalar multiplication is the multiplication inFqn ofFq-elements withFqn -elements. The vector space has dimensionnand has many bases.

IfB= {b1,b2,...,bn}is a basis, thena∈Fqncan be uniquely represented by an n-tuple(a1,a2,...,an)ofFq-elements wherea=a1b1+a2b2+···+anbn. For example, in the polynomial basis representation of the fieldFpm described above,Fpm is an m-dimensional vector space overFpand{zm−1,zm−2,...,z2,z,1}is a basis forFpm over Fp.

Multiplicative group of a finite field

The nonzero elements of a finite field Fq, denoted Fq, form a cyclic group under multiplication. Hence there exist elementsb∈Fq calledgeneratorssuch that

Fq= {bi:0≤iq−2}.

Theorder ofa∈Fq is the smallest positive integert such that at =1. Since Fq is a cyclic group, it follows thatt is a divisor ofq−1.

Dans le document Guide to Elliptic Curve Cryptography (Page 46-50)