On decoding additive generalized twisted Gabidulin codes

In this paper, we consider an interpolation-based decoding algorithm for a large family of maximum rank distance codes, known as the additive generalized twisted Gabidulin codes, over the finite field Fqn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$\mathbb {F}_{q^{n}}$\end{document} for any prime power q. This paper extends the work of the conference paper Li and Kadir (2019) presented at the International Workshop on Coding and Cryptography 2019, which decoded these codes over finite fields in characteristic two.


Introduction
Error correction codes with the rank metric have found applications in space-time coding [27], random network coding [44] and cryptography [12]. Many important properties of rank metric codes including the Singleton like bound were independently studied by Delsarte [9] , Gabidulin [13] and Roth [38]. Codes that achieve this bound were called maximum rank distance (MRD) codes. The most famous sub-family of MRD codes are Gabidulin codes which is the rank metric analog of Reed-Solomon codes. They have been extensively studied in the literature [9,12,13,25,36,38].
Finding new families of MRD codes has been an interesting research topic since the invention of Gabidulin codes. In [20,39], the Frobenious automorphism in the Gabidulin codes were generalized to arbitrary automorphism and generalized Gabidulin (GG) codes were proposed. In the past few years, a considerable amount of work has been done on MRD codes. In [40], Sheekey twisted the evaluation polynomial of a Gabidulin code and proposed a large family of MRD codes termed twisted Gabidulin (TG) codes. Using the same idea for generalizing Gabidulin codes, arbitrary automorphism was employed to construct generalized twisted Gabidulin (GTG) codes. This family of MRD codes were first described in [40,Remark 9] and later comprehensively studied in [26]. Otal andÖzbudak [30] later introduced a large family of MRD codes, known as additive generalized twisted Gabidulin (AGTG) codes, which contains all the aforementioned linear MRD codes as sub-families and new additive MRD codes. There are also some new families of MRD codes which are not equivalent to AGTG codes nor its subfamilies [5,8,42,47]. Recent constructions of linear and nonlinear MRD codes were lately summarized in [31,41].
MRD codes with efficient decoding algorithm are of great interest in practice. In his pioneering work [13], Gabidulin gave a decoding algorithm based on extended Euclidean algorithm. Subsequently, Richter and Plass in [36], and Loidreau [25] proposed modified version of Berlekamp-Massey and Welch-Berlekamp algorithms to decode Gabidulin codes. Some of the aforementioned algorithms were further optimized in [45,48]. Nevertheless, the known decoding algorithms for Gabidulin codes cannot be directly applied to those new MRD codes with twisted evaluation polynomials, especially when the MRD codes are only linear over the ground field F q or its subfield. By modifying the decoding algorithm in [19] for subspace codes, Randrianarisoa and Rosenthal in [37] proposed a decoding method for the twisted Gabidulin codes, which works only for a limited option of parameters. Randrianarisoa later proposed an interpolation approach to decoding twisted Gabidulin codes in [35] , where he gave a brief discussion on the case when the rank of the error vector reaches the unique error-correcting radius of the twisted Gabidulin codes.
In this paper, we apply the interpolation approach by Randrianarisoa [35] in decoding additive generalized twisted Gabidulin (AGTG) codes, which contain (generalized) twisted Gabidulin codes and (generalized) Gabidulin codes as special cases. For AGTG codes with minimum rank distance d, if an error vector has rank strictly less than d−1 2 , the decoding process can be directly converted to the decoding of generalized Gabidulin codes, for which existing decoding algorithms in [25,36,48] can be applied. On the other hand, when the error vector has rank exactly d−1 2 (with d being odd), a new problem arises and one needs an efficient way to solve a quadratic polynomial. Solving a given quadratic polynomial over finite fields in general is a challenging problem. The quadratic polynomial derived from the decoding of AGTG codes has a close connection to a projective polynomials P (x). Different from the short discussion in [35], we study the projective polynomial P (x) in greater depth. We start with the discussion on the number of roots of P (x) according to its coefficients and the characteristic of the finite field F q n , propose methods to find roots of P (x) for each case, and finally adopt the result in the decoding algorithm for AGTG codes.
The remainder of this paper is structured as follows. Section 2 introduces some preliminaries, where we particularly recall some properties of linearized polynomial and recently constructed twisted MRD codes. Section 3 summarizes the interpolation decoding approach for additive generalized twisted Gabidulin codes and identifies the crucial quadratic polynomial when the rank of error reaches d−1 2 (with d being odd). Section 4 is dedicated to the study of the quadratic polynomial and to finding roots of the corresponding projective polynomial P (x). Section 5 integrates the interpolation decoding procedure and the result of Section 4 into an explicit algorithm and discusses the complexity of the proposed algorithm. Section 6 concludes the work of this paper.

