You are on page 1of 94

Mathematical Foundations

Module-2
Topics to be discussed
 Number Theory and Finite Fields

 Principles of Pseudorandom Number Generation

 Fermat’s and Euler’s Theorems,

 The Chinese Remainder Theorem,

 Discrete Logarithms,

 Elliptic Curve Arithmetic

2 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Number Theory and Finite Fields
 Divisibility and The Division Algorithm
 The Euclidean Algorithm
 Modular Arithmetic
 Groups, Rings, and Fields
 Finite Fields of the Form GF(p)
 Polynomial Arithmetic
 Finite Fields of the Form GF(2n)

3 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


INTEGER ARITHMETIC
 In integer arithmetic, we use a set and a few operations.
 You are familiar with this set and the corresponding operations,
but they are reviewed here to create a background for modular
arithmetic.
Topics discussed in this section:
 Set of Integers
 Binary Operations
 Integer Division
 Divisibility
 Euclidean Algorithm

4 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Set of Integers

 The set of integers, denoted by Z, contains all integral numbers


(with no fraction) from negative infinity to positive infinity.

5 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Binary Operations
 In cryptography, we are interested in three binary operations applied
to the set of integers.
 A binary operation takes two inputs and creates one output.

Three binary operations for the set of integers


6 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT
Binary Operations
 The following shows the results of the three binary operations
on two integers.

 Because each input can be either positive or negative, we can


have four cases for each operation.

7 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Integer Division
 In integer arithmetic, if we divide a by n, we can get q and r.
 The relationship between these four integers can be shown as

a=q×n+r

8 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Integer Division
 Assume that a = 255 and n = 11.
 We can find q = 23 and r = 2 using the division algorithm.

9 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Integer Division
 Division algorithm for integers

10 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Integer Division
 When we use a computer or a calculator, r and q are negative
when a is negative.
 How can we apply the restriction that r needs to be positive?

 The solution is simple, we decrement the value of q by 1 and we add


the value of n to r to make it positive.

11 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Integer Division
 Graph of division algorithm

12 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Divisibility
 If a is not zero and we let r = 0 in the division relation, we get

a=q×n

 If the remainder is zero,


 If the remainder is not zero,

13 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Divisibility
 The integer 4 divides the integer 32 because 32 = 8 × 4.
 We show this as

 The number 8 does not divide the number 42 because


42 = 5 × 8 + 2.
 There is a remainder, the number 2, in the equation.
 We show this as

14 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Divisibility
 Properties

Property 1: if a|1, then a = ±1.

Property 2: if a|b and b|a, then a = ±b.

Property 3: if a|b and b|c, then a|c.

Property 4: if a|b and a|c, then


a|(m × b + n × c), where m
and n are arbitrary integers

15 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Divisibility

16 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Divisibility

Fact 1: The integer 1 has only one divisor, itself.

Fact 2: Any positive integer has at least two divisors, 1


and itself (but it can have more).

17 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Common divisors of two integers
Greatest Common Divisor (GCD)

18 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Common divisors of two integers
Greatest Common Divisor (GCD)
 The greatest common divisor of two positive integers is the
largest integer that can divide both integers.
 GCD (a,b) of a and b is the largest integer that divides evenly into
both a and b
eg GCD(60,24) = 12
 Define gcd(0, 0) = 0
 often want no common factors (except 1) define such numbers as
relatively prime
 eg GCD(8,15) = 1
 hence 8 & 15 are relatively prime

19 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Greatest Common Divisor (GCD)

 Euclidean Algorithm

Fact 1: gcd (a, 0) = a


Fact 2: gcd (a, b) = gcd (b, r), where r is
the remainder of dividing a by b

20 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Euclidean Algorithm

When gcd (a, b) = 1, we say that a and b are


relatively prime.
21 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT
Euclidean Algorithm: (GCD)
 Find the greatest common divisor of 25 and 60.
 Solution:We have gcd (25, 60) = 5.

22 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Euclidean Algorithm: (GCD)
 Find the greatest common divisor of 2740 and 1760.
 Solution:We have gcd (2740, 1760) = 20.

