A-16.1 Background and Motivation

Given two (n −1)-degree polynomials:

A(X) = ∑ ⁡ i=0n−1aiXi, ... B(X) = ∑ ⁡ i=0n−1biXi

, the polynomial multiplication C(X) = A(X) ⋅B(X) is computed as follows:

C(X) = ∑ ⁡ i=02n−2ciXi, where ci = ∑ ⁡ k=0iakbi−k

This operation of computing c→ = (c0,c1,⋯,c2n−1) is also called the convolution of a→ and b→, denoted as c→ = a→ ⊗b→. The time complexity of this operation (i.e., the total number of multiplications between two numbers) is O(n2).

Another way of multiplying two polynomials is based on point-value representation. The point-value representation of an (n −1)-degree (or lesser degree) polynomial A(X) is a set of n coordinates {(x0,y0),(x1,y1),⋯(xn−1,yn−1)}, where each xi is a distinct X coordinate (whereas each yi is not necessarily a distinct Y coordinate). Given a point-value representation of an (n −1)-degree (or lesser degree) polynomial, we can use polynomial interpolation (§A-10) to derive the polynomial. Let’s denote the point-value representation of (n −1)-degree (or lesser degree) polynomial A(X) and B(X) as follows:

A(X) : ((x0,y0⟨a⟩),(x1,y1⟨a⟩),⋯(xn−1,yn−1⟨a⟩))

B(X) : ((x0,y0⟨b⟩),(x1,y1⟨b⟩),⋯(xn−1,yn−1⟨b⟩))

Then, the point-value representation of the polynomial C(X) = A(X) ⋅B(X) can be computed as a Hadamard product (Definition A-11.1 in §A-11.1) of the y values of the point-value representation of A(X) and B(X) as follows:

C(X) : ((x0,y0⟨c⟩),(x1,y1⟨c⟩),⋯(xn−1,yn−1⟨c⟩)), where yi⟨c⟩ = yi⟨a⟩⋅yi⟨b⟩

However, we cannot derive polynomial C(X) based on these n coordinates because the degree of C(X) is 2n −2 (or less than 2n −2). But if we regard all polynomials (including A(X),B(X) and C(X)) to be in the polynomial ring ℝ[X]∕(Xn + 1) (or ℤp[X]∕(Xn + 1)), then we can reduce the (2n −2)-degree polynomial C(X) to a congruent (n −1)-degree (or lesser degree) polynomial in the ring. Then, the n coordinates of C(X) are sufficient to derive C(X).

However, the time complexity of this new method is still O(n2). The Hadamard product between two polynomials’ point-value representations takes O(n), but evaluating a polynomial at n distinct x values takes O(n2) (because each polynomial has n terms, and we have to compute each term for n distinct x values). The polynomial interpolation for deriving C(X) also takes O(n2).

To solve this efficiency problem, this section will explain an efficient technique for polynomial evaluation, which can evaluate a polynomial at n distinct roots of unity in O(nlog⁡n). This technique is classified into 2 types: Fast Fourier Transform (FFT) and Number-theoretic Transform (NTT). These two types are technically almost the same, with the only difference that the FFT assumes a polynomial ring over complex numbers (§A-7), whereas the NTT assumes a polynomial ring over a finite field (e.g., integers modulo a prime) (§A-9). Polynomial multiplication based on FFT (or NTT) comprises 3 steps: (1) forward FFT (or NTT); (2) point-value multiplication; and (3) inverse FFT (or NTT).