Preliminaries
Let q be a power of a prime p. Throughout this paper we denote by F q r the finite field with q r elements for an arbitrary positive integer r.

Linearized polynomial
A polynomial of the form L(x) = k−1 i=0 l i x q i over F q n is known as a q-polynomial [29]. Define a set It is easy to verify that L k (F q n ), +, • forms a non-commutative F q -algebra, where + denotes the conventional polynomial addition and • denotes the symbolic product given by ). Note that symbolic product is associative and distributive, but noncommutative in general. For a nonzero L( When q is fixed or the context is clear, it is also customary to speak of a linearized polynomial as it satisfies the linearity property: L(c 1 x + c 2 y) = c 1 L(x) + c 2 L(y) for any c 1 , c 2 ∈ F q and any x, y in an arbitrary extension F q n . Hence a linearized polynomial L(x) ∈ L n (F q n ) indicates an F q -linear transformation L from F q n to itself.
Known MRD codes in the literature are mostly given in the terms of linearized polynomials. Some relevant definitions and auxiliary results are recalled below. Definition 1 For a nonzero linearized polynomial L(x) = k−1 i=0 l i x q i over F q n , its rank is given by where Img(L) = L(x)|x ∈ F q n and Ker(L) = {x ∈ F q n |L(x) = 0}.
For a linearized polynomial L(x) = k i=0 l i x q i with q-degree k, i.e., l k = 0, it is clear that Ker(L) has at most q k elements. From the definition, the linearized polynomial L(x) has Sheekey in [40] characterizes a necessary condition for L(x) to have rank n − k as below.
Lemma 1 [40] Suppose a linearized polynomial L(x) = l 0 x + l 1 x q + · · · + l k x q k , l k = 0, in L n (F q n ) has q k roots in F q n . Then where Norm q n /q (x) = x 1+q+···+q n−1 is the norm function from F q n to F q .
Furthermore, the necessary and sufficient condition for L(x) with q-degree k to have q k roots in F q n was independently characterized recently in [28,Theorem 7] and [7,Theorem 1.2], where all coefficients of L(x) are involved.
Below we recall two interesting matrices, of which properties and connection are critical for the decoding algorithm in this paper. [24,49] Given a vector a = (a 0 , . . . , a n−1 ) over F q n , the Dickson matrix associated with a is given by

Definition 2
and the Moore matrix associated with a is given by The Dickson matrix and Moore matrix have the following properties: Lemma 2 For two vectors a = (a 0 , . . . , a n−1 ) and The proof follows from direct calculations and is thus omitted here. Let D n (F q n ) be the set of all n × n Dickson matrices over F q n . It is shown in [49] that D n (F q n ) forms an F q -algebra and there is an isomorphism ϕ between L n (F q n ) and D n (F q n ) given by A Dickson matrix D will be said to be associated with a linearized polynomial L(x) if ϕ(L(x)) = D.
Proposition 1 [49]. Let L be the linear transformation induced by a linearized polynomial L(x) ∈ L n (F q n ) and D be the Dickson matrix associated with L(x). Then Rank(L) = Rank(D) and det(L) = det(D).
It is well known [24] that given a linearized polynomial L(x) = n−1 i=0 l i x q i over F q n , it is a permutation of F q n , i.e., Rank(L) = n, if and only if its associated Dickson matrix is non-singular; or equivalently its associated Moore matrix is non-singular. It follows from the fact that the determinant of a Moore matrix vanishes if and only if the entries of its first column are linearly dependent. In fact, more interesting connections between a linearized polynomial L(x) in L n (F q n ) and its associated Dickson matrix can be established.

Proposition 2 [35, Theorem 3]
Assume a linearized polynomial L(x) = n−1 i=0 l i x q i over F q n has rank k. Then its associated Dickson matrix D in (5) has rank k over F q n . Moreover, any k × k submatrix formed by k consecutive rows and k consecutive columns in D is invertible.
which reduces to a q-polynomial over F q n for s = 1, is a generalization of q-polynomial.
The aforementioned properties of q-polynomials can be similarly obtained as for σpolynomials. For instance, the σ -polynomial L σ (x) = k i=0 l i x σ i with l k = 0 also has Rank(L) = n − dim F q (Ker(L)) ≥ n − k [15]. When q is replaced by σ in the definition of the Dickson and Moore matrices, they are called the σ -version Dickson matrix and the σ -version Moore matrix, respectively. The σ -version Dickson and Moore matrices have the same properties as characterized in Lemma 2 and Proposition 2.

Maximum rank distance (MRD) codes
Let n and m be two positive integers. The rank of a vector a = (a 1 , a 2 , . . . , a n ) over F q m is defined as the dimension of span F q a 1 , a 2 , . . . , a n which is the vector space spanned by a i 's over F q . The rank distance between two vectors a, b ∈ F q m is defined as d R (a, b) = Rank(a − b).

Definition 3
A rank metric (n, M, d)-code over F q m is a subset of F n q m with size M and minimum rank distance d. Furthermore, it is called a maximum rank distance (MRD) code if it attains the Singleton-like bound M ≤ q min{m(n−d+1),n(m−d+1)} .
The Gabidulin codes are the most well-known MRD codes [13]. This family of MRD codes were further generalized in [20,39], where the Frobenius automorphism of F q n was replaced by a generic automorphism x → x σ with σ = q s and gcd(s, n) = 1. The generalized Gabidulin (GG) code GG n,k over F q m with length n and dimension k is defined by where α 0 , α 1 , . . . , α n−1 in F q m are linearly independent over F q . When σ = q, i.e., s = 1, the code GG n,k reduces to the original Gabidulin code [13]. The choice of independent points α 0 , α 1 , . . . , α n−1 does not affect the rank property. Hence it is customary to express generalized Gabidulin codes without the evaluation points as We will also omit the evaluation points α 0 , α 1 , . . . , α n−1 in the following introduction of recent twisted MRD codes [26,30,40]. For consistency with the parameters of MRD codes in [26,30,40], throughout what follows we always assume n = m.
Recent constructions of MRD codes largely depend on the number of roots of certain linearized polynomials. From Lemma 1 it is readily seen that a linearized polynomial L(x) of q-degree k has rank at least n − k + 1 if the condition (2) is not met. In [40] Sheekey adopted Lemma 1 to construct twisted Gabidulin (TG) codes and described the generalized twisted Gabidulin (GTG) codes, which was intensively studied by Lunardon et al. [26].
Proposition 3 [26,40] Let n, k, s be positive integers such that k < n and gcd(s, n) = 1. Let η be a nonzero element in F q n satisfying Norm q sn /q s (η) = (−1) nk . Then the set is an MRD code with minimum rank distance d = n − k + 1.
The idea of manipulating some terms of linearized polynomials to construct new MRD codes was further extended in [30,31,33]. Below we recall from [30] the additive generalized twisted Gabidulin (AGTG) codes , for which we will propose an interpolation-based decoding algorithm in the next section.

Proposition 4 [30]
Let n, k, s, h ∈ Z + satisfying gcd(s, n) = 1 and k < n. Let q = q u 0 and η ∈ F q n such that Norm q sn /q s 0 (η) = (−1) nku . Then the set is an F q 0 -linear (but not necessarily F q -linear) MRD code of size q nk and minimum rank distance n − k + 1.
The above AGTG codes reduce to GTG codes when q 0 = q and to GG codes when η = 0 or q 0 = 2. Very recently, Sheekey in [42] showed the existence of a new family of MRD codes which is not equivalent to AGTG codes and Trombetti-Zhou codes in [47]. Recent MRD codes that are constructed based on Lemma 1 were formulated in a united manner in [41] and [22].
Below we briefly describe the encoding process of the AGTG codes, which provides the notational conventions and a reference for the interpolation decoding process.

Encoding AGTG codes
For an AGTG code with evaluation points α 0 , α 1 , . . . , α n−1 that are linearly independent over F q , the encoding of a message f = (f 0 , . . . , f k−1 ) is the evaluation of the following linearized polynomial at points α 0 , α 1 , . . . , α n−1 : . . , 0) be a vector of length n over F q n and M be the σ -version Moore matrix generated by α i 's, where 1 ≤ i, j ≤ n − 1, i.e., Then the encoding of AGTG codes can be expressed as Here it is worth noting that in encoding process, one actually only needs to calculate the Here we express it as in (10) for being consistent with the decoding procedure.

