Post · 2 min read· pp. 70–71

Basics of Polynomials for Cryptography

A polynomial ϕ\phi of degree dd is a vector of d+1d+1 coefficients:

ϕ=[ϕ0,ϕ1,ϕ2,…,ϕd]\begin{align} \phi &= [\phi_0, \phi_1, \phi_2, \dots, \phi_d] \end{align}

For example, ϕ=[1,10,9]\phi = [1, 10, 9] is a degree 2 polynomial. Also, ϕ’=[1,10,9,0,0,0]\phi’ = [1, 10, 9, 0, 0, 0] is also a degree 2 polynomial, since the zero coefficients at the end do not count. But ϕ’’=[1,10,9,0,0,0,1]\phi’’ = [1, 10, 9, 0, 0, 0, 1] is a degree 6 polynomial, since the last non-zero coefficient is ϕ6=3\phi_6 = 3.

“A list of numbers? That makes no sense!” Don’t panic! You are probably more familiar to polynomials expressed as function of a variable XX:

ϕ(X)=ϕ0+ϕ1⋅X+ϕ2⋅X2+⋯+ϕd⋅Xd=∑i=0d+1ϕiXi\begin{align} \phi(X) &= \phi_0 + \phi_1\cdot X + \phi_2\cdot X^2 + \cdots + \phi_d\cdot X^d\\ &= \sum_{i=0}^{d+1} \phi_i X^i \end{align}

For example, ϕ=[1,10,9]\phi = [1, 10, 9] and ϕ(X)=9X2+10X+1\phi(X) = 9X^2 + 10X + 1 are one and the same thing.

Note: The degree is defined as the index ii of the last non-zero coefficient: deg⁡(ϕ)=i\deg(\phi)=i s.t. ∀j>i,ϕj=0\forall j > i, \phi_j = 0.

The basics of polynomials

Roots of polynomials

We say zz is a root of ϕ(X)\phi(X) if ϕ(z)=0\phi(z) = 0. In this case, ∃q(X)\exists q(X) such that ϕ(X)=q(X)(X−z)\phi(X) = q(X)(X-z).

But what if zz is also a root q(X)q(X)? We can capture this notion as follows: we say zz has a multiplicity kk if ∃q’(X)\exists q’(X) such that ϕ(X)=q’(X)(X−z)k\phi(X) = q’(X) (X-z)^k.

The polynomial remainder theorem

This theorem says that:

ϕ(a)=y⇔∃q(X),ϕ(X)=q(X)(X−a)+ϕ(a)\begin{align} \phi(a) = y\Leftrightarrow \exists q(X), \phi(X) &= q(X)(X-a) + \phi(a) \end{align}

This property is leveraged by certain cryptosystems 1.

Dividing polynomials

Division of polynomials conceptually resembles division of integers.

Specifically, dividing a polynomial a(X)a(X) by b(X)b(X) gives a quotient q(X)q(X) and a remainder r(X)r(X) such that:

a(X)=q(X)b(X)+r(X)a(X) = q(X) b(X) + r(X)

Importantly, deg⁡r<deg⁡b\deg{r} < \deg{b} and, if deg⁡a≥deg⁡b\deg{a} \ge \deg{b}, then deg⁡q=deg⁡a−deg⁡b\deg{q} = \deg{a} - \deg{b}. Otherwise, q(X)=0q(X) = 0.

TODOs

Discrete Fourier Transform (DFT), maybe in its own post?

Multipoint evaluations, reuse from AMT post?

Reed-Solomon error-correction algorithm(s?).

  1. Evaluation proofs in KZG polynomial commitments leverage the polynomial remainder theorem.