lfsr and primitive polynomial

16
LFSR AND PRIMITIVE POLYNOMIAL Li Yao

Upload: others

Post on 19-Nov-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LFSR AND PRIMITIVE POLYNOMIAL

LFSR AND PRIMITIVE POLYNOMIAL

Li Yao

Page 2: LFSR AND PRIMITIVE POLYNOMIAL

LFSR is a shift register circuit in which two or more outputs from intermediate steps get linearly combined and feedback to inout value.

Page 3: LFSR AND PRIMITIVE POLYNOMIAL

An example of 4-bit LFSR

Deterministic

states2n − 1

m-sequence : MaxiMum length sequence

Pseudorandom

Page 4: LFSR AND PRIMITIVE POLYNOMIAL

How to denote a LFSR

Generally, any n-bit LFSR can be denoted by a generator polynomial of degree n.

Page 5: LFSR AND PRIMITIVE POLYNOMIAL

X15 + X12 + X11 = 0X14 + X11 + X10 = 0X13 + X10 + X9 = 0X12 + X9 + X8 = 0X11 + X8 + X7 = 0X10 + X7 + X6 = 0X9 + X6 + X5 = 0X8 + X5 + X4 = 0X7 + X4 + X3 = 0X6 + X3 + X2 = 0X5 + X2 + X = 0X4 + X + 1 = 0

X11G(X) = 0

X8G(X) = 0X7G(X) = 0

X5G(X) = 0

X3G(X) = 0X2G(X) = 0XG(X) = 0G(X) = 0

X10G(X) = 0X9G(X) = 0

X6G(X) = 0

X4G(X) = 0

G(X) = X4 + X + 1

⇒ X15 = 1G(X) | (X15 − 1) in 𝔽2[x]

Generally, the generator polynomial of any n-bit LFSR which achieves m-sequence is a factor of in .X2n−1 − 1 𝔽2[x]

1 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1⋯X14 X13 X12 X11 X10 X9 X8 X7 X6 X5 X4 X3 X2 X1 X0X15⋯

𝔽2[x] : {a0 + a1x + a2x2 + ⋯ + anxn |a0, a1, a2, …an ∈ 𝔽2}

Page 6: LFSR AND PRIMITIVE POLYNOMIAL

Factor in 22n−1 − 1 ℤ[x] Im

Re1−1

i

−i

ε = e2πi15

ε2ε3

ε4ε5

ε6

ε7

ε8

ε9

ε10ε11

ε12ε13

ε14

If and , is called a dth primitive unit root.

ζd = 1 ζk ≠ 1(0 < k < d)

ζ

1st primitive unit root:{ } 3rd primitive unit root:{ }

5th primitive unit root:{ }

15th primitive unit root:{ }

nth primitive unit root:

1

ε5, ε10

ε3, ε6, ε9, ε12

ε, ε2, ε4, ε7, ε8, ε11, ε13, ε14

{e2πi kn |0 < k ⩽ n, gcd(k, n) = 1}

∑d|n

φ(d) = n

Page 7: LFSR AND PRIMITIVE POLYNOMIAL

Cyclotomic Polynomial is a nth primitive unit root.

is called a nth Cyclotomic Polynomial.

Φn(x) = ∏1⩽k⩽n,gcd(k,n)=1

(x − e2πi kn ), e2πi k

n

Φn(x)

xn − 1 = ∏d|n

Φd(x)

X15 − 1 = (x − 1)(x − ε5)(x − ε10)(x − ε3)(x − ε6)(x − ε9)(x − ε12)(x − ε)(x − ε2)(x − ε4)(x − ε7)(x − ε8)(x − ε11)(x − ε13)(x − ε14)

Φ1(x) = x − 1 Φ3(x) =x3 − 1Φ1(x)

= x2 + x + 1

Φ5(x) =x5 − 1Φ1(x)

= x4 + x3 + x2 + x + 1

Φ15(x) =x15 − 1

Φ1(x)Φ3(x)Φ5(x)= x8 − x7 + x5 − x4 + x3 − x + 1

xn − 1 = f(x)Φn(x) = f(x)g(x) + r(x)f(x)(Φn(x) − g(x)) = r(x)

Page 8: LFSR AND PRIMITIVE POLYNOMIAL

Factor in Φ2n−1(x) 𝔽2[x]A field is a set together with two binary operations on called addition(+) and multiplication(*).A binary operation is a mapping

.These operations are required to satisfy the following properties. • is an Abel group.

• is an Abel group. • Distributivity of * over +.

(𝔽, + , * ) 𝔽 𝔽

𝔽 × 𝔽 → 𝔽

(𝔽, + )

(𝔽 \{0}, * )

Finite fields(also called Galois fields) are fields with finitely many elements. The field with elements( being prime) is usually denoted by

. In , . is called characteristic.

pn p

𝔽pn 𝔽pn 1 + 1 + 1 + ⋯ + 1p

= 0 p

Page 9: LFSR AND PRIMITIVE POLYNOMIAL

A subfield of a field is a subset of that is a field with respect to the field operations inherited from .

𝕃 𝕂 𝕃

𝕃

If is a subfield of , then is an extension field of ,and this pair of fields is a field extension. Such a field extension is denoted .

Given a field extension , the larger field is a -vector space. The dimension of this vector space is called the degree of the extension and is denoted by .

𝕂 𝕃 𝕃 𝕂

𝕃 /𝕂

𝕃 /𝕂 𝕃 𝕂

[𝕃 : 𝕂]

Let be a field extension, Then the minimum polynomial of is defined as the monic polynomial of least degree among all polynomials in having as a root.

𝕃 /𝕂 α ∈ 𝕃 . α

𝕂[x] α