Decoding AGTG codes with an error-interpolation polynomial g(x)
For a received word r = c + e with an error e added to the codeword c during transmission, when the error e has rank t ≤ n−k 2 , the unique decoding task is to recover the unique codeword c such that d R (c, r) ≤ n−k 2 . When the rank t of the error is strictly smaller than n−k 2 , the decoding of AGTG codes H k,s,q 0 (η, h) can be converted to the decoding of GG codes GG n,k+1 . More concretely, one can use the existing decoding algorithms, e.g., [25,36,48], for (generalized) Gabidulin codes to establish a system of n − (k + 1) − t independent affine equations and t unknowns, which is uniquely solvable since 2t ≤ n − (k + 1). However, when the rank t achieves the unique error-correcting radius, i.e., (n − k) is even and t = n−k 2 , one needs more equation(s) on the unknowns and new techniques are required. In the interpolation decoding for the TG codes by Randrianarisoa [35], the problem was converted to certain quadratic equations. However, how to efficiently solve the corresponding quadratic equations was little considered in [35].
Below we shall extend Randrianarisoa's idea to the larger family of AGTG codes and investigate the quadratic equations in greater depth. For self-completeness, we briefly describe the process of interpolation decoding and how it is transformed to solving certain quadratic equation for the case that 2t = n − k. Suppose It is clear that the error vector e is uniquely determined by the polynomial g(x). Denote a vector g = (g 0 , . . . , g n−1 ). From (10) and (11) it follows that This is equivalent to Letting γ = (γ 0 , . . . , γ n−1 ) = r · (M T ) −1 , we obtain (g k+1 , . . . , g n−1 ) = (γ k+1 , . . . , γ n−1 ) and − ηg since ηf Therefore, the task of correcting error e is equivalent to reconstructing g(x) from the available information characterized in (13). This reconstruction process heavily depends on the property of the associated σ -version Dickson matrix of g(x) and will be discussed in Section 3.3.