23 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Euclidean Algorithm: (GCD)
GCD(1160718174, 316258250)
 Dividend Divisor Quotient Remainder
 a = 1160718174 b = 316258250 q1 = 3 r1 = 211943424
 b = 316258250 r1 = 211943424 q2 = 1 r2 = 104314826
 r1 = 211943424 r2 = 104314826 q3 = 2 r3 = 3313772
 r2 = 104314826 r3 = 3313772 q4 = 31 r4 = 1587894
 r3 = 3313772 r4 = 1587894 q5 = 2 r5 = 137984
 r4 = 1587894 r5 = 137984 q6 = 11 r6 = 70070
 r5 = 137984 r6 = 70070 q7 = 1 r7 = 67914
 r6 = 70070 r7 = 67914 q8 = 1 r8 = 2156
 r7 = 67914 r8 = 2156 q9 = 31 r9 = 1078
 r8 = 2156 r9 = 1078 q10 = 2 r10 = 0

24 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Euclidean Algorithm: (GCD)
Example GCD(1970,1066)
 1970 = 1 x 1066 + 904 gcd(1066, 904)
 1066 = 1 x 904 + 162 gcd(904, 162)
 904 = 5 x 162 + 94 gcd(162, 94)
 162 = 1 x 94 + 68 gcd(94, 68)
 94 = 1 x 68 + 26 gcd(68, 26)
 68 = 2 x 26 + 16 gcd(26, 16)
 26 = 1 x 16 + 10 gcd(16, 10)
 16 = 1 x 10 + 6 gcd(10, 6)
 10 = 1 x 6 + 4 gcd(6, 4)
6=1x4+2 gcd(4, 2)
4=2x2+0 gcd(2, 0)

25 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Extended Euclidean Algorithm

 Given two integers a and b, we often need to find other two


integers, s and t, such that

 The extended Euclidean algorithm can calculate the gcd (a, b)


and at the same time calculate the value of s and t.

26 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Extended Euclidean Algorithm

27 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Extended Euclidean Algorithm

28 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Extended Euclidean Algorithm
 Given a = 161 and b = 28, find gcd (a, b) and the values of s and t.
 Solution:We get gcd (161, 28) = 7, s = −1 and t = 6.

29 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Extended Euclidean Algorithm
 Given a = 17 and b = 0, find gcd (a, b) and the values of s
and t.
 Solution: We get gcd (17, 0) = 17, s = 1, and t = 0.

30 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Extended Euclidean Algorithm
 Given a = 0 and b = 45, find gcd (a, b) and the values of s
and t.
 Solution: We get gcd (0, 45) = 45, s = 0, and t = 1.

31 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


MODULAR ARITHMETIC
 The division relationship (a = q × n + r) discussed in the previous
section has two inputs (a and n) and two outputs (q and r).
 In modular arithmetic, we are interested in only one of the outputs,
the remainder r.
Topics discussed in this section:
 Modular Operator
 Set of Residues
 Congruence
 Operations in Zn
 Addition and Multiplication Tables
 Different Sets

32 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Modulo Operator
 The modulo operator is shown as mod.
 The second input (n) is called the modulus.
 The output r is called the residue.

Division algorithm and modulo operator

33 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Modulo Operator
Find the result of the following operations:
a. 27 mod 5 b. 36 mod 12
c. −18 mod 14 d. −7 mod 10

Solution
a. Dividing 27 by 5 results in r = 2
b. Dividing 36 by 12 results in r = 0.
c. Dividing −18 by 14 results in r = −4. After adding the
modulus r = 10
d. Dividing −7 by 10 results in r = −7. After adding the modulus
to −7, r = 3.

34 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Set of Residues
 The modulo operation creates a set, which in modular
arithmetic is referred to as the set of least residues modulo n,
or Zn.

Some Zn sets

35 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Congruence
 To show that two integers are congruent, we use the
congruence operator ( ≡ ).

 For example, we write:

36 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Congruence

37 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Operation in Zn
 The three binary operations that we discussed for the set Z
can also be defined for the set Zn.
 The result may need to be mapped to Zn using the mod
operator.

38 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Operation in Zn
Perform the following operations (the inputs come from Zn):
 Add 7 to 14 in Z15
 Subtract 11 from 7 in Z13
 Multiply 11 by 7 in Z20
 Solution:

39 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Operation in Zn
 Properties
1. [(a mod n) + (b mod n)] mod n = (a + b) mod n
2. [(a mod n) – (b mod n)] mod n = (a – b) mod n
3. [(a mod n) x (b mod n)] mod n = (a x b) mod n

