Download presentation
Presentation is loading. Please wait.
1
Mathematical Background: Extension Fields
Network Security Design Fundamentals ET-IDA-082 Tutorial-4 Mathematical Background: Extension Fields , v24 Prof. W. Adi
2
Irreducible Polynomials and extension Fields GF(2m)
g(x) is called Irreducible Polynomial of degree m over GF(2) where ai GF(2) and Factorization is not possible over GF(2) g(x) = The period e of g(x) is the smallest e such that xe = [mod g(x)] e is actually the order of x modulo g(x). e divides 2m -1 If e = 2m -1 the the polynomial is called primitive The reciprocal polynomial is defined as g*(x) = xn g(1/x) The period of the reciprocal polynomial g*(x) is equal to that of g(x) GF (2m ) The ring of polynomials Zg(x) modulo an irreducible polynomial of degree m over GF(2) is an extension field with 2m elements The order of any element in GF(2m) is a divisor of 2m -1 (Lagrange theorem)
3
Problem 4-1: Polynomials over a field
Give the corresponding vector representation of the polynomials 1 + x2 + x5 + x9 1 + x3 + x8 + x12 x2 + x5 + x7 x + x9 + x10 1 + x8 1 + x + x2 + x3+ x4 + x5 + x6 + x7 Solution 4-1: LSB MSB 1 + x2 + x5 + x = 1 + x3 + x8 + x = x2 + x5 + x = x + x9 + x = 1 + x = 1 + x + x2 + x3+ x4 + x5 + x6 + x7 =
4
Problem 4-2: Polynomials over a field
Compute the following polynomial products over GF(2) (1 + x2 ) (1 + x2 + x5 ) (x3 + x4)(1 + x3 + x8 + x12) X3 (1 + x3 + x5 + x6) Compute the following polynomial products over GF(3) (1 + 2x2 ) (1 + x2 +2x5 ) (x + 2x3)(1 + 2x3 + x8 + x12) Compute the following polynomial products over GF(7) (2 + 4x2 ) (1 + 3x2 + 5x5 ) (3x + 5x3)(6 + 2x3 + 3x8) Solution 4-2: products over GF(2) (1 + x2 ) (1 + x2 + x5 ) = 1 + x2 + x5 + x2 + x4 + x7 = x2 + x4 + x5 + x7 = 1 + x4 + x5 + x7 (x3 + x4)(1 + x3 + x8 + x12) = x3 + x6 + x11 + x x4 + x7 + x12 + x16 = x3 + x4 + x6 + x7 + x11 + x12 + x15 + x16 X3 (1 + x3 + x5 + x6) = X3 + x6 + x8 + x9
5
Solution 4-2 cont.: products over GF(3)
(1 + 2x2 ) (1 + x2 +2x5 ) = 1 + x2 +2x x2 + 2x4 +4x7 = 1 + 3x x4 +2x5 +4x7 = 1 + 2x4 +2x5 +1x7 (x + 2x3)(1 + 2x3 + x8 + x12) = Products over GF(7) (2 + 4x2 ) (1 + 3x2 + 5x5 ) = 2 + 6x2 +10x5 + 4x2 + 12x4 + 20x7 = x2 +12x4 + 10x x7 = 2 +3x2 + 5x4 + 3x5 + 6x7 (3x2 + 5x3)(6x2 + 2x3 + 3x8) =
6
Problem 4-3: Polynomials division over a finite field
Compute the following polynomial divisions over GF(2) (x12 + x8 + x6 + x2 + 1) (x5+ x2 +1 ) Solution 4-3: ( x12 + x8 + x6 + x2 + 1) ( x5+ x2 +1 ) - (x12 + x9 + x7) x7 + x4 + x3 + x2 + 1 x9 + x8 + x7 + x6+ x2 + 1 Q/x) in GF(2): 1+1=2=0 => 1=-1 =>Addition Is equal to subtraction x9 + x6 + x4 x8 + x7 + x4 + x2 + 1 x8 + x5 + x3 x7 + x5 + x4 + x3 + x2 + 1 x7 + x4 + x2 Remainder of the division R/x) x5 + x x5 + x x3 + x2
7
Solution: Compute gcd [ P1(x) , P2(x) ] = A(x) P1(x) + B(x) P2(x)
Problem 4.4: Find the multiplicative inverse of x + 1 modulo x5 + x3 + 1 Solution: Compute gcd [ P1(x) , P2(x) ] = A(x) P1(x) + B(x) P2(x) if gcd =1, then the inverse is B(x) Extended gcd Algorithm: A2 = A1 – q A2 B2 = B1 – q B2 P1(x) P2(x) A1(x) A2(x) B1(x) B2(x) Qx) R(x) x5 + x3 + 1 x + 1 1 1 x4 + x3 1 0 – (x4 + x3 ). 1= x4 + x3 x + 1 1 x +1 1 1 => (x4 + x3 ) (x + 1 ) modulo (x5 + x3 + 1) x5 + x3 + 1=0 x5 = x3 + 1 Check: (x + 1) (x4 + x3 ) = x5+ x4 + x4 + x3 1 modulo (x5 + x3 + 1)
8
Problem 4-5: Elements order over an extension field
Compute the exponents of the element x over GF(25) which is generated by the irreducible polynomial P(x)= (x5+ x2 +1 ) Solution 4-5: If P(x)= x5+ x2 +1 is the modulus then it is equal to zero That is x5+ x2 +1 = 0 Thus x5 = x2 +1 Let us compute the exponents of x over this field: x = x mod (x5+ x2 +1 ) x2= x mod (x5+ x2 +1 ) x3= x mod (x5+ x2 +1 ) x4= x mod (x5+ x2 +1 ) x5= x mod (x5+ x2 +1 ) x6= x (x2 +1)= x3 +x mod (x5+ x2 +1 ) x7= x (x3 +x) = ( x4 +x2 ) mod (x5+ x2 +1 ) x8= x5 + x3 = x x3 mod (x5+ x2 +1 ) x9= x4 + x3 + x mod (x5+ x2 +1 ) …. x14 = (x7)2 = ( x4 +x2 )2 = x8 + x4 = x3 + x x4 x15 = ( x3 + x x4 ) x = x4 + x3 +x + x5 = x4 + x3 +x + x2 +1 x16 = (x8)2 = ( x3 +x2 +1 )2 = x6 + x4 +1= x3 + x + x4 +1 = Important notice: In GF (25): the order of any element Is a divisor of 25-1=31 Divisors of 31 are 1 and 31 ! => The order can be either 1 or 31 !
9
Problem 4-6: Arithmetic in GF(25)
Given GF(25) generated by the irreducible polynomial g(x) = x5 + x3 + 1 Design a circuit which multiplies any serial data stream I(x) by the inverse of the polynomial p(x)= x + 1 in GF(25). Check the circuit by multiplying (1 + x2 + x3 ) *(x + 1)-1 Solution 4-6: Compute gcd [ g(x) , p(x) ] = A(x) g(x) + B(x) p(x) if gcd =1, then the multiplicative inverse of p(x) is B(x) Extended gcd Algorithm: A2 = A1 – q A2 B2 = B1 – q B2 P1(x) P2(x) A1(x) A2(x) B1(x) B2(x) Qx) R(x) x5 + x3 + 1 x + 1 1 1 x4 + x3 1 0 – (x4 + x3 ). 1 = (x4 + x3 ) x + 1 1 x +1 1 1 => (x + 1 ) -1 (x4 + x3 ) modulo (x5 + x3 + 1) x5 + x3 + 1=0 x5 = x3 + 1 Check: (x + 1) (x4 + x3 ) = x5+ x4 + x4 + x3 1 modulo (x5 + x3 + 1)
10
A circuit which multiplies any serial data stream I(x) by the inverse of the polynomial p(x)= x + 1 that is p(x)-1 = x3 + x4 modulo the irreducible polynomial g(x) = x5 + x3 + 1 (x + 1 ) (x4 + x3 ) LSB .. MSB I(x)= 1 + x2 + x3 = Remainder MSB Check: (1 + x2 + x3)(x4 + x3 ) = x4 + x6 +x7 +x3 + x5 +x6 = x4 + x7 +x3 + x5 = x4 + x2 +1+x3 +x x3 = x4 + x2 +x3 x5 = 1 +x3 x6 = x +x4 x7 = x2 +x5= x2 +1+x3 Remainder LSB x3 x4 r0 r1 r2 + r3 + r4 1 x3 x5 Clocking in the data stream 1011 States before clocking each input Input register state Input register state Input register state Input register state Input x register state g(x) = x5 + x3 + 1 LSB .. MSB Result of multiplication= x2 + x3 +x4
11
Problem 4-7: ad-hoc Class exercise
Select a polynomial as a modulus for GF(28) Compute a primitive element Wich are the possible multiplicative orders in GF(28) How many elements do exist from each possible order Compute other 5 primitive elements Compute one element for each possible multiplicative order Solution 4-7:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.