Reconstructing the interpolation polynomial g(x)
Similarly to the definition in (3), the σ -version Dickson matrix associated with g(x) can be given by where the indices i, j run through {0, 1, . . . , n − 1} and G j is the j -th column of G. According to Proposition 2, the matrix G has rank t and any t × t matrix formed by t successive rows and columns in G is nonsingular. Then G 0 can be expressed as a linear combination of G 1 , . . . , G t , namely, G 0 = λ 1 G 1 + λ 2 G 2 + · · · + λ t G t , where λ 1 , . . . , λ t are elements in F q n . This yields the following recursive equations where the subscripts in g i 's are taken modulo n. Recall that the elements g k+1 , . . . , g n−1 are known from (13). Hence we obtain the following linear equations with known coefficients and variables λ 1 , . . . , λ t : The above recurrence gives a generalized version of q-linearized shift register as described in [43], where (λ 1 , . . . , λ t ) is the connection vector of the shift register. It is the key equation for the decoding algorithm in this paper, by which we shall reconstruct g(x) in two major steps: Step 1. derive the coefficients λ 1 , . . . , λ t from (13) and (16); Step 2. use λ 1 , . . . , λ t to compute g k−1 , . . . , g 0 recursively from (15).
Note that Step 1 is the critical and challenging step in the decoding process, and Step 2 is simply a recursive that can be done fast. The following discussion shows how the procedure of Step 1 works. As discussed in the beginning of this section, for an error vector with Rank(e) = t ≤ n−k 2 , i.e., 2t + k ≤ n, we can divide the discussion into two cases. Case 1: 2t + k < n. In this case, (16) contains n − k − t − 1 ≥ t affine equations in variables λ 1 , . . . , λ t , which has rank t. Hence the variables λ 1 , . . . , λ t can be uniquely determined. Here we assume the code has high code rate, for which the Berlekamp-Massey (BM) algorithm is more efficient [14]. Another reason for choosing the BM algorithm is that it outputs the intermediate polynomial B (n−k−1) (x) which will be used in Case 2. Although the recurrence (16) is a generalized version of the ones in [36,43], the modified BM algorithm [36,43] can be applied here to recover the coefficients λ 1 , . . . , λ t . For self-completeness we recall the modified BM algorithm in Algorithm 1. The coefficients of (n−k−1) (x) are the desired λ i 's.
Case 2: 2t + k = n. In this case (16) gives n − k − t − 1 = t − 1 independent affine equations in variables λ 1 , . . . , λ t . For such an under-determined system of linear equations, we will have a set of solutions (λ 1 , . . . , λ t ) that has dimension 1 over F q n . Namely, the solutions will be of the form where λ, λ are fixed elements in F t q n and ω runs through F q n . As shown in [43,Th. 10], the solution can be derived from the modified BM algorithm with a free variable ω. Next we will show how the element ω is determined by other information in (13).