Example
[(11 mod 8) + (15 mod 8)] mod 8 = 10 mod 8 = 2 ; (11 + 15) mod 8 = 26 mod 8 = 2
[(11 mod 8) – (15 mod 8)] mod 8 = –4 mod 8 = 4 ; (11 – 15) mod 8 = –4 mod 8 = 4
[(11 mod 8) x (15 mod 8)] mod 8 = 21 mod 8 = 5 ; (11 x 15) mod 8 = 165 mod 8 = 5

40 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Operation in Zn

41 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Operation in Zn
 The following shows the application of the above properties:

 (1,723,345 + 2,124,945) mod 11 = (8 + 9) mod 11 = 6

 (1,723,345 − 2,124,945) mod 16 = (8 − 9) mod 11 = 10

 (1,723,345 × 2,124,945) mod 16 = (8 × 9) mod 11 = 6

42 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Operation in Zn
 In arithmetic, we often need to find the remainder of powers
of 10 when divided by an integer.

43 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses

 When we are working in modular arithmetic, we often need to


find the inverse of a number relative to an operation.

We are normally looking for


 An additive inverse (relative to an addition operation) or
 A multiplicative inverse (relative to a multiplication operation).

44 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Additive
 In Zn, two numbers a and b are additive inverses of each other
if

In modular arithmetic, each integer has an additive


inverse.
The sum of an integer and its additive inverse is
congruent to 0 modulo n.

45 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Additive

 Find all additive inverse pairs in Z10.

Solution:
 The six pairs of additive inverses are
(0, 0), (1, 9), (2, 8), (3, 7), (4, 6), and (5, 5).

46 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative
 In Zn, two numbers a and b are the multiplicative inverse of
each other if

In modular arithmetic, an integer may or may


not have a multiplicative inverse.
When it does, the product of the integer and
its multiplicative inverse is congruent to
1 modulo n.

47 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative
 Find the multiplicative inverse of 8 in Z10.
Solution
 There is no multiplicative inverse because gcd (10, 8) = 2 ≠ 1.
 In other words, we cannot find any number between 0 and 9 such
that when multiplied by 8, the result is congruent to 1.

 Find all multiplicative inverses in Z10.


Solution
 There are only three pairs: (1, 1), (3, 7) and (9, 9).
 The numbers 0, 2, 4, 5, 6, and 8 do not have a multiplicative inverse.

48 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative

The extended Euclidean algorithm finds the


multiplicative inverses of b in Zn when n and b
are given and
gcd (n, b) = 1.
The multiplicative inverse of b is the value of t
after being mapped to Zn.

49 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative
 Using extended Euclidean algorithm to find multiplicative
inverse

50 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative
 Find the multiplicative inverse of 11 in Z26.
 Solution

 The gcd (26, 11) is 1; the inverse of 11 is -7 or 19

51 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative
 Find the multiplicative inverse of 23 in Z100.
 Solution

 The gcd (100, 23) is 1; the inverse of 23 is -13 or 87.

52 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Inverses: Multiplicative
 Find the inverse of 12 in Z26.
 Solution

 The gcd (26, 12) is 2; the inverse does not exist.

53 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Addition and Multiplication Tables

54 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Different Sets

We need to use Zn when additive inverses are


needed;
we need to use Zn* when multiplicative inverses
are needed.

55 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


ALGEBRAIC STRUCTURES
 Cryptography requires sets of integers and specific operations
that are defined for those sets.
 The combination of the set and the operations that are applied
to the elements of the set is called an algebraic structure.
 In this section, we will define three common algebraic
structures:
 Groups,

 Rings,

 Fields.

56 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


ALGEBRAIC STRUCTURES

57 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups
 A group (G) is a set of elements with a binary operation (•)
that satisfies four properties (or axioms).
1. Closure : if a,b are in G, then a•b in G
2. Associativity : if a,b,c are in G, then (a•b) •c = a• (b•c)
3. Commutativity : For all a and b in G, a•b = b•a (Abelian G)
4. Existence of identity: For all a in G, there is an identity element
(e), such that e•a = a•e = a
5. Existence of inverse: For each a in G, there is an element a’
called inverse of a, such that a•a’= a’•a = e
 A commutative group (Abelian Group) satisfies an extra property,
commutativity.

58 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups

59 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups: Application
 Although a group involves a single operation, the properties