Page 10: LFSR AND PRIMITIVE POLYNOMIAL

ℚ( 2) = {a + b 2 |a, b ∈ ℚ} f(x) = x2 − 2

ℝ(i) = {a + bi |a, b ∈ ℝ} = ℂ f(x) = x2 + 1

ℚ( 2, 3) = ℚ( 2)( 3)

= {a + b 3 |a, b ∈ ℚ( 2)}

= {a + b 2 + c 3 + d 6 |a, b, c, d ∈ ℚ}

[ℚ( 2) : ℚ] = 2

[ℂ : ℝ] = 2

f1(x) = x2 − 3

f2(x) = x2 − 2 [ℚ( 2) : ℚ] = 2

[ℚ( 2)( 3) : ℚ( 2)] = 2

[ℚ( 2, 3) : ℚ] = 4

𝔽p(α) = {a0 + a1α + a2α2 + ⋯ + an−1αn−1 |a0, a1, …, an−1 ∈ 𝔽p}

f(x) = xn + ⋯ [𝔽p(α) : 𝔽p] = n

Some examples about field extension1.

2.

3.

4.

Page 11: LFSR AND PRIMITIVE POLYNOMIAL

Lemma 1. For any field of characteristic p and any ,

if and only if ; i.e., if and only if all coefficients

are in the prime subfield .

𝔽 f(x) ∈ 𝔽[x]

f p(x) = f(xp) f(x) ∈ 𝔽p[x]

fi 𝔽p ⊆ 𝔽

f(x) = f0 + f1x+f2x2 + ⋯ + fnxnProof .

f p(x) = ( f0 + f1x+f2x2 + ⋯ + fnxn)p = f p0 + f p

1 xp + f p2 x2p + ⋯ + f p

n xnp

∀a, b ∈ 𝔽, (a + b)p = ap + C1pap−1b + ⋯ + bp

∀k ∈ {1,2,3,⋯, p − 1}, Ckp =

p!k!(p − k)!

, p |Ckp

Ckpap−kbk = 0, (a + b)p = ap + bp

∀i ∈ {0,1,2,⋯, n}, fi ∈ 𝔽p ⇔ f pi = fi

f(xp) = f0 + f1xp + f2x2p + ⋯ + fnxnp

Page 12: LFSR AND PRIMITIVE POLYNOMIAL

η ∈ {ε, ε2, ε4, ε7, ε8, ε11, ε13, ε14}, η24 = η

∃f(x) ∈ 𝔽2[x], f(η) = 0 ⇒ f(η2) = f(η22) = f(η23) = f(η) = 0

let 𝔽 = 𝔽2(η) h(x) = (x − η)(x − η2)(x − η22)(x − η23) h(x) ∈ 𝔽[x]

h2(x) = (x − η)2(x − η2)2(x − η22)2(x − η23)2

= (x2 − η2)(x2 − η22)(x2 − η23)(x2 − η24)

= (x2 − η)(x2 − η2)(x2 − η22)(x2 − η23)= h(x2)

h(x) ∈ 𝔽2[x]

Φ15(x) = (x − ε)(x − ε2)(x − ε4)(x − ε8)(x − ε7)(x − ε14)(x − ε13)(x − ε11)h1(x) h2(x)

Φ15(x) = (x4 + x + 1)(x4 + x3 + 1)

Page 13: LFSR AND PRIMITIVE POLYNOMIAL

Generally, can be divided into different n-degree

polynomials(called primitive polynomials) in .

Φ2n−1(x)φ(2n − 1)

n

𝔽2[x]

rn =φ(2n − 1)

n2n=

∏ (1 − 1pi

)

n

n = 5 6 9 14 18rn = 0.186 0.095 0.094 0.046 0.030

1/n = 0.200 0.167 0.111 0.071 0.056n = 26 29 30 33 41rn = 0.026 0.034 0.017 0.025 0.024

1/n = 0.038 0.034 0.033 0.030 0.024n = 50 53 65 69 74rn = 0.012 0.019 0.015 0.012 0.009

1/n = 0.020 0.019 0.015 0.014 0.013n = 81 86 90 98rn = 0.010 0.008 0.005 0.007

1/n = 0.012 0.012 0.011 0.010

Search primitive polynomials in 𝔽2[x]

Page 14: LFSR AND PRIMITIVE POLYNOMIAL

Lemma 2.If is a nth irreducible polynomial, then

.

f(x) ∈ 𝔽2[x]

f(x) | (x2n−1 − 1)

𝔽 = {f0 + f1x + ⋯ + fn−1xn−1 | f0, f1, …fn−1 ∈ 𝔽2}Proof .

f0(x), f1(x), …, f2n−1(x) ∈ 𝔽 \{0} (∀0 ⩽ i < j ⩽ 2n − 1, fi(x) ≠ fj(x))

2n−1

∏0

fi(x) ≡2n−1

∏0

xfi(x) (mod f(x))

x2n−1 ≡ 1 (mod f(x)) f(x) | (x2n−1 − 1) □

∀0 ⩽ i < j ⩽ 2n − 1,xfi(x) ≢ xfj(x) (mod f(x))

Lemma 3. is a nth primitive polynomial if and only if

f(x) ∈ 𝔽2[x]

f(x) | (x2n−1 − 1)

∀1 ⩽ k < n, gcd( f(x), x2k−1 − 1) = 1

∀t |2n − 1, f(x) ∤ (xt − 1)

Page 15: LFSR AND PRIMITIVE POLYNOMIAL

https://demonstrations.wolfram.com/FactorizingMersenneNumbers/

The largest known Mersenne Prime 282,589,933 − 1

Page 16: LFSR AND PRIMITIVE POLYNOMIAL

Thank you!