Inversion

Presentation: https://youtu.be/9wpJk-wUa-w

1. Frobenius Mapping

Given a prime PP, the Frobenius Mapping Φ\Phi on an element aFPka \in \mathbb{F}_{P^k} is defined as: Φ(a)=aP\Phi(a) = a^P

This mapping is a crucial endomorphism of the field FPk\mathbb{F}_{P^k} that fixes the elements of the prime subfield FP\mathbb{F}_P.

2. Efficient Computation of Φ(a)\Phi(a)

Let the field element aa be represented as a polynomial over the prime field: a=i=0k1aixia = \sum_{i=0}^{k-1} a_i x^i, where aiFPa_i \in \mathbb{F}_P.

2.1. Basic Computation using Characteristic PP

Since the characteristic of the field is PP, we can apply the Freshman's Dreamarrow-up-right property:

Φ(a)=aP=(i=0k1aixi)P=i=0k1(ai)P(xi)P\Phi(a) = a^P = \left(\sum_{i=0}^{k-1} a_i x^i\right)^P = \sum_{i=0}^{k-1} (a_i)^P (x^i)^P

Since aiFPa_i \in \mathbb{F}_P, by Fermat's Little Theoremarrow-up-right, we have aiP=aia_i^P = a_i. Thus, the mapping simplifies to:

Φ(a)=i=0k1aixiP\Phi(a) = \sum_{i=0}^{k-1} a_i x^{iP}

2.2. Optimized Computation when P1(modk)P \equiv 1 \pmod k

If the extension is defined by an irreducible polynomial such that xk=ξx^k = \xi (where ξFP\xi \in \mathbb{F}_P), and P1(modk)P \equiv 1 \pmod k (meaning P1P-1 is divisible by kk), we can further optimize the expression.

Let q=P1kq = \frac{P-1}{k}. We can rewrite xiPx^{iP} using the field relation xk=ξx^k = \xi:

xiP=xi(qk+1)=xiqkxi=(xk)iqxi=ξiqxix^{iP} = x^{i(qk+1)} = x^{iqk} \cdot x^i = (x^k)^{iq} \cdot x^i = \xi^{iq} \cdot x^i

Substituting this back into the formula for Φ(a)\Phi(a):

Φ(a)=i=0k1ai(ξq)ixi=i=0k1ai(ξP1k)ixi=a0+a1(ξP1k)x+a2(ξP1k)2x2++ak1(ξP1k)k1xk1\begin{align*} \Phi(a) &= \sum_{i=0}^{k-1} a_i \left(\xi^q\right)^i x^i \\ &= \sum_{i=0}^{k-1} a_i \left(\xi^{\frac{P-1}{k}}\right)^i x^i \\ &= a_0 + a_1 \left(\xi^{\frac{P-1}{k}}\right) x + a_2 \left(\xi^{\frac{P-1}{k}}\right)^2 x^2 + \cdots + a_{k-1} \left(\xi^{\frac{P-1}{k}}\right)^{k-1} x^{k-1} \end{align*}

This demonstrates that if the set of scalar factors (ξP1k,,ξ(k1)P1k)\left(\xi^{\frac{P-1}{k}}, \dots, \xi^{(k-1){\frac{P-1}{k}}}\right) is pre-computed, the Frobenius mapping can be calculated efficiently using only scalar multiplications and polynomial addition.

circle-info

Pre-computation Note: Since Φk(a)=a\Phi^k(a) = a, we only need to pre-compute the set of iterated mappings (Φ(a),Φ2(a),,Φk1(a))\left(\Phi(a), \Phi^2(a), \dots, \Phi^{k-1}(a)\right) for use in the Norm and Inversion calculations.

3. Norm

The Norm of an element aFPka \in \mathbb{F}_{P^k}, denoted N(a)N(a), is defined as the product of aa and all its images under the iterated Frobenius mappings:

N(a)=i=0k1Φi(a)=a×Φ(a)×Φ2(a)××Φk1(a)N(a) = \prod_{i=0}^{k-1} \Phi^i(a) = a \times \Phi(a) \times \Phi^2(a) \times \cdots \times \Phi^{k-1}(a)

