Finite Fields
Finite Fields
Finite Fields
Number Theory
Divisibility:
𝑏|𝑎, 𝑏 is adevisor of 𝑎: 𝑎 = 𝑚𝑏
Examples: 7|0, 5|10, −5|10
∀𝑏 ≠ 0, 𝑏|0,
If 𝑎|𝑏 and 𝑏|𝑐 then 𝑎|𝑐
If 𝑏|𝑔 and 𝑏|ℎ then 𝑏|(𝑚𝑔 + 𝑛ℎ) for arbitrary integers 𝑚 and 𝑛.
The Division Algorithm/Theorem
If we divide 𝑎 ≥ 0 by 𝑛 > 0, then 𝑎 = 𝑞𝑛 + 𝑟, 0 ≤ 𝑟 < 𝑛; 𝑞 = ⌊𝑎/𝑛⌋
The Euclidean Algorithm
Relative Prime:
Two integers are relatively prime if and only if their only common positive integer factor is 1.
𝑎 and 𝑏 are relatively prime if gcd 𝑎, 𝑏 = 1
Greatest Common Divisor: 𝒈𝒄𝒅()
gcd 𝑎, 𝑏 = gcd 𝑎 , 𝑏 = 𝑚 → 𝑎 = 𝑚𝑎′ 𝑎𝑛𝑑 𝑏 = 𝑚𝑏′
∴ gcd 0,0 = 0
If gcd 𝑎, 𝑏 = 𝑐 and 𝑘|𝑎 and 𝑘|𝑏 then 𝑘|𝑐
gcd 𝑎, 0 = 𝑎
The Euclidean Algorithm: It is a simple procedure for calculating the 𝒈𝒄𝒅(𝒂, 𝒃).
The Euclidean Algorithm
Modular Arithmetic
Euclid(a,b):
if (b=0) then return a;
else return Euclid(b, a mod b);
The Extended Euclidean Algorithm
𝑟−1 = 𝑎 = 𝑞1 𝑏 + 𝑟1
𝑟0 = 𝑏 = 𝑞2 𝑟1 + 𝑟2
𝑟1 = 𝑞3 𝑟2 + 𝑟3
𝑟𝑛−2 = 𝑞𝑛 𝑟𝑛−1 + 𝑟𝑛
𝑟𝑛−1 = 𝑞𝑛+1 𝑟𝑛 + 0
The Extended Euclidean Algorithm
𝑎
⌊ ⌋ 𝑎 𝑚𝑜𝑑 𝑏 = 𝑟1
𝑏
𝑟0 = 𝑏 = 𝑞2 𝑟1 + 𝑟2 𝑟2 = 𝑎𝑥2 + 𝑏𝑦2
𝑟1 = 𝑞3 𝑟2 + 𝑟3 𝑟3 = 𝑎𝑥3 + 𝑏𝑦3
𝑟𝑛−1 = 𝑞𝑛+1 𝑟𝑛 + 0
The Extended Euclidean Algorithm
𝑎
⌊ ⌋ 𝑎 𝑚𝑜𝑑 𝑏 = 𝑟1
𝑏
𝑟1 = 𝑞3 𝑟2 + 𝑟3 𝑟3 = 𝑎𝑥3 + 𝑏𝑦3
𝑟𝑛−1 = 𝑞𝑛+1 𝑟𝑛 + 0
The Extended Euclidean Algorithm
An integer 𝑝 > 1 is a prime number if and only if its only divisors are ±1 and
± 𝑝.
All numbers other than ±1 and the prime numbers are composite numbers.
Any integer 𝑎 > 1 can be factored in a unique way as
𝑎 𝑎 𝑎
𝑎 = 𝑝1 1 × 𝑝2 2 × ⋯ × 𝑝𝑡 𝑡 = ෑ 𝑝𝑎𝑝 where each 𝑎𝑝 ≥ 0
𝑝∈P
where 𝑝1 < 𝑝2 < ⋯ < 𝑝𝑡 are prime numbers and 𝑎𝑖 is a positive integer
Fermat’s Theorem
If 𝑎 is a positive integer and 𝑝 is a prime number and 𝑝 ∤ 𝑎 (i.e. gcd(𝑝, 𝑎) = 1), then
𝑎𝑝−1 ≡ 1 𝑚𝑜𝑑 𝑝
If gcd 𝑎, 𝑛 = 1 then 𝑎𝜙 𝑛
≡ 1(𝑚𝑜𝑑 𝑛)
If 𝑛 is a prime then 𝑎𝜙 𝑛
= 𝑎𝑛−1 ≡ 1(𝑚𝑜𝑑 𝑛) Fermat Theorem: 𝑎𝑝−1 ≡ 1 𝑚𝑜𝑑 𝑝
But this works for any value for 𝑛
Primality Test
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 4 8 16 13 7 14 9 18 17 15 11 3 6 12 5 10 1
3 9 8 5 15 7 2 6 18 16 10 11 14 4 12 17 13 1
4 16 7 9 17 11 6 5 1 4 16 7 9 17 11 6 5 1
5 6 11 17 9 7 16 4 1 5 6 11 17 9 7 16 4 1
6 17 7 4 5 11 9 16 1 6 17 7 4 5 11 9 16 1
7 11 1 7 11 1 7 11 1 7 11 1 7 11 1 7 11 1
8 7 18 11 12 1 8 7 18 11 12 1 8 7 18 11 12 1
9 5 7 6 16 11 4 17 1 9 5 7 6 16 11 4 17 1
10 5 12 6 3 11 15 17 18 9 14 7 13 16 8 4 2 1
11 7 1 11 7 1 11 7 1 11 7 1 11 7 1 11 7 1
12 11 18 7 8 1 12 11 18 7 8 1 12 11 18 7 8 1
13 17 12 4 14 11 10 16 18 6 2 7 15 5 8 9 3 1
14 6 8 17 10 7 3 4 18 5 13 11 2 9 12 16 15 1
15 16 12 9 2 11 13 5 18 4 3 7 10 17 8 6 14 1
16 9 11 5 4 7 17 6 1 16 9 11 5 4 7 17 6 1
17 4 11 16 6 7 5 9 1 17 4 11 16 6 7 5 9 1
18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1
Discrete Logarithm
𝑎 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
log 2,19 𝑎 18 1 13 2 16 14 6 3 8 17 12 15 5 7 11 4 10 9
log 3,19 𝑎 18 7 1 14 4 8 6 3 2 11 12 15 17 13 5 10 16 9
log10,19 𝑎 18 17 5 16 2 4 12 15 10 1 6 3 13 11 7 14 8 9
log13,19 𝑎 18 11 17 4 14 10 12 15 16 7 6 3 1 5 13 8 2 9
log14,19 𝑎 18 13 7 8 10 2 6 3 14 5 12 15 11 1 17 16 4 9
log15,19 𝑎 18 5 11 10 8 16 12 15 4 13 6 3 7 17 1 2 14 9
Calculation of Discrete Logarithms
The set of integers (positive, negative, and 0) under addition is an abelian group.
The set of nonzero real numbers under multiplication is an abelian group.
Cyclic Group
Consider that
𝑎3 = 𝑎 ∙ 𝑎 ∙ 𝑎, 𝑎0 = 𝑒, and 𝑎−𝑛 = 𝑎′ 𝑛
Example:
The additive group of integers is an infinite cyclic group generated by the element 1.
In this case, powers are interpreted additively, so that n is the nth power of 1.
RINGS
A ring is a set of elements in which we can do addition, subtraction [𝑎 − 𝑏 = 𝑎 + (−𝑏)], and multiplication
without leaving the set.
A ring 𝑅, sometimes denoted by 𝑅, +,× , is a set of elements with two binary operations, called addition
and multiplication, such that for all 𝑎, 𝑏, 𝑐 in 𝑅 the following axioms are obeyed.
(A1–A5) R is an abelian group with respect to addition; that is, R satisfies axioms A1 through A5. For the case of an
additive group, we denote the identity element as 0 and the inverse of a as -a.
(M1) Closure under multiplication: If 𝑎 and 𝑏 belong to 𝑅, then 𝑎𝑏 is also in 𝑅.
(M2) Associativity of multiplication: 𝑎(𝑏𝑐) = (𝑎𝑏)𝑐 for all 𝑎, 𝑏, 𝑐 in 𝑅.
(M3) Distributive laws: 𝑎(𝑏 + 𝑐) = 𝑎𝑏 + 𝑎𝑐 for all 𝑎, 𝑏, 𝑐 in 𝑅. (𝑎 + 𝑏)𝑐 = 𝑎𝑐 + 𝑏𝑐 for all 𝑎, 𝑏, 𝑐 in 𝑅
A ring is said to be commutative if it satisfies the following additional condition:
(M4) Commutativity of multiplication: ab = ba for all a, b in R.
Example:
The set ℤ𝒏 of integers {𝟎, 𝟏, 𝒄 … 𝒏 − 𝟏}, together with the arithmetic operations modulo n, is a
commutative ring
Integral Domain
Example:
Let 𝑺 be the set of integers (positive, negative, and 0) under the usual operations
of addition and multiplication. 𝑺 is an integral domain.
Fields
Galois field
FINITE FIELDS OF THE FORM GF(p)
For a given prime, p, we define the finite field of order p, GF(p), as the set ℤ𝑝 of integers
0,1, … , 𝑝 − 1 together with the arithmetic operations modulo p.
𝐺𝐹 𝑝 = ℤ𝑝 , 𝑚𝑜𝑑 𝑝
Multiplicative Inverse in GF(p)