Re-arranging the equations gives
where c 0 , c 1 , c 2 , c 3 are derived from λ, λ and the known g i 's. Furthermore, from (13)  into (17) gives This equation can be re-arranged as where q = q u 0 , v = h + ust, u 0 , . . . , u 3 are derived from c 0 , . . . , c 5 and η. Since the error e with rank t = n−k 2 = d−1 2 can be uniquely decoded, the polynomial should have roots w in F q n that lead to solutions λ + ωλ in (16) and (g 0 , g k ) in (17).
With the coefficients λ 1 , . . . , λ t in Step 1 and the initial state g n−1 , . . . , g n−t , one can recursively compute g 0 , . . . , g k−1 according to (15) in Step 2. Note that not all solutions of P(x) lead to correct coefficients of the error interpolation polynomial. In fact, by the expression of Dickson matrix of g(x), correct g(x) should have the sequence (g n−1 , . . . , g n−t , . . .) generated from (15) has period n. In other words, if the output sequence has period n, we know that the corresponding polynomial g(x) = n−1 i=0 g i x [i] is the desired error interpolation polynomial. From the above discussion, the remaining task of decoding is to efficiently find roots of P(x) in F q n , which will be discussed in the next section.

Finding roots of the polynomial P(x)
This subsection is dedicated to finding solutions to the following equation in F q n = F q nu 0 : When q = q u 0 = q 0 , the polynomial P can be reduced to P (x) in [35,Page 10]. In [35], the author converted solving P (x) = 0 to the factorization of the linearized polynomial x q 2l + ax q l + bx. Nevertheless, factoring x q 2l + ax q l + bx is not necessarily easy and there's no efficient algorithm, as far as we know, for factoring this linearized polynomial. Therefore, it's important to further investigate how to efficiently solve P(x).
When u 0 = 0, we transform the equation P(x) = 0 into where . The polynomial P (x) can be seen as a reduced version of the original polynomial P(x). It is clear that if a = 0, then P (x) = 0 has either no solution or nu gcd(un,v) and q 0 are odd, 1, if nu gcd(un,v) is odd, and q 0 is even solutions, depending on whether −b is an m-th power; and that if b = 0, P (x) = 0 has either zero as its unique solution or q d 0 solutions. When ab = 0, the polynomial P (x) = x q v 0 +1 + ax + b over F q un 0 has a variety of applications in the construction of different sets with Singer parameters [10], construction error correcting codes [3], APN functions [4] and computing cross-correlation between msequences [11,16].
The polynomial P (x) is a type of projective polynomials [1], which in general has the form a 0 + a 1 x + a 2 x (2) + · · · + a l x (l) ∈ F q n [x], where x (i) = x q i −1 q−1 . Bluher in [2] showed that the projective polynomial where q is any prime power and r, n are arbitrary two positive integers, has exactly 0, 1, 2, q r 0 + 1 possible number of zeros in F q n with r 0 = gcd(r, n). Before the discussion on finding roots of P (x), it is important to know the possible number of roots and the corresponding conditions on the coefficients of P (x). In the following we will discuss different ways to find and express the zeros of P (x). First, we present a relations among roots of P (x), which is inspired by [11, Lemma 22] and generalized for any prime power q.

Proposition 5
For positive integers r, n and a prime power q, the projective polynomial P (x) = x q r +1 + ax + b, a, b ∈ F * q n has 0,1,2 or q r 0 + 1 roots x ∈ F q n , where r 0 = gcd(r, n). Moreover, if P has three different roots x 0 , x 1 and x 2 ∈ F q n , then all the roots can be characterized as where (A 0 , A 1 , A 2 ) = (0, 0, 0) and A 0 + A 1 + A 2 = 0.
Proof Suppose P (x 0 ) = 0 for an element x 0 in F q n . For a nonzero λ ∈ F * q n , one has Thus P (λ+x 0 ) = 0 if and only if 1 λ is a solution of the affine equation Depending on x 0 , L 0 (z) may have a single solution if x q r 0 + a = 0 or q r 0 solutions if x 0 (x q r 0 + a) −1 is a (q r 0 − 1)-th power in F q n . Hence the affine equation L 0 (z) = 0 has either 0, 1 or q r 0 nonzero solutions in F q n . For each nonzero solution z of L 0 (z) = 0, we get a root x 0 + 1 z of the projective polynomial P (x). On the other hand, when P (x) has three distinct roots x 0 , x 1 and x 2 , we obtain two different roots 1 x 1 −x 0 and 1 x 2 −x 0 of the affine equation L 0 (z) = 0 and their difference 1 . Hence, z = 1 x 1 −x 0 + Ay runs through all roots of L 0 (z). Consequently, assuming (A 0 , A 1 , A 2 ) = (1, A, −(A + 1)), A 0 runs through all roots of P (x) different from x 0 , while A runs through F q r 0 .
The above result gives a method to express all the roots of the projective polynomials P (x) = x q r +1 + ax + b, a, b ∈ F * q n in terms of the three known roots in F q n . Moreover, from its proof, a method to describe the roots of the projective polynomial P (x) in terms of the roots of the affine polynomial L 0 (z). Nevertheless, the condition that characterizes the exact number of solutions to the affine equation L 0 (z) = (x q r 0 + a)z q r + x 0 z + 1 is not clear. In order to investigate the number of roots of P (x) = x q r +1 + ax + b in F q n according to its coefficients, we need to divide the discussion into two cases: q is even; or q is odd and gcd(r, n) = 1.

