Sie sind auf Seite 1von 7

The main purpose of this chapter is to introduce finite fields.

Finite fields are very important in the design of security


algorithms and security protocols. They are the building
blocks of the design of security algorithms such as AES, RSA,
ECC, etc., and security protocols such as secret sharing,
multiparty computation, etc..
What is finite field? It is a finite set together with four
operations addition +, subtraction , multiplication *, and
division / (denominator 0).
Lets first introduce the basic concepts in number theory.
(1) Divisor
Given an integer a, the integer b (b 0) is a divisor of a if a =
b*m for some integer m Example: since 8 = 4*2, 4 is a divisor
of 8 and 2 is a divisor of 8.Exercise: What are the divisors of
6?Answer: 6, 3, 2, 1, 1, 2, 3, 6.
Exercise: What are the divisors of 0?
Answer: All nonzero integers.
Prime number is an integer which has only 4 divisors: itself,
1, 1, itself.
Example: 5 is a prime number because it has only 4 divisors
5, 1, 1, 5.
(2) GCD (Greatest Common Divisor)
GCD stands for greatest common divisor. Given two integers
a and b, GCD(a, b) returns the greatest common divisor of a
and b. It can be computed as follows:
1. List

the divisors of a and b

2. Collect

the common divisors of a and b,

3. Pick

the greatest common divisor of a and b

Example: Compute GCD(25, 35)


1. Divisors

of 25: 25, 5, 1, 1, 5, 25; divisors of 35: 35, 7, 5, 1,


1, 5, 7, 35

2. Common

divisors of 25 and 35: 5, 1, 1, 5

3. Greatest

common divisor of 25 and 35 is 5

So GCD(25, 35) = 5.
Exercise: Compute GCD(a, 0) where a > 0.
Answer: a.
Two integers a and b are called relatively prime or co-prime if
GCD(a, b) = 1.
Example: Since GCD(4, 9) = 1, 4 and 9 are relatively prime
(or co-prime).
(3) Division algorithm
Generally it is not possible to represent the result of integer
division by one integer. For example, 5/2 = 2.5 but 2.5 is a
decimal, not an integer.
Division algorithm represent the result of integer division by
two integers: quotient and remainder. Let a and b be two
integers, where b > 0. If two integers q and r satisfy
a = q*b + r where 0 r < b,then q is called the quotient of a
divides b, and r is called the remainder of a divides b.
Example: Given a = 7 and b = 3. Since
or equivalently,

7 = 2*3 + 1 where 0 1 < 3,

2 3)7
)1
6
2 is the quotient of 7 divides 3, and 1 is the remainder of 7
divides 3.In java programming language,1. If a and b are two
integer variables which hold positive integers, then the
expression
a/b; returns the quotient of a divides b, and the expression
a%b;
returns the remainder of a divides b.
2. Exercise: What is the java code to return the quotient and
remainder of a divides b if a holds negative integer and b
holds positive integer?Answer: a%b 1, a%b + b.
(4) Mod operator
Let n be a positive integer, (mod n) is a unary post operator
mapping the operand to the remainder of the operand divides
n.
For example, since 5 = 1*3 + 2 where 0 2 < 3, the
remainder of 5 divides 3 is 2. Therefore 5 (mod 3) = 2.
Two integers a and b are called congruent mod n, denoted by
a b (mod n) ( is called triple bar),

if a (mod n) = b (mod n).For example, since 5 (mod 3) = 2 =


8 (mod 3),
5 8 (mod 3).If there is no ambiguous, the parenthesis around
mod n can be omitted.

The first type of finite field


Let p be a positive prime number. The operator mod p maps
all integers to the elements in the finite set {0, ..., p1}. The
set is denoted as Zp, and called the set of residues.
Next lets define four operations addition +, subtraction ,
multiplication *, and division / on Zp. Addition, subtraction,
and multiplication.The operation rule is:
1. Treat

the operands as ordinary integers, perform the


operation

2. If

the result is between 0 and p1, then it is the result;


otherwise perform mod p to the result to pull the result
back to Zp

Example: +, , *, tables for finite field Z7 = {0, 1, ..., 6} (row


element operator column element)
+

Division
Let Zp = {0, 1, ..., p1} be the residue set where p is a positive

prime number. The algorithm to compute a/b where a, b Zp


contains 2 steps:
Step 1: Compute the multiplicative inverse of b by invoking
EEA(b, p). EEA stands for Extended Euclidean Algorithm.
EEA(b, p) returns a pair of integers, and the first integer is the
multiplicative inverse. The pseudo-code of EEA is as follows.
Algorithm EEA(b, p)Input: b and p where b > 0 and p > 0
Output: u and v where u is the multiplicative inverse of b
if p = 0 thenreturn (1, 0); // base case
elseq = b/p; // q is the quotient of b divides pr = b%p; // r is
the remainder of b divides p R = EEA(p, r); // recursive call
return (R[1], R[0]q*R[1]);Step 2: Compute a * (the
multiplicative inverse of b) in Zp, and return the result.
Example: Let a = 5, b = 3, p = 11. Compute a/b in Z p. Step 1:
Compute the multiplicative inverse of b
compute and return (4, 10*4) = (4, 1) 8
compute and return (1, 13*(1)) = (1, 4) 7
compute and return (1, 01*1) = (1, 1) 6
compute and return (0, 12*0) = (0, 1) 5
EEA(1, 0):So the multiplicative inverse of 3 = 4Step 2:
Compute 5*(multiplicative inverse of 3) = 5*4 = 20 mod 11 =
9. Hence 5/3 = 9 in Z11.
Example: / table for finite field Z7 (row element divides
column element)
EEA(3, 11): q = 0, r = 3, call EEA(11, 3),

1
EEA(11, 3): q = 3, r = 2, call EEA(3, 2),
2
EEA(3, 2): q = 1, r = 1, call EEA(2, 1),
3
EEA(2, 1): q = 2, r = 0, call EEA(1, 0),
4
return (1, 0)
/

NA

NA

NA

NA

NA

NA

NA

Das könnte Ihnen auch gefallen