This chapter presents the following content: Number theory, divisibility & GCD, modular arithmetic with integers, Euclid’s algorithm for GCD & inverse, Group, Ring, Field, finite fields GF(p), polynomial arithmetic in general and in GF(2n).
Data Security and Encryption (CSE348) Lecture # 12 Review – Number Theory – divisibility & GCD – modular arithmetic with integers – Euclid’s algorithm for GCD & Inverse Group • Groups, rings, and fields are the fundamental elements of a branch of mathematics • known as abstract algebra, or modern algebra • In abstract algebra, we are concerned with sets on whose elements we can operate algebraically • That is, we can combine two elements of the set, perhaps in several ways, to obtain a third element of the set Group • These operations are subject to specific rules, which define the nature of the set • By convention, the notation for the two principal classes of operations on set elements • usually the same as the notation for addition and multiplication on ordinary numbers • In abstract algebra, we are not limited to ordinary arithmetical operations Group • A group G, denoted by {G, • }, is a set of elements with a binary operation • Denoted by •, that associates to each ordered pair (a, b) of elements in G an element (a • b) in G • Such that the following axioms are obeyed: – Closure, Associative, Identity element, Inverse element Group • we have used as operator: could be addition +, multiplication x or any other mathematical operator • A group can have a finite (fixed) number of elements, or it may be infinite • Integers (+ve, -ve and 0) using addition form an infinite abelian group • So real umbers using multiplication Group • a set of elements or “numbers” – may be finite or infinite • with some operation whose result is also in the set (closure) • obeys: – associative law: (a.b).c = a.(b.c) – has identity e: e.a = a.e = a – has inverses a-1: a.a-1 = e • if commutative a.b = b.a – then forms an abelian group Cyclic Group • Define exponentiation as repeated application of operator – example: a-3 = a.a.a • and let identity be: e=a0 • a group is cyclic if every element is a power of some fixed element – ie b = ak for some a and every b in group • a is said to be a generator of the group Ring • Next describe a ring We denote a Ring as {R, +,.} • In essence, a ring is a set in which we can addition, subtraction [a – b = a + (–b)] • and multiplication without leaving the set • and which obeys the associative and distributive laws 10 Polynomial GCD • Polynomial division is not allowed unless the coefficients are elements of a field • Next, we discussed polynomial arithmetic in which the coefficients are elements of GF(p) • In this case, polynomial addition, subtraction, multiplication, and division are allowed • However, division is not exact; that is, in general division results in a quotient and a remainder 37 Polynomial GCD • Finally, we showed that the Euclidean algorithm can be extended • To find the greatest common divisor of two polynomials whose coefficients are elements of a field • All of the material in this section provides a foundation • Next the polynomials are used to define finite fields of order pn 38 Polynomial GCD • can find greatest common divisor for polys – c(x) = GCD(a(x), b(x)) if c(x) is the poly of greatest degree which divides both a(x), b(x) • can adapt Euclid’s Algorithm to find it: Euclid(a(x), b(x)) if (b(x)=0) then return a(x); else return Euclid(b(x), a(x) mod b(x)); • all foundation for polynomial fields as see next 39 Modular Polynomial Arithmetic • Consider now the case of polynomial arithmetic with coordinates mod and polynomials mod an irreducible polynomial m(x) • That is Modular Polynomial Arithmetic uses the set S of all polynomials of degree n-1 or less over the field Zp • With the appropriate definition of arithmetic operations, each such set S is a finite field 40 Modular Polynomial Arithmetic • The definition consists of the following elements: Arithmetic follows the ordinary rules of polynomial arithmetic using the basic rules of algebra, with the following two refinements Arithmetic on the coefficients is performed modulo p If multiplication results in a polynomial of degree greater than n-1, then the polynomial is reduced modulo some irreducible polynomial m(x) of degree n That is, we divide by m(x) and keep the remainder 41 Modular Polynomial Arithmetic • This forms a finite field • And just as the Euclidean algorithm can be adapted to find the greatest common divisor of two polynomials • The extended Euclidean algorithm can be adapted to find the multiplicative inverse of a polynomial 42 Modular Polynomial Arithmetic • can compute in field GF(2n) – polynomials with coefficients modulo – whose degree is less than n – hence must reduce modulo an irreducible poly of degree n (for multiplication only) • form a finite field • can always find an inverse – can extend Euclid’s Inverse algorithm to find 43 Using a Generator • Equivalent definition of a finite field • A generator g is an element whose powers generate all non-zero elements – in F have 0, g0, g1, …, gq-2 • Can create generator from root of the irreducible polynomial • Then implement multiplication by adding exponents of generator 44 Computational Considerations • key motivation for using polynomial arithmetic in GF(2n) • That the polynomials can be represented as a bit string • using all possible bit values • and the calculations only use simple common machine instructions – addition is just XOR – and multiplication is shifts & XOR’s 45 Computational Considerations • The shortcut for polynomial reduction comes from the observation • That if in GF(2n) then irreducible poly g(x) has highest term xn • and if compute xn mod g(x) answer is g(x)- xn 46 Computational Considerations • since coefficients are or 1, can represent any such polynomial as a bit string • addition becomes XOR of these bit strings • multiplication is shift & XOR – cf long-hand multiplication • modulo reduction done by repeatedly substituting highest power with remainder of irreducible poly (also shift & XOR) 47 Computational Example • Show here a few simple examples of addition, • multiplication & modulo reduction in GF(2 3) • The long form modulo reduction finds p(x)=q(x).m(x)+r(x) with r(x) being the desired remainder 48 Computational Example • In GF(23) have (x2+1) is 1012 & (x2+x+1) is 1112 • so addition is – (x2+1) + (x2+x+1) = x – 101 XOR 111 = 0102 • and multiplication is – (x+1).(x2+1) = x.(x2+1) + 1.(x2+1) = x3+x+x2+1 = x3+x2+x+1 – 011.101 = (101)