imposed on the operation allow the use of a pair of operations
as long as they are inverses of each other.
Example:1
 The set of residue integers with the addition operator,
G = < Zn , +>
 is a commutative group.
 We can perform addition and subtraction on the elements of
this set without moving out of the set.

60 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups: Application
Example:2
 The set Zn* with the multiplication operator, G = <Zn*, ×>, is
also an abelian group.

 Let us define a set G = < {a, b, c, d}, •> and the operation as
shown in Table below.

61 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups: Sub Group
 Is the group H = <Z10, +> a subgroup of the group G = <Z12,
+>?
Solution:
 The answer is no.
 Although H is a subset of G, the operations defined for these
two groups are different.
 The operation in H is addition modulo 10; the operation in G
is addition modulo 12.

62 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups: Cyclic Subgroups

 If a subgroup of a group can be generated using the power of


an element, the subgroup is called the cyclic subgroup.

63 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups: Cyclic Subgroups
 Four cyclic subgroups can be made from the group G = <Z6, +>.
 They are H1 = <{0}, +>, H2 = <{0, 2, 4}, +>, H3 = <{0, 3}, +>, and H4 =
G.

64 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Groups: Cyclic Subgroups
 Three cyclic subgroups can be made from the group
G = <Z*10, X>.
 G has only four elements: 1, 3, 7, and 9.
 The cyclic subgroups are H1 = <{1}, ×>, H2 = <{1, 9}, ×>, and H3 = G.

65 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Ring
 A set of “numbers” with two operations (addition and
multiplication) which form:
 An abelian group with addition operation and multiplication:
 has closure
 is associative
 distributive over addition: a(b+c) = ab + ac
 If multiplication operation is commutative, it forms a
commutative ring
 If multiplication operation has an identity and no zero divisors,
it forms an integral domain

66 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Ring
 The set Z with two operations, addition and multiplication, is a
commutative ring.
 We show it by R = <Z, +, ×>.
 Addition satisfies all of the five properties
 Multiplication satisfies only three properties.

67 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Ring
 A ring, R = <{…}, •, >, is an algebraic structure with two
operations.

68 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Field
 A set of numbers
 with two operations which form:
 abelian group for addition
 abelian group for multiplication (ignoring 0)
 ring
 have hierarchy with more axioms/laws
 Group -> Ring -> Field

69 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Field
 A field, denoted by F = <{…}, •, > is a commutative ring in
which the second operation satisfies all five properties defined
for the first operation except that the identity of the first
operation has no inverse.

70 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Group, Ring, Field

71 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Finite (Galois) Fields
 Galois showed that for a field to be finite, the number of
elements should be pn, where p is a prime and n is a positive
integer.
 Denoted as GF(pn)
 In particular often use the fields:
 GF(p)
 GF(2n)

A Galois field, GF(pn), is a finite field with


pn elements.
72 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT
Finite (Galois) Fields
 GF(p) is the set of integers {0,1, … , p-1} with arithmetic
operations modulo prime p

 These form a finite field


 Since they have multiplicative inverses
 Inverse can be found with Extended Euclidean algorithm

 Hence arithmetic is “well-behaved” and can do addition,


subtraction, multiplication, and division without leaving the field
GF(p)

73 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Finite (Galois) Fields: GF(p) Fields
 When n = 1, we have GF(p) field.
 This field can be the set Zp, {0, 1, …, p − 1}, with two arithmetic
operations.
Example:
 A very common field in this category is GF(2) with the set {0, 1} and
two operations, addition and multiplication.

74 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Finite (Galois) Fields: GF(p) Fields
Example:
 We can define GF(5) on the set Z5 (5 is a prime) with addition and
multiplication operators

75 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Finite (Galois) Fields: GF(p) Fields

Summary

76 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


GF(2n) FIELDS
 In cryptography, we often need to use four operations
(addition, subtraction, multiplication, and division).
 In other words, we need to use fields.
 We can work in GF(2n) and uses a set of 2n elements.
 The elements in this set are n-bit words.

Topics discussed in this section:


 Polynomials (Polynomial Arithmetic)
 Using a Generator

77 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


GF(2n) FIELDS : Polynomial Arithmetic
 Let us define a GF(22) field in which the set has four 2-bit
words: {00, 01, 10, 11}.
 We can redefine addition and multiplication for this field in
such a way that all properties of these operations are satisfied

78 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