3.1. Key Property of the Norm

The most important property of the norm is that its result is an element of the prime subfield FP\mathbb{F}_P. N(a)FP\mathbf{N(a) \in \mathbb{F}_P}

Proof: We apply the Frobenius mapping to N(a)N(a):

Φ(N(a))=Φ(i=0k1Φi(a))=i=0k1Φ(Φi(a))=i=0k1Φi+1(a)=Φ1(a)×Φ2(a)××Φk1(a)×Φk(a)\begin{aligned} \Phi(N(a)) &= \Phi\left(\prod_{i=0}^{k-1} \Phi^i(a)\right) \\ &= \prod_{i=0}^{k-1} \Phi(\Phi^i(a)) \\ &= \prod_{i=0}^{k-1} \Phi^{i+1}(a) \\ &= \Phi^1(a) \times \Phi^2(a) \times \cdots \times \Phi^{k-1}(a) \times \Phi^k(a) \end{aligned}

Since Φk(a)=a\Phi^k(a) = a, we can replace the last term:

Φ(N(a))=Φ1(a)×Φ2(a)××Φk1(a)×a=N(a)\Phi(N(a)) = \Phi^1(a) \times \Phi^2(a) \times \cdots \times \Phi^{k-1}(a) \times a = N(a)

The condition Φ(N(a))=N(a)\Phi(N(a)) = N(a) means N(a)P=N(a)N(a)^P = N(a), which, by Fermat's Little Theorem, implies that N(a)N(a) must belong to the prime field FP\mathbb{F}_P.

4. Inversion on the Extension Field FPk\mathbb{F}_{P^k}

The norm N(x)N(x) is instrumental in efficiently computing the inverse x1x^{-1} for any non-zero element xFPkx \in \mathbb{F}_{P^k}.

4.1. Defining the Factor rr

Let rr be defined as the sum of powers of PP:

r=Pk1P1=i=0k1Pi=1+P+P2++Pk1r = \frac{P^k - 1}{P-1} = \sum_{i=0}^{k-1} P^i = 1 + P + P^2 + \cdots + P^{k-1}

We can rewrite x1x^{-1} using rr:

x1=xr1xrx^{-1} = x^{r-1} \cdot x^{-r}

4.2. Calculating xr1x^{r-1}

The exponent r1r-1 can be expressed as a sum of powers of PP:

r1=P+P2++Pk1r-1 = P + P^2 + \cdots + P^{k-1}

This allows xr1x^{r-1} to be calculated as a product of iterated Frobenius images:

xr1=xP×xP2××xPk1=Φ(x)×Φ2(x)××Φk1(x)=i=1k1Φi(x)x^{r-1} = x^P \times x^{P^2} \times \cdots \times x^{P^{k-1}} = \Phi(x) \times \Phi^2(x) \times \cdots \times \Phi^{k-1}(x) = \prod_{i=1}^{k-1}\Phi^i(x)

4.3. Calculating xrx^{-r}

Note that xr=xxr1x^r = x \cdot x^{r-1}. Comparing this to the Norm definition, we see that:

xr=xi=1k1Φi(x)=N(x)x^r = x \cdot \prod_{i=1}^{k-1}\Phi^i(x) = N(x)

Since xr=N(x)x^r = N(x) is an element of FP\mathbb{F}_P (a scalar), its inverse xr=N(x)1x^{-r} = N(x)^{-1} can be computed quickly within the prime field FP\mathbb{F}_P.

In practice, N(x)N(x) is simply the constant term of the polynomial resulting from the product xr1xx^{r-1} \cdot x:

xr=((xr1x)0)1x^{-r} = \left((x^{r-1} \cdot x)_0\right)^{-1}

where (A)0(A)_0 denotes the constant coefficient of polynomial AA.

4.4. Final Inversion Formula

The inverse x1x^{-1} is calculated as the product of the pre-computed Frobenius images xr1x^{r-1} and the inverse of the constant term N(x)N(x):

x1=xr1((xr1x)0)1x^{-1} = x^{r-1} \cdot \left((x^{r-1} \cdot x)_0\right)^{-1}

Written by Ryan Kim of Fractalyze

Last updated