I'm currently trying to implement the DFT in Finite Fields in Schönhage Strassen matter as theoretical refreshment for the NTT (FFT variant of the NTT).
My problem is that if I have an array of lets say $256$ elements that I want to process, to use $2$ as $256^\text{th}$ root of unity, I'm calculating in order of $8$, which are $256$ bit numbers and a problem for my application.
Since bit-shifting isn't expensive, it'd be nice if my unitroot would be in relation to the element $2$ or $2$ itself of $\mathrm{GF}(2^n \pm 1)$. At the same time there should be an inverse for every element in $\mathrm{GF}(q)$, where $q = 2^n \pm 1$, so then I can perform the inverse transform properly.
So I assume $q$ needs to be prime. (so I read about Fermat Prime numbers and Mersenne ones - and that s the first problem: the last Fermat Prime is $2^{16} + 1$)
But the ultimate goal, is that when I perform the DFT in an array of dimension $m$ that I get an $m^\text{th}$ root of unity so I can perform it properly. For the NTT $m$ is (normally) always power of $2$ (as long according no Chinese Remainder Theorem is used to restructure/reorder/reorganize the data).
However I fail to recall the relationship of $2$ as root of unity and $\mathrm{GF}(q)$. I numerically found out that $2$ seems to be a $2n^\text{th}$ root of unity in $\mathrm{GF}(2^n + 1)$.
So $(2^n)^2 \equiv 1 \pmod{2^n + 1}$ I also found out that $2^n \equiv 1 \pmod{2^n - 1}$. But that's only the $n^\text{th}$ root of unity which means that I can apply the DFT to an array of $n$ fields, requiring me to calculate in $\mathrm{GF}(2^n - 1)$ which is huge.
Finally I heard that $\sqrt{2}$ in $\mathrm{GF}(2^(n+2) + 1)$ is $2^{n+2}$ root of unity. Since it s a solution to $\theta^{2^{n+2}} \equiv 1 \pmod{2^{n+2} + 1}$. That might apply to my needs.
For that however I need an efficient way to calculate the square roots in $\mathrm{GF}(2^m \pm 1)$. I found a bunch articles which describe how you can calculate it what appears to me by circular shifts however those are only specified for $\mathrm{GF}(2^m)$; and I actually couldn't prove it numerically. Here is the link.
It states that $(x^{2^{n−1}})^2 = x^{2 \cdot 2^{n−1}} = x^{2^n} = x$ in $\mathrm{GF}(2^n)$ with $x^{2^{n-1}}$ so I put it into python:
n = 8
x = 2
(x**(2**(n-1))) % (2**n) # which is 0 and 0 * 0
# is not 2 in GF(2**n)
# and no other GF
This left me with a lot of confusion. Since calculating in finitefield 2^n does not have a multiplicative inverse for every element, it's probably not an application.
Can somebody look over my research? Is there a proper system behind fitting my problem of array dimension $m = 2^n$ into the DFT and later NTT (FFT variant of it) because $\mathrm{GF}(q)$ with $q$ needs to be prime in order to have proper chances for a proper inverse DFT.
Thank you in advance.