GF(2n) FIELDS : Polynomial Arithmetic
 It can be computed using polynomials
 A polynomial of degree n − 1 is an expression of the form

 where xi is called the ith term and ai is called coefficient of the


ith term.
Several alternatives available:
 ordinary polynomial arithmetic
 poly arithmetic with coefs mod p
 poly arithmetic with coefs mod p and polynomials mod m(x)

79 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


GF(2n) FIELDS : Polynomial Arithmetic
 we can represent the 8-bit word (10011001) using a
polynomials.

80 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


GF(2n) FIELDS : Polynomial Arithmetic

 To find the 8-bit word related to the polynomial x5 + x2 + x, we


first supply the omitted terms.
 Since n = 8, it means the polynomial is of degree 7.
 The expanded polynomial is

 This is related to the 8-bit word 00100110.

81 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic Operations
 It involves two operations:
 Operation on Coefficients
 Operation on two Polynomials
 I.e we have to define two Fields, one for coefficients and one
for the polynomial
 Since Coefficients are made of 0 or 1 we use GF(2) field
 For the Polynomials we use GF(2n) field

Polynomials representing n-bit words use two


fields: GF(2) and GF(2n).
82 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT
Ordinary Polynomial Arithmetic
 Add or subtract corresponding coefficients
 multiply all terms by each other
 Example:
 let f(x) = x3 + x2 + 2 and g(x) = x2 – x + 1
 f(x) + g(x) = x3 + 2x2 – x + 3
 f(x) – g(x) = x3 + x + 1
 f(x) x g(x) = x5 + 3x2 – 2x + 2

83 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Modulus

 Addition of two polynomials doesn’t create a polynomial out of a


set.
 But, in multiplication of two polynomials it may create a polynomial
out of a set with degree more than n-1.
 For the sets of polynomials in GF(2n), a group of polynomials of
degree n is defined as the modulus.
 The modulus in this case act as a prime polynomial
 Such polynomials are referred to as irreducible polynomials.

84 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Modulus

 List of irreducible polynomials:

85 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Addition

Addition and subtraction operations on


polynomials are the same operation.

86 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Addition
 Let us do (x5 + x2 + x)  (x3 + x2 + 1) in GF(28).
 We use the symbol  to show that we mean polynomial
addition.
 The following shows the procedure:

87 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Addition
 There is also another short cut. Because the addition in GF(2)
means the exclusive-or (XOR) operation.
 So we can exclusive-or the two words, bits by bits, to get the
result.
 In the previous example,
 x5 + x2 + x is 00100110
 x3 + x2 + 1 is 00001101.
 The result is 00101011 or
 in polynomial notation x5 + x3 + x + 1.

88 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Multiplication

1. The coefficient multiplication is done in GF(2).

2. Multiplying xi by xj results in xi+j.

3. The multiplication may create terms with degree more than


n − 1, which means the result needs to be reduced using a
modulus polynomial.

89 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Multiplication
 Find the result of (x5 + x2 + x) ⊗ (x7 + x4 + x3 + x2 + x) in GF(28)
with irreducible polynomial (x8 + x4 + x3 + x + 1).
 Note that we use the symbol ⊗ to show the multiplication of two
polynomials.
 Solution:

 To find the final result, divide the polynomial of degree 12 by the


polynomial of degree 8 (the modulus) and keep only the remainder.

90 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Multiplication
 Polynomial division with coefficients in GF(2)

91 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Multiplication
 Example:
 In GF (24), find the inverse of (x2 + 1) modulo (x4 + x + 1).
Solution
 The answer is (x3 + x + 1) as shown in
Euclidean algorithm

[(x2 + 1) ⊗ (x3 + x + 1)] mod (x4 + x + 1)=1

92 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT


Polynomial Arithmetic : Multiplication
 Example:
 In GF(28), find the inverse of (x5) modulo (x8 + x4 + x3 + x + 1).
Solution
 The answer is (x5 + x4 + x3 + x) as shown in

Euclidean algorithm

[(x5) ⊗ (x5 + x4 + x3 + x)] mod (x8 + x4 + x3 + x + 1)=1


93 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT
Summary

 The finite field GF(2n) can be used to define four operations of


addition, subtraction, multiplication and division over n-bit
words.

 The only restriction is that division by zero is not defined.

94 Dr. R.K.Mugelan, Asst. Prof. (Sr), SENSE, VIT

You might also like