Solving the equation P (x) = 0 over finite fields of characteristic 2
When the finite field F q n has characteristic 2, the polynomial P (x) can be further converted to F c (x) = x q r +1 + x + c = 0, which was intensively studied in [17,18,21]. Helleseth and Kholosha in [17,18] explicitly gave the root of F c (x) = 0 in terms of the coefficient c when it has a single zero in F q n and when it has two zeros in F q n if gcd(r, n) is odd. Very recently, Kim and Mesnager in [21] further studied the equation for the case q = 2 and gcd(r, n) = 1 and explicitly calculated all possible zeros of F c (x) in F q n . Since for general AGTG codes, the parameter q 0 is always greater than 2. Below we shall recall the result by Helleseth and Kholosha [18] and apply it to find the roots of the projective polynomial P (x) in some cases.
Note that the AGTG codes are defined over F q n with q a prime power. In this context, we assume q is a power of 2. To avoid potential confusion of notations, below we recall the result from [18] and treat the underlying finite field as F 2 m , where m is a positive integer. Let l be a positive integer with d = gcd(l, m) and denote m 1 = l/d. Define two sequences of polynomials in recurrence as follows: for i = 1, 2, . . . , m 1 − 1.
As an illustration, we apply Proposition 6 i) to a general polynomial G(x) in the following proposition, which will be used to explicitly give the zero of P (x) in F 2 m with m = nuw. The second cases can be applied in a similar manner.

Proposition 7 The polynomial
G(x) = x 2 l +1 + a 1 x 2 l + a 2 x + a 3 over F 2 m has exactly one zero in F 2 m if and only if one of the following conditions holds: Moreover, for Cases (i) and (ii), the zero of G(x) is given by x = a 1 + (a 1 a 2 + a 3 ) 1 2 l +1 ; for Case (iii), the unique zero is given by Proof It is relatively easy to verify Case i) and Case ii). In fact, when a 2 = a 2 l 1 , one obtains the equation The statement of Case i) immediately follows; and for Case ii), it is easily seen that the equation has a single solution only if gcd(2 l + 1, 2 n − 1) = 1, equivalently, m 1 = n/ gcd(l, n) is odd.
It is clear that y is a zero of F c (y) = y 2 l +1 + y + c if and only if x = sy + a 1 is a zero of G(x). The desired statement follows from Proposition 6.

Corollary 1
Let q 0 = 2 w for a positive integer w, l = wv, m = wun and m 1 = m/ gcd(l, m). Let C i (x), Z i (x) be defined as in (23) respectively. Then the polynomial x q v 0 +1 + a 1 x q v 0 + a 2 x + a 3 over F q n has exactly one solution in F q n given by

