Cantor–Zassenhaus algorithm

From HandWiki
Short description: Algorithm for factoring polynomials over finite fields

In computational algebra, the Cantor–Zassenhaus algorithm is a method for factoring polynomials over finite fields (also called Galois fields).

The algorithm consists mainly of exponentiation and polynomial GCD computations. It was invented by David G. Cantor and Hans Zassenhaus in 1981.

It is arguably the dominant algorithm for solving the problem, having replaced the earlier Berlekamp's algorithm of 1967. It is currently implemented in many computer algebra systems.

Overview

Background

The Cantor–Zassenhaus algorithm takes as input a square-free polynomial [math]\displaystyle{ f(x) }[/math] (i.e. one with no repeated factors) of degree n with coefficients in a finite field [math]\displaystyle{ \mathbb{F}_q }[/math] whose irreducible polynomial factors are all of equal degree (algorithms exist for efficiently factoring arbitrary polynomials into a product of polynomials satisfying these conditions, for instance, [math]\displaystyle{ f(x)/\gcd(f(x),f'(x)) }[/math] is a squarefree polynomial with the same factors as [math]\displaystyle{ f(x) }[/math], so that the Cantor–Zassenhaus algorithm can be used to factor arbitrary polynomials). It gives as output a polynomial [math]\displaystyle{ g(x) }[/math] with coefficients in the same field such that [math]\displaystyle{ g(x) }[/math] divides [math]\displaystyle{ f(x) }[/math]. The algorithm may then be applied recursively to these and subsequent divisors, until we find the decomposition of [math]\displaystyle{ f(x) }[/math] into powers of irreducible polynomials (recalling that the ring of polynomials over any field is a unique factorisation domain).

All possible factors of [math]\displaystyle{ f(x) }[/math] are contained within the factor ring [math]\displaystyle{ R = \frac{\mathbb{F}_q[x]}{\langle f(x) \rangle} }[/math]. If we suppose that [math]\displaystyle{ f(x) }[/math] has irreducible factors [math]\displaystyle{ p_1(x), p_2(x), \ldots, p_s(x) }[/math], all of degree d, then this factor ring is isomorphic to the direct product of factor rings [math]\displaystyle{ S = \prod_{i=1}^s \frac{\mathbb{F}_q[x]}{\langle p_i(x) \rangle} }[/math]. The isomorphism from R to S, say [math]\displaystyle{ \phi }[/math], maps a polynomial [math]\displaystyle{ g(x) \in R }[/math] to the s-tuple of its reductions modulo each of the [math]\displaystyle{ p_i(x) }[/math], i.e. if:

[math]\displaystyle{ \begin{align} g(x) & {} \equiv g_1(x) \pmod{p_1(x)}, \\ g(x) & {} \equiv g_2(x) \pmod{p_2(x)}, \\ & {} \ \ \vdots \\ g(x) & {} \equiv g_s(x) \pmod{p_s(x)}, \end{align} }[/math]

then [math]\displaystyle{ \phi(g(x) + \langle f(x) \rangle) = (g_1(x) + \langle p_1(x) \rangle, \ldots, g_s(x) + \langle p_s(x) \rangle) }[/math]. It is important to note the following at this point, as it shall be of critical importance later in the algorithm: Since the [math]\displaystyle{ p_i(x) }[/math] are each irreducible, each of the factor rings in this direct sum is in fact a field. These fields each have degree [math]\displaystyle{ q^d }[/math].

Core result

The core result underlying the Cantor–Zassenhaus algorithm is the following: If [math]\displaystyle{ a(x) \in R }[/math] is a polynomial satisfying:

[math]\displaystyle{ a(x) \neq 0, \pm 1 }[/math]
[math]\displaystyle{ a_i(x) \in \{0,-1,1\}\text{ for }i=1,2,\ldots, s, }[/math]

where [math]\displaystyle{ a_i(x) }[/math] is the reduction of [math]\displaystyle{ a(x) }[/math] modulo [math]\displaystyle{ p_i(x) }[/math] as before, and if any two of the following three sets is non-empty:

[math]\displaystyle{ A = \{ i \mid a_i(x) = 0 \}, }[/math]
[math]\displaystyle{ B = \{ i \mid a_i(x) = -1 \}, }[/math]
[math]\displaystyle{ C = \{ i \mid a_i(x) = 1 \}, }[/math]

then there exist the following non-trivial factors of [math]\displaystyle{ f(x) }[/math]:

[math]\displaystyle{ \gcd(f(x),a(x)) = \prod_{i \in A} p_i(x), }[/math]
[math]\displaystyle{ \gcd(f(x),a(x)+1) = \prod_{i \in B} p_i(x), }[/math]
[math]\displaystyle{ \gcd(f(x),a(x)-1) = \prod_{i \in C} p_i(x). }[/math]

Algorithm

The Cantor–Zassenhaus algorithm computes polynomials of the same type as [math]\displaystyle{ a(x) }[/math] above using the isomorphism discussed in the Background section. It proceeds as follows, in the case where the field [math]\displaystyle{ \mathbb{F}_q }[/math] is of odd-characteristic (the process can be generalised to characteristic 2 fields in a fairly straightforward way[citation needed]). Select a random polynomial [math]\displaystyle{ b(x) \in R }[/math] such that [math]\displaystyle{ b(x) \neq 0, \pm 1 }[/math]. Set [math]\displaystyle{ m=(q^d-1)/2 }[/math] and compute [math]\displaystyle{ b(x)^m }[/math]. Since [math]\displaystyle{ \phi }[/math] is an isomorphism, we have (using our now-established notation):

[math]\displaystyle{ \phi(b(x)^m) = (b_1^m(x) + \langle p_1(x) \rangle, \ldots, b^m_s(x) + \langle p_s(x) \rangle). }[/math]

Now, each [math]\displaystyle{ b_i(x) + \langle p_i(x)\rangle }[/math] is an element of a field of order [math]\displaystyle{ q^d }[/math], as noted earlier. The multiplicative subgroup of this field has order [math]\displaystyle{ q^d-1 }[/math] and so, unless [math]\displaystyle{ b_i(x)=0 }[/math], we have [math]\displaystyle{ b_i(x)^{q^d-1}=1 }[/math] for each i and hence [math]\displaystyle{ b_i(x)^m = \pm 1 }[/math] for each i. If [math]\displaystyle{ b_i(x)=0 }[/math], then of course [math]\displaystyle{ b_i(x)^m=0 }[/math]. Hence [math]\displaystyle{ b(x)^m }[/math] is a polynomial of the same type as [math]\displaystyle{ a(x) }[/math] above. Further, since [math]\displaystyle{ b(x) \neq 0, \pm1 }[/math], at least two of the sets [math]\displaystyle{ A,B }[/math] and C are non-empty and by computing the above GCDs we may obtain non-trivial factors. Since the ring of polynomials over a field is a Euclidean domain, we may compute these GCDs using the Euclidean algorithm.

Applications

One important application of the Cantor–Zassenhaus algorithm is in computing discrete logarithms over finite fields of prime-power order. Computing discrete logarithms is an important problem in public key cryptography. For a field of prime-power order, the fastest known method is the index calculus method, which involves the factorisation of field elements. If we represent the prime-power order field in the usual way – that is, as polynomials over the prime order base field, reduced modulo an irreducible polynomial of appropriate degree – then this is simply polynomial factorisation, as provided by the Cantor–Zassenhaus algorithm.

Implementation in computer algebra systems

The Cantor–Zassenhaus algorithm is implemented in the PARI/GP computer algebra system as the factorcantor() function.

See also

References