Finite Fields and Confidentiality · Cryptography and Network Security

Polynomial Arithmetic

Watch lectures

Polynomial Arithmetic

1. Polynomials over a Field (Why GF(2)[x]GF(2)[x] Rules Crypto)

A polynomial a(x)=anxn+⋯+a1x+a0a(x) = a_nx^n + \cdots + a_1x + a_0 with coefficients in a field FF behaves like integers: add/subtract termwise, multiply by convolution, divide with remainder. Degree rules: deg⁡(f+g)≤max⁡\deg(f+g) \le \max, deg⁡(fg)=deg⁡f+deg⁡g\deg(fg) = \deg f + \deg g, division gives f=qg+rf = qg + r with deg⁡r<deg⁡g\deg r < \deg g. Crypto's home ring: GF(2)[x]GF(2)[x] — coefficients bits, addition = XOR, subtraction = addition.

a(x)+b(x)=∑(ai⊕bi)xi,a(x)b(x)=∑k(⨁i+j=kaibj)xka(x) + b(x) = \sum (a_i \oplus b_i)x^i, \quad a(x)b(x) = \sum_k\left(\bigoplus_{i+j=k}a_ib_j\right)x^k

2. Worked GF(2)[x]GF(2)[x] Examples (AES-Style Bytes)

Represent bytes as polynomials: 0x57 =01010111→x6+x4+x2+x+1= 01010111 \to x^6+x^4+x^2+x+1; 0x83 =10000011→x7+x+1= 10000011 \to x^7+x+1.

  • Addition: (x6+x4+x2+x+1)+(x7+x+1)=x7+x6+x4+x2(x^6+x^4+x^2+x+1) + (x^7+x+1) = x^7+x^6+x^4+x^2 (xx and 11 cancel: 1⊕1=01 \oplus 1 = 0) → 0xD4. XOR of bytes: 0x57 ⊕ 0x83 = 0xD4 ✓ — polynomial addition IS byte XOR.
  • Multiplication: (x2+x+1)(x+1)=x3+x2+x+x2+x+1=x3+(x2⊕x2)+(x⊕x)+1=x3+1(x^2+x+1)(x+1) = x^3+x^2+x + x^2+x+1 = x^3 + (x^2 \oplus x^2) + (x \oplus x) + 1 = x^3+1 (like terms vanish in pairs). Integer check fails — no carries in GF(2)GF(2)!
  • Division: (x3+1)÷(x+1)(x^3+1) \div (x+1): x3/(x)=x2x^3/(x) = x^2 → multiply-subtract (XOR): remainder x2+1x^2+1; next +x+x: remainder x+1x+1; next +1+1: remainder 00. Quotient x2+x+1x^2+x+1 ✓ (matches multiplication above inverted).

3. GCD, Irreducibles, and Modular Polynomials

  • GCD same Euclid with degrees: gcd⁡(x3+1,x+1)=x+1\gcd(x^3+1, x+1) = x+1 (from division above, zero remainder at divisor x+1x+1).
  • Irreducible = prime-like (no nontrivial factors): x3+x+1x^3+x+1 over GF(2)GF(2) is irreducible (no root 00 or 11: f(0)=1f(0) = 1, $f(1) = 1+1+1 = 1
    e 0—degree−3withnolinearfactor⟹irreducible). — degree-3 with no linear factor ⟹ irreducible). x^2+1 = (x+1)^2in in GF(2)$ — REDUCIBLE (freshman's dream!), unlike over reals.
  • Modular reduction: x8 mod m(x)x^8 \bmod m(x) with AES m(x)=x8+x4+x3+x+1m(x) = x^8+x^4+x^3+x+1: x8≡x4+x3+x+1x^8 \equiv x^4+x^3+x+1 (move x8x^8 across: m(x)=0m(x) = 0). So multiplying bytes that overflow degree 7 reduces via this rule — MixColumns/xtime mechanized.

xtime (× xx) worked: 0x87 (x7+x2+x+1x^7+x^2+x+1) times xx = x8+x3+x2+xx^8+x^3+x^2+x → reduce x8x^8 → (x4+x3+x+1)+x3+x2+x=x4+x2+1(x^4+x^3+x+1)+x^3+x^2+x = x^4+x^2+1 (0x15)... check: x3⊕x3=0x^3 \oplus x^3 = 0, x⊕x=0x \oplus x = 0 → x4+x2+1x^4+x^2+1 ✓. Rule: left-shift; if bit-7 was set, XOR 0x1B (m(x)m(x) without x8x^8).

4. Bridge to GF(2n)GF(2^n) (Next Topic)

Polynomials mod an irreducible degree-nn m(x)m(x) form field GF(2n)GF(2^n) — exactly how Zp\mathbb{Z}_p came from integers mod prime pp. AES: bytes mod m(x)m(x) degree 8 → GF(28)GF(2^8); inverse via Extended Euclid on polynomials (same table method, degrees instead of sizes).

Exam Points

  • Byte↔polynomial conversion (0x57, 0x83) + XOR-addition to 0xD4 — 2-mark opener.
  • Multiplication with pair-cancellation ((x2+x+1)(x+1)=x3+1(x^2+x+1)(x+1) = x^3+1) + division trace — 5-mark core.
  • Irreducibility test via roots (x3+x+1x^3+x+1 irreducible; x2+1=(x+1)2x^2+1 = (x+1)^2 trap!).
  • xtime reduction with 0x1B conditional XOR.
Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.

← All Cryptography and Network Security modules