Solving the equation P (x) = 0 over F q n when gcd(r, n) = 1
For the projective polynomial P (x) = x q r +1 + ax + b with gcd(r, n) = 1, McGuire and Sheekey recently in [28] gave a complete criteria on the coefficients a, b for P (x) = 0 to have 0, 1, 2 and q + 1 solutions in F q n by the analysis of the companion matrix of P (x). Let σ = q r and define a sequence of 2 × 2 matrices as follows: where C 1 is termed the companion matrix of P (x), and C σ i k is the matrix obtained from C k by applying to each of its entries the automorphism x → x σ i . Furthermore, define a matrix Since det(C 1 ) = b and N(b) = b 1+σ +···+σ n−1 , one can easily verify det(A P ) = N(b). Denote where a (i) = a σ i −1 σ −1 and G n can be computed using the recursive relation Then it follows that Hence one can express A P associated with P (x) in terms of G n as follows: where N(a) denotes the field norm of a ∈ F q n from F q n to F q and u = b q /a q+1 . Note that if G n−1 = 0 then A P will be a diagonal matrix.
Theorem 1 [28] The number of roots of the projective polynomial P (x) in F q n is given by where n λ is the dimension of the eigenspace of A P corresponding to the eigenvalue λ. The number of roots of L(x) in F q n is given by q n 1 . In other words, the dimension of the kernel of L(x) is 2 − Rank(A L − I 2 ).
Theorem 2 [28] The polynomial P (x) has q d − 1 q − 1 roots in F q n if and only if where d is the dimension of the eigenspace of the matrix A P .
The characteristic polynomial S P (x) ∈ F q [x] of a 2 × 2 matrix A P is of the form where Tr(A P ) is the trace of the matrix A P and it is defined as the sum of its diagonal elements and det(A L ) is the determinant of the matrix A P . The polynomial S P (x) can have 0,1 or 2 roots in F q . For odd prime power q, the discriminant S of the quadratic polynomial S P (x) is of the form Case 1) if S is a non-square in F q , S P (x) has no solutions in F q , then P (x) has no solution in F q n . Case 2) If S = 0, S P (x) has a unique solution λ in F q , then P (x) has 1 or q +1 solutions in F q n .
i) If the dimension of the eigenspace corresponding to λ is two, then P (x) has q + 1 solutions in F q n . Due to Theorem 2, this will happen if and only if A P = λI 2 i.e. G n−1 = 0 and G n ∈ F q . ii) If the dimension of the eigenspace corresponding to λ is one, then P (x) has one solution in F q n . Due to Theorem 2, this will happen if and only if A P is not a multiple of I 2 i.e. G n−1 = 0.
Case 3) If S is a non-zero square in F q , S P (x) has two distinct roots (eigenvalues) in F q . If dimension of the eigenspaces corresponding to each eigenvalue is one, due to Theorem 1, P (x) has two solutions in F q n .
Note that the projective polynomial P (x) = x q r +1 +ax +b associates with the following linearized polynomial It is readily seen that if we can efficiently solve the linearized polynomial L(x), the roots of P (x) can be obtained accordingly. In [28] the authors also applied companion matrices to study the number of roots of the above linearized polynomial. Further works on the roots of linearized polynomials can be found in [7,32,46].
Below we provide another way of studying the roots of the linearized polynomials L(x) via the Dickson matrix directly.
It follows from the pattern of the Dickson matrix D that D T z · D = 0 n×n , where 0 n×n is the n × n all zero matrix.
According to the definition of D z , it is clear that it has rank at least n − r. On the other hand, since the Dickson matrix D has rank r and all rows of D z are solution of (y 0 , . . . , y n−1 )D = (0, . . . , 0), the rank of D z is at most n − r. This means that D z has rank exactly n − r.
Let M α be the Moore matrix associated with the basis α 0 , . . . , α n−1 . It follows from Lemma 2 i) and iv) that Hence L(β i ) = 0 for i = 0, 1, . . . , n − 1. Moreover, since the Moore matrix M α is nonsingular, the rank of M β is the same as that of the rank of D z , which implies that the rank of β 0 , . . . , β n−1 over F q is equal to n − r. Thus the linear combination of β 0 , . . . , β n−1 over F q yields all the solution of L(x) in F q n . The desired conclusion follows.
From Theorem 3, we see that finding solutions of a linearized polynomial can be converted to the task of computing the rank of its associated Dickson matrix D = (D 0 , . . . , D n−1 ) T and of finding a solution of D r = x 0 D 0 + · · · + x r−1 D r−1 . In general, calculating the rank of a Dickson matrix D is nontrivial. Recently Csajbók in [6] proposed an interesting characterization of the rank of D.
Theorem 4 [6] Let D be the associated Dickson matrix of a linearized polynomial L(x) = n−1 i=0 l i x q i over F q n . Denote by D t the submatrix of D by removing the first t rows and the last t columns. Then L(x) has rank r if and only if |D 0 | = · · · = |D n−r−1 | = 0 and |D n−r | = 0.
By Theorem 4, in order to determine the rank of the Dickson matrix associated with L(x), we need to calculate the determinant of D 0 , D 1 and D 2 . The calculation for the case D 2 is trivial. We only need to consider D 0 and D 1 . To this end, we need the following result.

