Академический Документы
Профессиональный Документы
Культура Документы
• Consider polynomials whose coefficients are taken from prime-order finite fields.
Primitive polynomials and Galois fields of order pm
• Let GF ( q ) [ x ] denote the collection of all polynomials a0 + a1 x + a2 x 2 + + an x n of
arbitrary degree with coefficients {ai } in the finite field GF ( q ) .
• (a 0 + a1 x + a2 x 2 + + an x n ) + ( b0 + b1 x + b2 x 2 + + bn x n )
= ( a0 + b0 ) + ( a1 + b1 ) x + ( a2 + b2 ) x 2 + + ( an + bn ) x n .
• (a 0 + a1 x + a2 x 2 + + an x n ) ⋅ ( b0 + b1 x + b2 x 2 + + bm x m )
= ( a0 ⋅ b0 ) + [ a1 ⋅ b0 + a0 ⋅ b1 ] x1 + [ a2 ⋅ b0 + a1 ⋅ b1 + a0 ⋅ b2 ] x 2 + + ( an ⋅ bm ) x n + m .
The coefficient operations are performed using the operations for the field from
which the coefficients were taken.
• Such a collection of polynomials forms a commutative ring with identity.
• Nonzero field elements are considered to be zero-degree polynomials.
The zero element, however, is not considered a polynomial at all, because most
metrics used with Euclidean rings of polynomials are undefined for the zero
element.
• Let α be a root of f(x). Then, f ( x ) x n − 1 ⇒ ord (α ) n .
∑x = (x + x n −1 ) + + ( x + 1) = ( x + 1) ( x n −1 + x n − 3 + + 1) . It is
n
• For n odd, i n
i =0
n
clear that ( x + 1) is a factor because ∑x
i =0
i
= 0 . Also, observe that
x =1
2 k +1
⎛ k
⎞
∑ x = ( x + 1) ⎜⎝ ∑ x
i =0
i
i =0
2i
⎟.
⎠
• Binary polynomials that miss alternate terms are not irreducible
• Lowest degree term is x ⇒ x is a factor.
k
• Lowest degree term is 1: ∑x
i =0
2k
2
⎛ n ⎞
x + 1 = ( x + 1) , x + x + 1 = ( x + x + 1) . ⎜ ∑ xi ⎟ = ∑ x 2 k .
n 2
2
• 2 4 2 2
⎝ i =0 ⎠ k =0
2
⎛ n ⎞
To see this, consider, ( x + 1) = ( x + 1) ⎜ ∑ x i ⎟ . Also,
n +1 2 2
⎝ i=0 ⎠
⎛ 2 n +1
i⎞ 2⎛ ⎞
( )
n
( ) ⎜ ∑ ⎟ ( ) ⎜ ∑ x 2k ⎟ .
n +1 2 2n + 2
x + 1 = x + 1 = x + 1 x = x + 1
⎝ i =0 ⎠ ⎝ i =0 ⎠
• x 4 + x 3 + x 2 + x + 1 can’t take just one of the middle terms because we left with
φ ( 2n − 1)
• There are binary primitive polynomials of degree n.
n
• Primitive polynomials: An irreducible polynomial p ( x ) ∈ GF ( p ) [ x ] of degree m is
{ }
said to be primitive if min n : p ( x ) x n − 1 = p m − 1 .
n∈
φ ( 2n − 1)
• There are binary primitive polynomials of degree n.
n
• Given an irreducible polynomial of degree m, to test whether it is primitive,
divide it from x n − 1 where m < n < p m − 1 . If no such n gives 0 remainder, then it
is primitive. (The case when n = pm – 1 is guaranteed to have 0 remainder.). If
there exists n, m < n < p m − 1 , such that the remainder is not 0, then it is not
primitive.
• Primitive polynomials are the minimal polynomials for primitive elements in a
Galois field.
• Primitive polynomials of degree n in GF(2)[x]
Degree Primitive polynomials
2 x2 + x + 1
3 x3 + 0 + x + 1 ,
x3 + x 2 + 0 + 1
4 x 4 + 0 + 0 + x + 1,
x 4 + x3 + 0 + 0 + 1
5 x 5 + 0 + 0 + x 2 + 0 + 1,
x 5 + 0 + x 3 + 0 + 0 + 1,
x5 + x 4 + x3 + x 2 + x + 1 where exactly one of
{
min n : x 4 + x 3 + x 2 + x + 1 x n − 1 = 5 .
n∈
}
• The root α of an mth-degree primitive polynomial p ( x ) ∈ GF ( p ) [ x ]
−1
−1
m
• Is also be a root of x p
• have order p m − 1 . (and hence, is a primitive element in GF ( p m ) )
Proof. By definition, p ( x ) x p −1
−1.
m
• x ord (α ) − 1 x p −1
−1
m
also have p ( x ) x
ord (α )
− 1 because p(x) is irreducible. Because p(x) is
{ }
primitive, p m − 1 = min n : p ( x ) x n − 1 . So, ord (α ) ≥ p m − 1 . But from
n∈
x ord (α ) − 1 x p −1
− 1 , we have ord (α ) ≤ p m − 1 . So, ord (α ) = p m − 1 .
m
(
ord (α ) = p m − 1 and the p m − 1 consecutive powers of α α 0 ,α 1 ,…,α ord (α ) −1 are the )
nonzero elements of the field GF ( p m ) . Also, can express any power of α
(exponential representation) (or even any polynomials in α) as
bm −1α m −1 + + b1α + b0 (polynomial representation).
q −1
• ord (α i ) = , q = pm .
gcd ( i, q − 1)
• Construction of GF ( p m ) :
• Let β ∈ GF ( 2m ) , then − β = β .
Zech’s logarithms
• Except in the prime-order field case, GF(q) addition is not as easy to implement as
multiplication. The simplest (though least efficient) approach is to construct a (q × q)
look-up table. A more efficient use of memory can be obtained through the use of
Zech’s logarithms, also known as “add-one tables.”
• An add-one tables has two columns:
The first contains the logarithm of each element with respect to a primitive element α.
( logα ( x ) )
The second column contains the logarithm to the base α of the corresponding element
in the first column after it has been incremented by one. ( logα ( x + 1) )
• * → 0 : logα 0 = * . logα ( 0 + 1) = logα 1 = 0 .
In GF ( 2m ) : 0 ↔ * . (1 + 1 = 0)
• ( )
α a + α b + α c + 1 = (α a −b + 1)α b − c + 1 α c − d + 1
• Example: The construction of GF(4)
Because 4 = 22, we seek a primitive polynomial in GF(2)[x] of degree 2. Let
p ( x ) = x 2 + x + 1 . Let α be a root of p(x). This implies that ord (α ) = 3 and
α 2 + α + 1 = 0 , i.e., α 2 = α + 1 . Then,
Vector-space
Exp. Poly. Rep. Order logα ( x ) logα ( x + 1)
Rep. Rep.
(1,α )
α0 1 (1, 0) 1 0 *
α 1
α (0, 1) 3 1 2
α 2
α +1 (1, 1) 3 2 1
0 0 (0, 0) - * 0
• Example: The construction of GF(8)
Because 8 = 23, we seek a primitive polynomial in GF ( 2 ) [ x ] of degree 3. Let
p ( x ) = x3 + x + 1 . Let α be a root of p(x). This implies that ord (α ) = 7 and
α 3 + α + 1 = 0 , i.e., α 3 = α + 1 . Then,
α 4 = α 3 ⋅α = α 2 + α
α 5 = α 4 ⋅α = α 3 + α 2 = α + 1 + α 2
α 6 = α 5 ⋅α = α 3 + α 2 + α = α + 1 + α 2 + α = α 2 + 1.
Vector-space
Order logα ( x ) logα ( x + 1)
Exp. Poly. Rep.
Rep. Rep.
(1,α ,α 2 )
α0 1 (1, 0, 0) 1 0 *
α1 α (0, 1, 0) 7 1 3
α2 α2 (0, 0, 1) 7 2 6
α3 1+α (1, 1, 0) 7 3 1
α4 α +α2 (0, 1, 1) 7 4 5
α5 1+α +α2 (1, 1, 1) 7 5 4
α6 1+α 2 (1, 0, 1) 7 6 2
0 0 (0, 0, 0) - * 0
Note also that α is a primitive element in GF ( 23 ) = GF(8). α 7 = 1 .
• Example: The construction of GF(8)
Let p ( x ) = x3 + x 2 + 1 . Let α be a root of p(x). This implies that ord (α ) = 7
and α 3 = α 2 + 1 .
Exp. Poly.
Order logα ( x ) logα ( x + 1)
Rep. Rep.
α0 1 1 0 *
α 1
α 7 1 5
α 2
α 2
7 2 3
α 3
α +1
2
7 3 2
α 4
α +α +1
2
7 4 6
α 5
α +1 7 5 1
α 6
α +α
2
7 6 4
0 0 - * 0
Note also that α is a primitive element in GF ( 23 ) = GF(8). α 7 = 1 .
• Example: The construction of GF(16)
Let p ( x ) = x 4 + x + 1 .
Vector-space
Exp. Poly. Rep. Order logα ( x ) logα ( x + 1)
Rep. Rep.
(1, α , α 2
, α 3
)
0 0 (0, 0, 0, 0) - * 0
α0 1 (1, 0, 0, 0) 1 0 *
α1 α (0, 1, 0, 0) 15 1 4
α2 α2 (0, 0, 1, 0) 15 2 8
α3 α3 (0, 0, 0, 1) 5 3 14
α4 α +1 (1, 1, 0, 0) 15 4 1
α5 α2 +α (0, 1, 1, 0) 3 5 10
α6 α3 +α2 (0, 0, 1, 1) 5 6 13
α7 α3 +α +1 (1, 1, 0, 1) 15 7 9
α8 α2 +1 (1, 0, 1, 0) 15 8 2
α9 α3 +α (0, 1, 0, 1) 5 9 7
α 10 α 2 +α +1 (1, 1, 1, 0) 3 10 5
α 11 α3 +α2 +α (0, 1, 1, 1) 15 11 12
α 12 α3 +α 2 +α +1 (1, 1, 1, 1) 5 12 11
α 13 α3 +α 2 +1 (1, 0, 1, 1) 15 13 6
α 14 α3 +1 (1, 0, 0, 1) 15 14 3
Euclidean Domains
• A Euclidean domain is a set D with two binary operations “+” and “ ⋅ ” that satisfy the
following:
1. D forms a commutative ring with identity.
2. Cancellation: if ab = bc, b ≠ 0, then a = c.
3. Every element a ∈ D has an associated metric g(a) such that
a) g(a) ≤ g ( a ⋅ b ) for all nonzero b ∈ D.
b) For all nonzero a, b ∈ D, g(a) > g(b), there exist q and r such that a = qb + r
with r = 0 or g(r) < g(b).
• q is called the quotient and r the remainder.
• g(0) is generally taken to be undefined, though a value of -∞ can be assigned if
desired.
• Examples of Euclidean Domains
• The ring of integers under addition and multiplication with metric g(n) = |n|
(absolute value).
• GF ( q ) [ x ] : the ring of polynomials over a finite field with metric
g ( f ( x ) ) = degree ( f ( x ) ) .
• a is said to be a divisor of b (written a|b) if there exists c ∈ D such that a ⋅ c = b .
• An element a is said to be a common divisor of a collection of elements
{b1, b2 ,…, bn } if a|bi for i = 1, …, n.
• If d is a common divisor of the {bi } and all other common divisors are less than d,
then d is called the greatest common divisor (GCD) of the {bi}.
• g = gcd ( a, b ) ⇔ g is a common divisor of a and b, and ∀d common divisor of a
and b, d g .
Euclid’s Algorithm
• Euclid’s algorithm is a very fast method for finding the GCDs of sets of elements in
Euclidean domains.
• Euclid’s Algorithm:
Let a, b be a pair of elements contained in a Euclidean domain D, where g(a) > g(b)
Let the indexed variable ri take on the initial values r-1 = a and r0 = b.
Proceed by using the following recursion formula
If ri-1 ≠ 0, the define ri using ri − 2 − qi ri −1 = ri where g ( ri ) < g ( ri −1 ) .
Repeat until ri = 0 .
If ri = 0 , then ri −1 = GCD ( a, b ) .
• Recursive system of equations:
a = q1b + r1 0 < r1 < b
b = q2 r1 + r2 0 < r2 < r1
rn − 2 = qn rn −1 + rn 0 < rn < rn −1
GCD ( a, b ) = rn .
• Example
• GCD(336,54) • GCD ( x5 + x3 + x + 1, x 4 + x 2 + x + 1)
336 = 6(54) + 12
x 5 + x3 + x + 1 = x ( x 4 + x 2 + x + 1) + ( x 2 + 1)
54 = 4(12) + 6
x 4 + x 2 + x + 1 = x 2 ( x 2 + 1) + ( x + 1)
12 = 2(6) + 0
x 2 + 1 = ( x + 1)( x + 1) + 0
GCD(336, 54) = 6
GCD ( x5 + x3 + x + 1, x 4 + x 2 + x + 1) = x + 1
• D m + 1 = ( D + 1) ( D m −1 + D m − 2 + + D + 1) .
• In a Euclidean domain, the remainder ri will always take on the value zero after a
finite number of steps.
The worst case: Euclid’s algorithm requires a maximal number of steps to complete
when a and b are consecutive Fibonacci numbers.
• GCD ( a, b, c ) = GCD ( GCD ( a, b ) , c ) .
• If B = {b1 , b2 ,…, bn } is any finite subset of elements from a Euclidean domain D, then
B has a GCD d which can be expressed as a linear combination ∑λ b
k
k k , where the
coefficients {λi } ⊂ D .
GCD ( a, b ) s t
0
• Check: GCD ( a, b ) = sa + tb .
• Check: for all j, s j a + t j b = rj .
• The extended Version of Euclid’s Algorithm
We wish to find s and t such that GCD ( a, b ) = sa + tb .
1. A set of indexed variables {ri , si , ti } is given the following initial conditions:
r−1 = a , r0 = b , s−1 = 1 , s0 = 0 , t−1 = 0 , t0 = 1 .
2. If ri −1 ≠ 0 , then define ri using ri = ri − 2 − qi ri −1 , g ( ri ) < g ( ri −1 ) .
3. Compute si using si − 2 − qi si −1 , where qi is from step 2.
4. Compute ti using ti = ti − 2 − qiti −1 .
5. Repeat steps 2 through 4 until ri = 0 .
At this point ri −1 = GCD ( a, b ) and si −1a + ti −1b = ri −1 .
i ri qi si ti
-1 a - 1 0
0 b - 0 1
1 r1 q1 1 −q1
2
• Remark:
• for all j, s j a + t j b = rj .
• a = bq1 + r1 , s1 = s−1 − q1s0 = 1 − q1 0 = 1 , t1 = t−1 − q1t0 = 0 − q11 = −q1 .
⎡1 0 ⎤
• Observe that the initial conditions for si and ti is the identity matrix ⎢ ⎥.
⎣0 1 ⎦
• If B = {b1 , b2 ,…, bn } is any finite subset from a Euclidean domain D, then B has a gcd
{λi } ⊂ D
Proof. Let S = {∑ λk bk : {λi } ⊂ D} . Let d be the element in S with the smallest
metric ( g ( d ) ) . By definition, d ∈ S ⇒ d = ∑ λibi . We will show that d
is the GCD of the elements in B.
If d does not divide some element bi ∈ B , then we can write bi = qd + r
where g ( r ) < g ( d ) . But r = bi − qd must be in S, since bi and d are in S.
This contradicts the minimality of the metric of d in S. Thus, d is a
common divisor of all the elements in B.
Now let e by any other common divisor of the elements in B. We can then
write bi = qi′e for each bi ∈ B . Then, d = ∑ λibi = ∑ λi qi′e = e∑ λi qi′ . So,
d is a multiple of every common divisor and thus the GCD of all of the
elements in B.
• Let D be a Euclidean domain. Suppose that for a, b, c ∈ D , a ( bc ) , but a and b are
relatively prime. Show that a c .
Proof. gcd ( a, b ) = 1 ⇒ ∃ s, t ∈ D sa + tb = 1 . a ( bc ) ⇒ bc = aq for some
q ∈ D . sa + tb = 1 ⇒ sac + tbc = c ⇒ sac + taq = c ⇒ a ( sc + tq ) = c .
• All finite Euclidean domains are fields.
Proof. D forms a commutative ring with identity. Hence, only need to show the
existence of unique multiplicative inverse. Let x ∈ D . D is finite; hence,
the sequence x, x 2 , x3 ,… must repeat. ⇒ ∃ p, q q > p such that x p = x q
⇒ x p = x p ( x q − p ) ⇒ by cancellation, x q − p = 1 . ⇒ x ( x q − p −1 ) = 1 , thus x
has an inverse.
• Example: GCD ( 256,108)
ri qi si ti
256 - 1 0
108 - 0 1
140 2 1 -2
28 2 -2 5
12 1 3 -7
4 2 -8 19
0
GCD ( 256,108) = 4 = 256(-8) + 108(19)
• Examples: GCD ( x5 + x3 + x + 1, x 4 + x 2 + x + 1)
ri qi si ti
x5 + x3 + x + 1 - 1 0
x4 + x2 + x + 1 - 0 1
x2 + 1 x 1 x
x +1 x2 x2 x3 + 1
0
GCD ( x 5 + x 3 + x + 1, x 4 + x 2 + x + 1) = x + 1
= x 2 ( x 5 + x 3 + x + 1) + ( x 3 + 1)( x 4 + x 2 + x + 1)