A-16.1 Background and Motivation

Given two (n 1)-degree polynomials:

A(X) = i=0n1aiXi, ... B(X) = i=0n1biXi

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

C(X) = i=02n1ciXi, where ci = k=0iakbik

This operation of computing c = (c0,c1,,c2n1) 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),(xn1,yn1)}, 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-15) 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,y0a),(x1,y1a),(xn1,yn1a))

B(X) : ((x0,y0b),(x1,y1b),(xn1,yn1b))

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

C(X) : ((x0,y0c),(x1,y1c),(xn1,yn1c)), where yic = yiayib

However, we cannot derive polynomial C(X) based on these n coordinates, because the degree of C(X) is 2n 2 (or lesser 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 [X]pXn + 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 1 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 representation 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), and the polynomial interpolation of deriving C(X) also takes O(n2).

To solve this efficiency problem, this section will introduce an efficient technique of polynomial evaluation which can evaluate a polynomial at n distinct roots of unity in O(nlogn). 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 FFT assumes a polynomial ring over complex numbers (§A-7), whereas NTT assumes a polynomial ring over the integer ring (§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).