Theorem 5 The determinant of the Dickson matrix
associated with the linearized polynomial L(x) = x q 2r + ax q r + bx can be calculated using the recursive relation where N(a) denotes the field norm of a ∈ F q n from F q n to F q , M n is a tridiagonal matrix of order n and M n−1 = D 1 .
Note that D 2 is a lower triangular matrix and its determinant can be directly computed |D 2 | = 1. In order to prove Theorem 5 we need the following observation. (34) is given by the recurrence relation
Proof Using Laplace expansion on the last column for n ≥ 2 gives Proof of Theorem 5. The proof follows immediately by applying Laplace expansion and Lemma 3. Note that the determinant of an upper (lower) triangular matrix is the product of the elements in its main diagonal. Theorem 5 characterizes the conditions for the associated Dickson matrix of L(x) = x q 2r +ax q r +bx to have rank n, n−1 and n−2. According to Theorem 3, one can obtain the roots of L(x) by finding the coefficients in the linear combination of the first n − 1 rows of D when D has rank n − 2 and coefficients in the linear combination of all rows of D when D has rank n − 1. Here the modified BM algorithm [43] will be employed, which requires O(n 2 ) operations in F q n for these two cases. With the coefficients, the roots of L(x) are given by Theorem 3.
Instead of using Theorem 3 to compute the roots of the linearized polynomial L(x), one may use the probabilistic method given in [46]. The problem of finding the root space of the linearized polynomial L(x) is reduced to find the image space of another linearized polynomial K(x) derived from where W (x) = gcd(L(x), x q n − x). The idea is to randomly choose y i ∈ F q n and calculate K(y i ) until the base elements for the image space of K(x) are obtained. Since L(x) has σdegree 2, we need to find two basis elements K(y 1 ), K(y s ) for the image space of K(x). According to [46], the algorithm has complexity in the order of O(n) operations in F q n . In general the expected number of y j ∈ F q n that need to be evaluated in order to find n linearly independent basis elements K(y 0 ), . . . , K(y n−1 ) is given by 1 1−q j −n [46].

The decoding algorithm of AGTG codes
With the discussion in Sections 3.2-4, we summarize the interpolation polynomial decoding algorithm of AGTG codes in Algorithm 2, and analyze its complexity accordingly.
Recall that reconstruction the error interpolation polynomial g(x) is to solve (15) based on the available information in (13). For the case that t = n−k 2 with even n − k, according to Algorithm 1, (n−k−1) (x) is the linearized polynomial obtained after n − k iteration and its coefficients are the desired vector (λ 1 , . . . , λ t ). L is the linear complexity of (n−k−1) (x) and B (n−k−1) (x) is the auxiliary linearized polynomial which is used to store the value of (i) (x) with the largest degree L i such that L i < L. Hence one can obtain from Algorithm 1 two t-dimensional vectors λ and λ over F q n . Then the solution of (15) is given as λ + ωλ = (λ 1 + ωλ 1 , . . . , λ t + ωλ t ), from which the coefficients g 0 , . . . , g k can be calculated recursively. The relation of g 0 and g k in (13) leads to a quadratic equation If u 0 = 0 calculate its zeros by cases i)-iv) after (19) or use Theorem 5, Berlekamp Massey Algorithm 1, Theorem 3 and Corollary 1 otherwise. The above process therefore can be integrated into the explicit Algorithm 2.

Remark 2
In the proposed Algorithm 2, we reconstruct the error interpolation polynomial g(x) by two major steps: calculate the coefficients λ 1 , . . . , λ t by the modified BM algorithm, and deal with the case t = (n − k)/2 by investigating the zero of the established polynomial P(x). Section 4 investigates the solutions to P(x) = 0 In the process, the calculation of the characterized conditions in Theorem 2 dominates the overall complexity. In Line 1 of Algorithm 2, the calculation of the interpolation polynomial γ (x) at points (α i , r i ) for 1 ≤ i ≤ n. It has complexity in the order of O(n 3 ) operations over F q n , which can be further optimized by the method in [34]. For the remaining steps in Algorithm 2, the modified BM algorithm dominates the overall complexity. Since the modified BM algorithm has operations in the order of O(n 2 ) over F q n , the overall complexity of Algorithm 2 is in the order of O(n 2 ) over F q n when normal bases are used in the interpolation step.

Conclusion
This paper further investigates the interpolation-based decoding algorithm for additive generalized twisted Gabidulin codes over finite fields with any characteristic. The main contribution of this paper includes the discussion of efficiently finding the roots of the involved project polynomials and their corresponding linearized polynomials.