Computation in Finite Fields
Total Page:16
File Type:pdf, Size:1020Kb
Computation in finite fields John Kerl Arizona State University and Lockheed Martin Corporation April, 2004 Abstract Elementary techniques for computation in finite fields are presented, at a level appropriate for an engi- neering, computer science or mathematical audience. Second, elementary Galois theory for finite fields is presented at a level appropriate for undergraduate or beginning graduate students in mathematics. For the latter, illustrative properties of a novel logarithmic root chart are developed. Third, linear feedback shift registers are presented in a manner which connects mathematical theory and engineering practice. Fourth, some techniques for software implementation are outlined: using a computer algebra system for the general case, and in C for the p = 2 case. This paper is an elaboration on lecture notes for a talk given to the Arizona State University Math Department's Graduate Student Seminar Series in fall of 2003. Some software-related updates were made January 2013. Contents Contents i 1 Introduction 1 1.1 Purpose . 1 1.2 Context . 1 1.3 Scope . 1 1.4 Audience . 2 1.5 Rings and fields; notation . 3 I Arithmetic 4 2 The field Fp 5 2.1 Elements of Fp ............................................ 5 2.2 Arithmetic in Fp ........................................... 6 2.3 First reciprocation method in Fp .................................. 6 2.4 Second reciprocation method in Fp ................................. 6 2.5 Third reciprocation method in Fp .................................. 7 2.6 Repeated-squaring algorithm for exponentiation . 7 2.7 Fourth reciprocation method in Fp; logarithms . 8 3 The field Fpn 10 3.1 Field characteristic and prime subfield . 10 3.2 Existence of Fpn ........................................... 10 3.3 Computation in Fp[x] ........................................ 11 3.4 Simple determination of irreducibles in Fp[x] ........................... 13 3.5 Elements of Fpn ............................................ 14 3.6 Addition, subtraction and multiplication in Fpn .......................... 15 3.7 Primitivity in Fpn .......................................... 16 3.8 Powers of u and LFSRs . 16 3.9 First reciprocation method in Fpn .................................. 17 3.10 Second reciprocation method in Fpn ................................ 17 3.11 Third reciprocation method in Fpn ................................. 18 3.12 Fourth reciprocation method in Fpn ; logarithms . 18 II Galois theory 20 n 4 The universal polynomial xp − x 21 4.1 Reducibility of the universal polynomial over Fp ......................... 21 i 4.2 Fpn as a splitting field . 21 4.3 The root chart . 22 5 Basic Galois theory for Fpn 23 5.1 Subfields . 23 5.2 Frobenius automorphisms . 24 5.3 Galois group and Frobenius orbits . 24 5.4 Characteristic and minimal polynomials . 25 5.5 Conjugates . 26 5.6 Orders and logs . 26 5.7 Two definitions of \generator" . 26 5.8 The irreducible-count and primitive-count formulae . 27 5.9 The Galois correspondence . 28 5.10 Field isomorphisms . 28 5.11 Embeddings and unembeddings . 29 5.12 Composite fields . 30 5.13 Algebraic closure of Fp ........................................ 30 6 Multiple extensions 31 6.1 Minimal polynomials over intermediate fields . 31 6.2 Double-compact notation . 32 6.3 Second example for intermediate fields . 33 III Algorithms 37 7 Blankinship's algorithm for extended GCD 38 8 Shanks algorithm for discrete logs in a cyclic group 40 9 How to find primitive elements of Fp 41 10 How to find irreducible polynomials in Fp[x] 42 10.1 Universal-polynomial algorithm . 42 10.2 Derivative test for multiple factors . 43 10.3 One pass of Berlekamp's algorithm . 43 10.4 All-irreducibles algorithm . 43 11 How to find primitive polynomials in Fp[x] 45 12 Factoring in Fp[x] and Fpn [x] 46 12.1 Recursion . 46 12.2 Squarefree preparation . 46 12.3 Berlekamp's algorithm . 47 13 How to construct a root chart 48 IV Software implementation 49 14 Computing with finite fields in GP 50 14.1 Fp inGP ............................................... 50 14.2 Fpn inGP............................................... 51 ii 14.3 Multiple extensions in GP . 51 15 p = 2 in C 54 15.1 Hexadecimal notation . 54 15.2 I/O . 55 15.3 Word sizes . 56 15.4 Signed vs. unsigned . 57 15.5 Representation of integers . 57 15.6 Integer arithmetic . 57 15.7 Bit numbering in C . 58 15.8 Representation of polynomials . 59 15.9 Addition using XOR . 59 15.10Scalar multiplication using AND . 60 15.11Bit-manipulation paradigms . 60 15.12Field multiplication using shifts and XORs . 61 15.13Repeated squaring . 62 15.14Reciprocation and division . 63 15.15Arithmetic with implicit leading one . 63 15.16Polynomial basis vs. log domain . 63 V Linear feedback shift registers 64 16 Linear feedback shift registers 65 16.1 The physical setup . 65 16.2 Non-autonomous LFSRs . 66 16.3 Fibonacci and Galois configurations . 66 16.4 The transition graph . 66 16.5 The transition matrix . 67 16.6 Singular transformations . 68 16.7 Non-singular transformations . 68 16.8 Reducible LFSRs . 69 16.9 Irreducible LFSRs . 69 16.10Primitive LFSRs . 69 16.11Misc. note . 70 VI Appendices 71 A Tables 72 A.1 Tables of some irreducible polynomials in Fp[x].......................... 72 A.2 Some primitive irreducible polynomials in F2n ........................... 73 A.3 Some logarithm tables for Fpn .................................... 73 B Storage representations 76 C Proofs 77 C.1 Characteristic and order of finite fields . 77 C.2 Existence of finite fields . 78 C.3 Uniqueness of finite fields . 78 C.4 Cyclicity of finite subgroup of a field . 78 C.5 Existence of reciprocals in Fp .................................... 78 iii × C.6 Cyclicity of Fp ............................................ 78 C.7 Galois group of finite fields . 78 C.8 Correctness of Berlekamp's algorithm . 79 VII Bibliography and Index 80 Bibliography . 81 Index . 83 iv Chapter 1 Introduction 1.1 Purpose Finite fields are often given a brief treatment in algebra courses, and when they are discussed, they are discussed in the abstract. This is in fact a testament to the power of theory: Many properties may be deduced about finite fields using no other information than that they are fields and that they are finite. However, specific computations are interesting as well as useful. This paper will present elementary techniques that are.