NTT Over Extension Field
The Core Concept
When computing a NTT over an Extension Field (e.g., Fp2), we can avoid doing operations over the extension field. Instead, we can "flatten" the data into the base field (Fp), run a standard NTT on the base components independently, and then reconstitute the result.
1. The Transformation
Imagine we are working in a Quadratic Extension Field, where every element e is represented as a+b⋅u.
a,b: Coefficients in the base field.
u: The extension basis (imaginary unit).
Instead of processing one column of "extension elements," we process two columns of "base elements."
The Algorithm:
Split: Take the input vector of elements (ai+biu) and split it into two vectors: A=[a0,a1...] and B=[b0,b1...].
Compute: Run the standard base field NTT on A and B separately.
Merge: The result for index k is simply NTT(A)k+NTT(B)k⋅u.
2. Why this works
The validity of this optimization relies on one critical constraint: The Root of Unity (ω) must exist in the base field.
If ω is in the base field, multiplying an extension element by ω scales the components independently.
The Proof
Let us show the proof in the quadratic extension field case but it scales to arbitrary degree of extension field using the same logic.
Definition 5: The Number Theoretic Transform (NTT) of a vector of polynomial coefficients a is defined as a^=NTT(a), where:
and j=0,1,…,n−1. Here, a^ denotes the evaluations of the polynomial defined by a over {ω0,ω1,…,ωn−1} which are the roots of (xn−1).
Let our vector of coefficients in extension field be x, where each element is defined by:
The definition of the NTT for output x^ is:
Substitute xi and since ω is in the base field, we can distribute it:
And if we think about the NTT over the base field, we have:
Now, we can rewrite the x^j as:
3. The Constraint (When this fails)
This optimization only works if the twiddle factor ω is in the base field.
If ω were in the extension field (e.g., ω=c+du), the multiplication would "mix" the components:
Because the new "real" part (ca−db) depends on both a and b, you could not process the columns independently.
Summary
Standard NTT: O(NlogN) operations using expensive extension field arithmetic.
Flattened NTT: d×O(NlogN) operations using base field arithmetic where d is extension degree.
Last updated