# ON THE MATRIX CODE OF QUADRATIC RELATIONSHIPS FOR A GOPPA CODE

Rocco Mora

► To cite this version:

Rocco Mora. ON THE MATRIX CODE OF QUADRATIC RELATIONSHIPS FOR A GOPPA CODE. Advances in Mathematics of Communications, 2024. hal-05449342

HAL Id: hal-05449342

https://hal.science/hal-05449342v1

Submitted on 8 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
ON THE MATRIX CODE OF QUADRATIC RELATIONSHIPS
FOR A GOPPA CODE

ROCCO MORA

CISPA – Helmholtz Center for Information Security, Germany

ABSTRACT. In this article, we continue the analysis started in [CMT23] for the matrix code of quadratic relationships associated with a Goppa code. We provide new sparse and low-rank elements in the matrix code and categorize them according to their shape. Thanks to this description, we prove that the set of rank 2 matrices in the matrix codes associated with square-free binary Goppa codes, i.e. those used in the Classic McEiece cryptosystem, is much larger than what is expected, at least in the case where the Goppa polynomial degree is 2. We build upon the algebraic determinantal modeling introduced in [CMT23] to derive a structural attack on these instances. Our method can break in just a few seconds some recent challenges to recover the key of the McEliece cryptosystem, consistently reducing their estimated security level. We also provide a general method, valid for any Goppa polynomial degree, to transform a generic pair of support and multiplier into a pair of support and Goppa polynomial.

# 1. INTRODUCTION

The McEliece scheme and its cryptanalysis. The McEliece cryptosystem [McE78] is the oldest code-based encryption scheme, dating back to 1978, i.e. just a few months after the ubiquitously used RSA cryptosystem [RSA78]. Contrarily to the latter [Sho94], the former is also widely believed to be a quantum-resistant alternative, meaning that quantum algorithms are not expected to break it exponentially faster than classical ones. This is mirrored in the NIST Post-Quantum Standardization Process, where the IND-CCA secure version Classic McEliece [ABC+22] is currently one of the few candidates in the fourth round. Despite the public key size being huge, the McEliece encryption scheme benefits from extremely fast encryption and decryption algorithms and very small ciphertexts. This potentially makes it an attractive option for several use-cases<fnref n="1" />.

The other important argument in favor of McEliece is that all the known general decoding algorithms for message recovery developed in over 60 years of research, both classical or quantum, barely improved the exponent of the exponential cost [Pra62, Ste88, Dum89, CC98, MMT11, BJMM12, MO15, BM17, Ber10, KT17]. However, these are still used to design secure parameters, because key recovery attacks are immensely more expensive than message recovery techniques.

Key recovery attacks try to exploit the algebraic structure of the underlying family of codes. Indeed, in order to decrypt a message, the receiver must be able to decode a codeword and therefore a code equipped with an efficient decoding algorithm must be adopted. The original proposal of McEliece, as well as Classic McEliece, builds upon the class of binary Goppa codes. An element of this family is

<footnote n="1">¹https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/jgevyeKehcM</footnote>
uniquely determined by a vector, called support, of length equal to the code length and an irreducible polynomial of a relatively small degree defined over an extension of the binary field which is called Goppa polynomial. On the other hand, a Goppa code corresponds to several pairs of supports and Goppa polynomials. Recovering any of them allows to decode efficiently any message.

For a long time, the only key recovery attack consisted of guessing a valid pair of support and Goppa polynomial [LS01] and then checking via the Support Splitting Algorithm [Sen00] whether it defines a Goppa code that is permutation equivalent to the public one. The total complexity is exponential and, as already mentioned, the exponent is much bigger than the one for message recovery approaches.

Even the potentially easier task of distinguishing efficiently if a generator matrix comes from a Goppa code or a random one (this takes the name of the Goppa distinguishing problem) had been considered difficult for a long time. This is because Goppa codes share a lot of properties in common with random ones. For instance, they asymptotically meet the Gilbert-Varshamov bound, they have approximately the same weight distribution and also a trivial permutation group. Based on the two assumptions: (1) the pseudorandomness of Goppa codes and (2) the hardness of decoding up to the binary Goppa bound, it is possible to devise a reductional proof of security for the McEliece scheme [Sen10].

An important step in the understanding of the structure of a Goppa code is the high-rate distinguisher presented in [FGO+11]. Here it was shown that a linear system associated with Goppa codes has an unusually small rank when the code rate is high enough. This is not the case for Classic McEliece, but it impacts other schemes like the CFS digital signature [CFS01]. Much later, a different perspective about the distinguisher was given in [MT23], exploiting the link between the linear system and square codes revealed in [MP12]. More precisely, the distinguisher was explained in terms of the dimension of the *square code* of the dual of a Goppa code. Tight upper bounds for this dimension have been provided in [MT23], thus making the distinguisher more rigorous. The square code analysis given in [MT23] resulted in the first-ever polynomial-time cryptanalysis on unstructured alternant codes with high rate [BMT23]. This approach is limited to the high-rate regime and the problem of attacking, or even simply distinguishing, a Goppa code with rate comparable to those used in Classic McEliece was left open. This question has been partially addressed in [CMT23], where a completely new approach based on quadratic forms to attack the McEliece cryptosystems has been introduced.

**Contributions of this work and organization of the paper.** The contribution of the paper is twofold. In a nutshell:

(1) We illustrate a new efficient key-recovery attack on binary Goppa codes with a Goppa polynomial degree equal to 2. The attack can be split into two parts. First, we perform an algebraic cryptanalysis on the Pfaffian system introduced in [CMT23], thus finding low-rank elements in the matrix code of quadratic relationships. Then we exploit the knowledge of such matrices to reconstruct the secret key of the Goppa code, i.e. a valid pair of support and Goppa polynomial. As we will explain, this attack is tailored specifically for Goppa codes and does not affect generic alternant codes of order 2.

(2) The previous result is made possible by an in-depth analysis of structured elements lying within the matrix code of quadratic relationships originated by an alternant or a Goppa code. Indeed, we prove that, when the Goppa
polynomial degree is 2, the variety associated with the Pfaffian system is
big. This fact is instrumental for the algebraic attack as it shows that
several variables can be specialized. Our investigation, however, is more
general than the attack, as it covers any alternant or Goppa code degree.

The focus on binary Goppa codes with a Goppa polynomial degree equal to 2 of the first contribution has been partially motivated by some recent key-recovery challenges for the McEliece scheme<fnref n="2" />, that we will call “TII challenges” from now on. We have been able to break all TII challenges using a Goppa polynomial of degree r = 2 and length n > 3rm - 3, where m is the field extension degree, within a few seconds, as it can be consulted at https://www.herox.com/TIIMcElieceChallenges/leaderboard. Notably, one of them has claimed bit complexity λ = 68.

After recalling some preliminary notions and results in Section 2, we introduce in Section 3 the “Goppa code representations” of a Goppa code, which is useful for recovering the Goppa polynomial and corresponding support. In Section 4, we categorize new matrices in the matrix code of quadratic relations and use them to study the variety associated with the Pfaffian ideal in the special case of r = 2. This analysis led us in Section 5 to mount a polynomial-time attack on square-free binary Goppa codes of degree 2.

2. PRELIMINARIES

2.1. Notation.

*General notation.* The closed integer interval between *a* and *b* is denoted with [[*a*, *b*]].

*Finite fields.* We denote by $\mathbb{K}$ a generic field and by $\overline{\mathbb{K}}$ its algebraic closure. Instead, $\mathbb{F}$ stands for a generic finite field and $\mathbb{F}_q$ for the finite field of size $q$, where $q$ is a prime power. We will often consider the finite field extension $\mathbb{F}_{q^m}/\mathbb{F}_q$, where $\mathbb{F}_{q^m}$ is the finite fields with $q^m$ elements, for some positive integer $m$. We denote by $\mathbb{F}^*$ the set of nonzero elements of the finite field $\mathbb{F}$, which form a multiplicative group.

*Vectors and matrices.* Vectors are indicated by lowercase bold letters $\mathbf{x}$ and matrices by uppercase bold letters $\mathbf{M}$. By convention, vector coordinates are indexed starting from 1, but we will write matrix blocks using indices that start from 0. We denote the component-wise image with respect to a vector $\mathbf{x} = (x_i)_{1\le i\le n} \in \mathbb{F}$ of a function $f$ with domain $\mathbb{F}$ by using the expression $f(\mathbf{x})$, i.e. $f(\mathbf{x}) = (f(x_i))_{1\le i\le n}$. In a similar manner, given $\mathbf{x}, \mathbf{y} \in \mathbb{F}^n$ and two positive integers $a, b$, we denote by $\mathbf{x}^a \mathbf{y}^b$ the vector $(x_i^a y_i^b)_{1\le i\le n}$. Given a matrix $\mathbf{M} = (m_{i,j}) \in \mathbb{F}_{q^m}^{m\times n}$, we write $\mathbf{M}^{(q)} = (m_{i,j}^q)$, i.e. the matrix where the Frobenius automorphism $a \mapsto a^q$ has been applied to all the entries. The set of $k \times k$ symmetric matrices over $\mathbb{F}$ is denoted by $\mathbf{Sym}(k, \mathbb{F})$, whereas the corresponding set of skew-symmetric matrices is denoted by $\mathbf{Skew}(k, \mathbb{F})$.

*Vector spaces.* The $\mathbb{K}$-linear space generated by the not necessarily linearly independent vectors $\mathbf{x}_1, \dots, \mathbf{x}_m \in \mathbb{K}^n$ is denoted by $\langle \mathbf{x}_1, \dots, \mathbf{x}_m \rangle_{\mathbb{K}}$. If $\mathbb{K} = \mathbb{F}$ then $\mathcal{C} = \langle \mathbf{x}_1, \dots, \mathbf{x}_m \rangle_{\mathbb{F}}$ is an $[n, k]$-linear code, where $k$ denotes the dimension of $\mathcal{C}$.

<footnote n="2">²https://www.herox.com/TIIMcElieceChallenges, track 1B.</footnote>
*Polynomial ideals.* Polynomial ideals are indicated by calligraphic capital letters. Given the multivariate polynomials $f_1, \dots, f_m \in \mathbb{K}[x_1, \dots, x_n]$, we denote by $\langle f_1, \dots, f_m \rangle$ the polynomial ideal generated by them. The variety associated with a polynomial ideal $\mathcal{I} \subseteq \mathbb{K}[x_1, \dots, x_n]$ is $V(\mathcal{I}) = \{\mathbf{a} \in \mathbb{K}^n | \forall f \in \mathcal{I}, f(\mathbf{a}) = 0\}$.

## 2.2. GRS and Goppa codes.
We first recall the definition of GRS codes, a family of evaluation codes.

**Definition 2.1 (Generalized Reed-Solomon (GRS) code).** Let $\mathbf{x} = (x_1, \dots, x_n) \in \mathbb{F}^n$ be a vector of pairwise distinct entries and $\mathbf{y} = (y_1, \dots, y_n) \in \mathbb{F}^n$ a vector of nonzero entries. The generalized Reed-Solomon (GRS) code over $\mathbb{F}$ of dimension $k$ with support $\mathbf{x}$ and multiplier $\mathbf{y}$ is

$$ \mathbf{GRS}_k(\mathbf{x}, \mathbf{y}) \stackrel{\text{def}}{=} \{(y_1 P(x_1), \dots, y_n P(x_n)) \mid P \in \mathbb{F}[z], \deg P < k\}. $$

An alternant code is defined as the subfield subcode of a GRS code. Here we exploit the following proposition to define the former as the subfield subcode of the dual of a GRS code.

**Proposition 2.2.** [MS86, Theorem 4, p. 304] Let $\mathbf{GRS}_r(\mathbf{x}, \mathbf{y})$ be a GRS code of length $n$. Its dual is also a GRS code. In particular $\mathbf{GRS}_r(\mathbf{x}, \mathbf{y})^{\perp} = \mathbf{GRS}_{n-r}(\mathbf{x}, \mathbf{y})^{\perp}$, with $\mathbf{y}^{\perp} \stackrel{\text{def}}{=} \left( \frac{1}{\pi'_{\mathbf{x}}(x_1)y_1}, \dots, \frac{1}{\pi'_{\mathbf{x}}(x_n)y_n} \right)$, where $\pi_{\mathbf{x}}(z) \stackrel{\text{def}}{=} \prod_{i=1}^n (z - x_i)$ and $\pi'_{\mathbf{x}}$ is its derivative.

**Definition 2.3 (Alternant code).** Let $n \le q^m$, for some positive integer $m$. Let $\mathbf{GRS}_r(\mathbf{x}, \mathbf{y})$ be the GRS code over $\mathbb{F}_{q^m}$ of dimension $r$ with support $\mathbf{x} \in \mathbb{F}_{q^m}$ and multiplier $\mathbf{y} \in (\mathbb{F}_{q^m}^*)^n$. The alternant code with support $\mathbf{x}$, multiplier $\mathbf{y}$ and degree $r$ over $\mathbb{F}_q$ is

$$ \mathcal{A}_r(\mathbf{x}, \mathbf{y}) \stackrel{\text{def}}{=} \mathbf{GRS}_r(\mathbf{x}, \mathbf{y})^{\perp} \cap \mathbb{F}_q^n = \mathbf{GRS}_{n-r}(\mathbf{x}, \mathbf{y})^{\perp} \cap \mathbb{F}_q^n. $$

The integer $m$ is called extension degree of the alternant code.

A Goppa code is an alternant code where the support and multiplier are linked by a very particular relation.

**Definition 2.4 (Goppa code).** Let $\mathbf{x} \in \mathbb{F}_{q^m}^n$ be a support vector and $\Gamma \in \mathbb{F}_{q^m}[z]$ a polynomial of degree $r$ such that $\Gamma(x_i) \ne 0$ for all $i \in \{1, \dots, n\}$. The Goppa code of degree $r$ with support $\mathbf{x}$ and Goppa polynomial $\Gamma$ is defined as $\mathcal{G}(\mathbf{x}, \Gamma) \stackrel{\text{def}}{=} \mathcal{A}_r(\mathbf{x}, \mathbf{y})$, where $\mathbf{y} \stackrel{\text{def}}{=} \left( \frac{1}{\Gamma(x_1)}, \dots, \frac{1}{\Gamma(x_n)} \right)$.

**Theorem 2.5.** [Pat75] Let $\mathcal{G}(\mathbf{x}, \Gamma)$ be a binary Goppa code with a square-free Goppa polynomial $\Gamma$ of degree $r$. Then

$$ \mathcal{G}(\mathbf{x}, \Gamma) = \mathcal{G}(\mathbf{x}, \Gamma^2) = \mathcal{A}_{2r}(\mathbf{x}, \mathbf{y}), $$

$$ \text{where } y_i \stackrel{\text{def}}{=} \frac{1}{\Gamma(x_i)^2} \text{ for all } 1 \le i \le n. $$

## 2.3. Product and square of codes.
The notion of squares of codes is at the core of the high-rate distinguisher as presented in [MT23]. Given the component-wise product of two vectors $\mathbf{a}, \mathbf{b} \in \mathbb{F}^n$

$$ \mathbf{a} \star \mathbf{b} \stackrel{\text{def}}{=} (a_1 b_1, \dots, a_n b_n), $$

we define the component-wise (or Schur's) product of codes.
**Definition 2.6.** The component-wise product of codes $\mathscr{C}, \mathscr{D}$ over $\mathbb{F}$ with the same length $n$ is defined as

$$ \mathscr{C} \star \mathscr{D} \stackrel{\text{def}}{=} \langle \mathbf{c} \star \mathbf{d} | \mathbf{c} \in \mathscr{C}, \mathbf{d} \in \mathscr{D} \rangle_{\mathbb{F}}. $$

If $\mathscr{C} = \mathscr{D}$, we call $\mathscr{C}^{\star 2} \stackrel{\text{def}}{=} \mathscr{C} \star \mathscr{C}$ the square code of $\mathscr{C}$.

2.4. **Extension of a code over a field extension.** The Frobenius map can be applied component-wise over codes in the following way.

**Definition 2.7 (Image of a code by the Frobenius map).** Let $\mathscr{C} \in \mathbb{F}_{q^m}^n$ be a code and $i$ a non-negative integer. We define by $\mathscr{C}^{(q^i)}$ as

$$ \mathscr{C}^{(q^i)} \stackrel{\text{def}}{=} \{(c_1^{q^i}, \dots, c_n^{q^i}) | (c_1, \dots, c_n) \in \mathscr{C}\}. $$

For some codes naturally defined over $\mathbb{F}_q$, namely subfield subcodes, we will extensively consider their linear span over a field extension $\mathbb{F}_{q^m}$. More formally, we define the extension of a code over a field extension (or extension of scalars) in the following way.

**Definition 2.8 (Extension of a code over a field extension).** Let $\mathscr{C}$ be a linear code over $\mathbb{F}_q$. We denote by $\mathscr{C}_{\mathbb{F}_{q^m}}$ the $\mathbb{F}_{q^m}$-linear span of $\mathscr{C}$ in $\mathbb{F}_{q^m}^n$.

If we apply this construction on the dual of an alternant code, we get

**Proposition 2.9.** [BMT23] Let $\mathcal{A}_r(\mathbf{x}, \mathbf{y})$ be an alternant code over $\mathbb{F}_q$. Then
$$ (\mathcal{A}_r(\mathbf{x}, \mathbf{y})^{\perp})_{\mathbb{F}_{q^m}} = \sum_{j=0}^{m-1} \mathbf{GRS}_r(\mathbf{x}, \mathbf{y})^{(q^j)} = \sum_{j=0}^{m-1} \mathbf{GRS}_r(\mathbf{x}^{q^j}, \mathbf{y}^{q^j}). $$

This is useful because it allows to view the code generators as the component-wise evaluations of monomials, as this is the case for the GRS codes $\mathbf{GRS}_r(\mathbf{x}^{q^j}, \mathbf{y}^{q^j})$. This perspective is motivated and made possible by the fact that the extension of scalars commutes with all the standard constructions in coding theory. We recall from [Ran15] the properties that will be implicitly exploited in this work.

**Lemma 2.10** (from Lemma 2.22 and Lemma 2.23, [Ran15]). Let $\mathscr{C}, \mathscr{C}' \subseteq \mathbb{F}_q^n$ be two $\mathbb{F}_q$-linear codes. Then

* If $\mathbf{G}$ is a generator matrix for $\mathscr{C}$ over $\mathbb{F}_q$, then it is also a generator matrix of $\mathscr{C}_{\mathbb{F}_{q^m}}$ over $\mathbb{F}_{q^m}$.

* If $\mathbf{H}$ is a parity-check matrix for $\mathscr{C}$ over $\mathbb{F}_q$, then it is also a parity-check matrix of $\mathscr{C}_{\mathbb{F}_{q^m}}$ over $\mathbb{F}_{q^m}$.

* $(\mathscr{C}^{\perp})_{\mathbb{F}_{q^m}} = (\mathscr{C}_{\mathbb{F}_{q^m}})^{\perp} \subseteq \mathbb{F}_{q^m}^n$.

* $\mathscr{C} \subseteq \mathscr{C}' \iff \mathscr{C}_{\mathbb{F}_{q^m}} \subseteq \mathscr{C}'_{\mathbb{F}_{q^m}}$.

* $(\mathscr{C} + \mathscr{C}')_{\mathbb{F}_{q^m}} = \mathscr{C}_{\mathbb{F}_{q^m}} + \mathscr{C}'_{\mathbb{F}_{q^m}}$.

* $(\mathscr{C} \cap \mathscr{C}')_{\mathbb{F}_{q^m}} = \mathscr{C}_{\mathbb{F}_{q^m}} \cap \mathscr{C}'_{\mathbb{F}_{q^m}}$.

* $(\mathscr{C} \star \mathscr{C}')_{\mathbb{F}_{q^m}} = \mathscr{C}_{\mathbb{F}_{q^m}} \star \mathscr{C}'_{\mathbb{F}_{q^m}}$.

2.5. **The matrix code of quadratic relationships.** In [CMT23], a new object is associated with a linear code: the matrix code of quadratic relationships. This notion is strictly related to that of the square code. If $\mathscr{C} = \langle \mathbf{c}_1, \dots, \mathbf{c}_k \rangle_{\mathbb{F}} \subseteq \mathbb{F}^n$ is a $k$-dimensional linear code, then a natural set of generators for its square code $\mathscr{C}^{\star 2}$ is given by all component-wise products of codewords $\mathbf{c}_i \star \mathbf{c}_j$, $1 \le i \le j \le k$. Some of these generators may be linearly dependent and this is even expected for random codes when the dimension $k$ is big enough compared to $n$, so that the whole space
is reached by the square code. When $\mathcal{C}$ is the dual of an alternant or Goppa code, some very structured linear dependencies appear among the generators of $\mathcal{C}^{*2}$. In other words, quadratic relationships among the generators of $\mathcal{C}$ are guaranteed to exist. The high-rate distinguisher relies on this fact, by counting the dimension of the space generated by such quadratic dependencies and comparing them with those for a random code, if any. However, unless the rate of the Goppa code is very high, the dimensions of the two corresponding spaces are the same, even if the hidden structure is different. The matrix code serves as a tool to distinguish Goppa codes even when the two dimensions match.

In particular, the contributions of [CMT23] can be summarized as follows:

(1) A general and simple procedure to distinguish alternant and Goppa codes of rate at least 2/3 from random ones has been introduced. This consists of defining a determinantal ideal, i.e. an ideal generated by minors of a given size. In the mentioned rate regime, the matrix code of quadratic relations constructed from a random code is not expected to contain nonzero matrices of rank at most 3. Therefore, the variety associated with the ideal of minors of size 4 is trivial. The inverse happens for the matrix code associated with an alternant or a Goppa code: low-rank matrices are guaranteed to exist in it. Hence, solving the polynomial system of minors (or of Pfaffians) allows to discriminate between random and alternant or Goppa codes. The complexity of this new distinguisher smoothly interpolates between polynomial (in the regime already distinguishable by [FGO+11]) and superexponential for constant rates. In other words, it has subexponential complexity for families of alternant or Goppa codes whose dimension $k$ grows between linear and quadratic with respect to the codimension $n-k$.

(2) A new polynomial-time structural attack on alternant and Goppa codes in the rate of parameters distinguishable by [FGO+11, MT23] has been devised. This contribution extends the results of [BMT23] where generic alternant codes with binary or ternary field size have been attacked. In particular, the algorithm from [CMT23] in concert with [BMT23] breaks all distinguishable alternant codes (for any field size) and all distinguishable Goppa codes whose Goppa polynomials have degree $r < q-1$.

In the following, we will recall the definition of matrix code of quadratic relations and the main results about it. Exploiting Proposition 2.9, we define an ordered basis, and call it **canonical basis**, $\mathcal{A}$ of $(\mathcal{A}_r(\mathbf{x}, \mathbf{y})^{\perp})_{\mathbb{F}_{q^m}}$:

$$ (1) \quad \mathcal{A} \stackrel{\text{def}}{=} (\mathbf{y}, \mathbf{x}\mathbf{y}, \dots, \mathbf{x}^{r-1}\mathbf{y}, \dots, \mathbf{y}^{q^{m-1}}, (\mathbf{x}\mathbf{y})^{q^{m-1}}, \dots, (\mathbf{x}^{r-1}\mathbf{y})^{q^{m-1}}). $$

We remark that $\mathcal{A}$ is an unknown basis from the attacker's point of view, as he/she does not have access a priori to the basis of a single GRS code $\mathbf{GRS}_r(\mathbf{x}, \mathbf{y})^{q^j}$ and even less to the monomial basis. In the attack from [CMT23], $\mathcal{A}$ was indeed the secret basis to recover. We also denote with $\mathcal{B}$ another (public) basis of $(\mathcal{A}_r(\mathbf{x}, \mathbf{y})^{\perp})_{\mathbb{F}_{q^m}}$.

Observe that, for any $0 \le a, b, c, d < r$ such that $a + b = c + d$, we have $\mathbf{x}^a\mathbf{y}, \mathbf{x}^b\mathbf{y}, \mathbf{x}^c\mathbf{y}, \mathbf{x}^d\mathbf{y} \in \mathbf{GRS}_r(\mathbf{x}, \mathbf{y})$ and these codewords satisfy the following quadratic relationship:

$$ (2) \quad (\mathbf{x}^a\mathbf{y}) \star (\mathbf{x}^b\mathbf{y}) = (\mathbf{x}^c\mathbf{y}) \star (\mathbf{x}^d\mathbf{y}). $$
**Proposition 2.9** explains why the existence of these quadratic relationships is preserved when considering subfield subcodes of GRS codes, i.e. alternant (including Goppa) codes. Moreover, other structured relations arise from the subfield subcode construction, because codewords from different $\mathbf{GRS}_r(x, y)^{q^j}$'s may be involved. The following definition captures the fact that in general quadratic relationships form a vector space.

**Definition 2.11** (Code of quadratic relationships, [CMT23]). Let $\mathcal{C}$ be an $[n, k]$ linear code over $\mathbb{F}$ and let $\mathcal{V} = \{v_1, \dots, v_k\}$ be a basis of $\mathcal{C}$. The code of quadratic relationships between the Schur's products with respect to $\mathcal{V}$ is

$$ \mathcal{C}_{\text{rel}}(\mathcal{V}) \stackrel{\text{def}}{=} \{ \mathbf{c} = (c_{i,j})_{1 \le i \le j \le k} \mid \sum_{i \le j} c_{i,j} \mathbf{v}_i \star \mathbf{v}_j = 0 \} \subseteq \mathbb{F}^{\binom{k+1}{2}}. $$

By considering codewords corresponding to the identities (2), we can therefore predict the shape of low (Hamming) weight codewords in the code of quadratic relationships $\mathcal{C}_{\text{rel}}(\mathcal{A})$, where $\mathcal{A}$ is given in (1). This fact has potential interest for cryptanalysis, however the same does not happen in general for $\mathcal{C}_{\text{rel}}(\mathcal{B})$, where $\mathcal{B}$ is another basis of $(\mathcal{A}_r(x, y))^{\perp}_{\mathbb{F}_{q^m}}$. Not only do we not know the shape of low-weight codewords in $\mathcal{C}_{\text{rel}}(\mathcal{B})$, but these are not even guaranteed to exist. This suggests that the Hamming distance is not the right metric to look at and that another perspective is required.

Note that any element $\mathbf{c} = (c_{i,j})_{1 \le i \le j \le k} \in \mathcal{C}_{\text{rel}}(\mathcal{V})$ defines a quadratic form as

$$ Q_c(x_1, \dots, x_k) = \sum_{i \le j} c_{i,j} x_i x_j. $$

For instance, the relationship in (2) is associated with the low-rank quadratic form

$$ x_{a+1}x_{b+1} - x_{c+1}x_{d+1}. $$

We can therefore represent the elements of $\mathcal{C}_{\text{rel}}(\mathcal{V})$ as matrices corresponding to the bilinear map given by the polar form of the quadratic form, i.e. the matrix $M_c$ corresponding to $\mathbf{c} \in \mathcal{C}_{\text{rel}}(\mathcal{V})$ that satisfies for all $\mathbf{w}$ and $\mathbf{z}$ in $\mathbb{F}_{q^m}^k$

$$ (3) \qquad \mathbf{w}M_c\mathbf{z}^{\top} = Q_c(\mathbf{w} + \mathbf{z}) - Q_c(\mathbf{w}) - Q_c(\mathbf{z}). $$

Note that $M_c$ is symmetric in odd characteristic, whereas it is skew-symmetric in characteristic 2. This definition provides a matrix perspective on the space of quadratic relationships that fits in both the odd characteristic and characteristic 2 cases:

**Definition 2.12** (Matrix code of relationships, [CMT23]). Let $\mathcal{C}$ be an $[n, k]$ linear code over $\mathbb{F}$ and let $\mathcal{V} = \{v_1, \dots, v_k\}$ be a basis of $\mathcal{C}$. The matrix code of relationships between the Schur's products with respect to $\mathcal{V}$ is

$$ \mathcal{C}_{\text{mat}}(\mathcal{V}) \stackrel{\text{def}}{=} \{ M_c = (m_{i,j})_{1 \le i \le k} \mid \mathbf{c} = (c_{i,j})_{1 \le i \le j \le k} \in \mathcal{C}_{\text{rel}}(\mathcal{V}) \} \subseteq \text{Sym}(k, \mathbb{F}), $$

where $M_c$ is defined as
$$ \begin{cases} m_{i,j} & \stackrel{\text{def}}{=} m_{j,i} \stackrel{\text{def}}{=} c_{i,j}, & 1 \le i < j \le k, \\ m_{i,i} & \stackrel{\text{def}}{=} 2c_{i,i}, & 1 \le i \le k. \end{cases} $$

The turning point of this approach is that, regardless of the chosen basis, the matrix code of relationships contains low-weight elements when computed with respect to the usual rank metric

$$ d(M_1, M_2) \stackrel{\text{def}}{=} \text{Rank}(M_1 - M_2). $$
Indeed we have

**Proposition 2.13 ([CMT23])**. Let $\mathcal{A}$ and $\mathcal{B}$ be two bases of a same $[n, k]$ $\mathbb{F}$-linear code $\mathcal{C}$. Then $\mathcal{C}_{\text{mat}}(\mathcal{A})$ and $\mathcal{C}_{\text{mat}}(\mathcal{B})$ are congruent matrix codes, i.e. there exists $\mathbf{P} \in \text{GL}_k(\mathbb{F})$ such that

$$ (4) \qquad \mathcal{C}_{\text{mat}}(\mathcal{A}) = \mathbf{P}^{\top}\mathcal{C}_{\text{mat}}(\mathcal{B})\mathbf{P}. $$

The matrix $\mathbf{P}$ coincides with the change of basis matrix between $\mathcal{A}$ and $\mathcal{B}$.

The proposition above readily implies that the weight distributions of $\mathcal{C}_{\text{mat}}(\mathcal{A})$ and $\mathcal{C}_{\text{mat}}(\mathcal{B})$ (again with respect to the rank metric) are the same. Another trivial invariant is the matrix code dimension:

**Proposition 2.14 ([CMT23])**. Let $\mathcal{C} \subseteq \mathbb{F}^n$ be an $[n, k]$ linear code with ordered basis $\mathcal{V}$. Then

$$ \dim_{\mathbb{F}} \mathcal{C}_{\text{mat}}(\mathcal{V}) = \dim_{\mathbb{F}} \mathcal{C}_{\text{rel}}(\mathcal{V}) = \binom{k+1}{2} - \dim_{\mathbb{F}} \mathcal{C}^{*2}. $$

If $\mathcal{V}$ is a basis of $\mathcal{A}_r(\mathbf{x}, \mathbf{y})_{\mathbb{F}_{q^m}}^{\perp}$, then $\mathcal{C}_{\text{mat}}(\mathcal{V})$ contains rank-3 matrices in odd characteristic and rank 2-matrices in characteristic 2, obtained from (2) by taking $c = d$. These elements are categorized as Type 1 matrices in the following section.

In [CMT23], the question of whether matrices of such low rank are expected in $\mathcal{C}_{\text{mat}}(\mathcal{V})$, where $\mathcal{V}$ is the basis of a random $[n, rm] \mathbb{F}_{q^m}$-linear, code has been addressed. By computing the Gilbert-Varshamov distance with respect to the space of (skew-)symmetric matrices, it was shown in [CMT23, Proposition 10] that matrices of rank $\le 3$ belong to $\mathcal{C}_{\text{mat}}(\mathcal{V})$ with non-negligible probability iff

$$ (5) \qquad n \le 3rm - 3. $$

Therefore, it is possible to set up an algebraic modeling for the (skew-)symmetric variant of the MinRank problem with target rank 2 or 3.

**Problem** ((Skew-)Symmetric MinRank problem for rank $r$). Let $\mathbf{M}_1, \cdots, \mathbf{M}_K$ be (skew-)symmetric matrices in $\mathbb{F}^{N \times N}$. Find an $\mathbf{M} \in \langle \mathbf{M}_1, \cdots, \mathbf{M}_K \rangle_{\mathbb{F}}$ of rank $r$.

We remark that:

* if one is able to prove that the MinRank instance has no nonzero solution, then it means that the instance is not an alternant (or Goppa) code, which leads to a distinguisher;

* all the parameters used in Classic McEliece are such that $n > 3rm - 3$.

From these two observations, a special MinRank modeling for the case of characteristic 2 has been introduced in [CMT23] and a complexity estimate of the corresponding distinguisher has been determined.

In the rest of the paper, we will deepen the study of the matrix code originated by a generic alternant code or a Goppa code, describing and categorizing structured matrices lying in it. Thanks to this characterization, we also present an adaptation of a polynomial-time attack from [CMT23] to binary Goppa codes of degree 2.

### 3. THE GOPPA CODE REPRESENTATION

Imagine that we are able to recover a pair $(\mathbf{x}', \mathbf{y}')$ of valid support and multiplier for the Goppa code $\mathcal{G}(\mathbf{x}, \Gamma)$, i.e. such that $\mathcal{G}(\mathbf{x}, \Gamma) = \mathcal{A}_r(\mathbf{x}', \mathbf{y}')$. This task will be the goal of the next sections. In general, $\mathbf{x}'$ and $\mathbf{y}'$ do not coincide with $\mathbf{x}$
and $1/\Gamma(\mathbf{x})$ respectively, as the public code is not uniquely determined by a pair of support and multiplier and there is no way to recover the original ones. In addition, $\mathbf{y}'$ is not even guaranteed to be the inverse of the evaluation over $\mathbf{x}'$ of a degree-$r$ polynomial $\Gamma'$. The next definition formalizes this concept.

**Definition 3.1 (Goppa code representation).** Let $\mathcal{G}(\mathbf{x}, \Gamma) \subseteq \mathbb{F}_q^n$, $\deg(\Gamma) = r$, be an $[n, n - rm]$ Goppa code obtained as the subfield subcode of a Reed-Solomon code defined over an extension field of degree $m$. The pair $(\mathbf{x}', \mathbf{y}')$ is said to be an $r$-Goppa code representation of $\mathcal{G}(\mathbf{x}, \Gamma)$ if $\mathcal{A}_r(\mathbf{x}', \mathbf{y}')$ and $\mathbf{y}' = \frac{1}{\Gamma'(\mathbf{x}')}$ for some $\Gamma' \in \mathbb{F}_{q^m}[z]$ of degree $r$.

**Remark 3.2.** The definition above takes into account that Goppa polynomials of different degrees can be defined. For instance any pair of support and multiplier $(\mathbf{x}', \mathbf{y}')$ is such $\mathbf{y}' = \frac{1}{\Gamma'(\mathbf{x}')}$ for some $\Gamma$ of degree $\le n-1$ because of the interpolation theorem. Moreover, in the binary case, if $\Gamma$ is square-free then Proposition 2.5 provides a new Goppa polynomial of degree $2r$. In other words, the degree $r$ required in the definition is the minimal one, i.e. that for which $r = \frac{n-k}{m}$, where $k$ is the Goppa code dimension.

While any valid pair of support and multiplier permits to decode a Goppa code, there exists a crucial difference that makes Goppa code representations particularly relevant. Again, this distinction is witnessed in the binary square-free Goppa case. In principle, knowing a generic pair $(\mathbf{x}, \mathbf{y})$ enables to decode up to $\frac{r}{2}$ errors. Because of Proposition 2.5, a Goppa code representation readily allows to see the Goppa code as an alternant code of degree $2r$ and thus leads to an improved decoding capability of $r$ errors. In the McEliece scheme, and more in general in code-based cryptography, the error weight is chosen to be close or equal to the maximum of coordinates that a decoder can correct in such a way to increase the difficulty of decrypting for an attacker. This means that a valid pair $(\mathbf{x}, \mathbf{y})$ for a binary square-free Goppa code is not enough to efficiently decode errors of weight above $r/2$.

Furthermore, the TII challenges accept solutions in the format ‘support + Goppa code’, thus, translating to our formalism, they implicitly require to find a Goppa code representation.

In the following, we will then show how to move from a generic pair $(\mathbf{x}, \mathbf{y})$ to an equivalent one $(\mathbf{x}', \mathbf{y}')$ that is a Goppa code representation. The argument is not limited to $r = 2$, but works for any Goppa polynomial degree. This problem has already been partially investigated in [Mor23, Section 4.4.6] in relation to the parity-check subcode of a Goppa code, the filtration and Gröbner basis computation steps in the distinguisher-based attack [BMT23]. The group of transformations that map a valid pair $(\mathbf{x}, \mathbf{y})$ into another one $(\mathbf{x}', \mathbf{y}')$ has been described in [Dür87] for Cauchy codes and their subfield subcodes. Cauchy codes are the generalization of GRS codes over the projective line $\mathbb{P}^1(\mathbb{F}_{q^m})$. However, the reconstruction of $(\mathbf{x}, \mathbf{y})$ provided in the previous section guarantees that $\mathbf{x} \in \mathbb{F}_{q^m}^n \subset \mathbb{P}^1(\mathbb{F}_{q^m})^n$. We recall from [Mor23] that, when $\mathbf{x} \in \mathbb{F}_{q^m}^n$ (and $\mathbf{y} \in (\mathbb{F}_{q^m}^*)^n$), the restricted map from [Dür87] becomes

$$ (6) \qquad f: \quad \begin{array}{ccc} \mathbb{F}_{q^m}^n \times (\mathbb{F}_{q^m}^*)^n & \to & \mathbb{P}^1(\mathbb{F}_{q^m}) \times (\mathbb{F}_{q^m}^*)^n \\ (\mathbf{x}, \mathbf{y}) & \mapsto & (\mathbf{x}', \mathbf{y}') = \left( \frac{a\mathbf{x} + b}{c\mathbf{x} + d}, \lambda(c\mathbf{x} + d)^{r-1}\mathbf{y} \right), \end{array} $$

for some $a, b, c, d, \lambda \in \mathbb{F}_{q^m}$, such that $ad - bc \ne 0$ and $\lambda \ne 0$. We want to determine values of $a, b, c, d, \lambda$ that map into admissible vectors $\mathbf{x}' \in \mathbb{F}_{q^m}^n$ and $\mathbf{y}' \in (\mathbb{F}_{q^m}^*)^n$.
This conditions are equivalent to say that $0 \notin \{cx_i + d \mid i \in \llbracket 1, n \rrbracket\}$. Moreover, we want $(\mathbf{x}', \mathbf{y}')$ to be a Goppa code representation. The property of being a Goppa codes representation is preserved if and only if $f$ is an affine map.

**Proposition 3.3.** Let $\mathcal{G}(\mathbf{x}, \Gamma) = \mathcal{A}_r(\mathbf{x}, \mathbf{y})$ be an $[n, n - rm]$ Goppa code with $\mathbf{y} = \frac{1}{\Gamma(\mathbf{x})}$ and $\deg(\Gamma) = r$. Then $(\mathbf{x}', \mathbf{y}') = f((\mathbf{x}, \mathbf{y}))$ defined as in (6) is an $r$-Goppa representation if and only if $f$ is an affine transformation.

*Proof.* Inverting $f$, we obtain the relation

$$ \mathbf{x} = \frac{a'\mathbf{x}' + b'}{c'\mathbf{x}' + d'}, $$

where

$$ \begin{bmatrix} a' & b' \\ c' & d' \end{bmatrix} = \begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}, $$

thus leading to

$$ \mathbf{x} = \frac{d\mathbf{x}' - b}{-c\mathbf{x}' + a}. $$

Note that

$$ c\mathbf{x} + d = \frac{cd\mathbf{x}' - bc}{-c\mathbf{x}' + a} + d = \frac{ad - bc}{-c\mathbf{x}' + a}. $$

The coordinates of the multiplier $\mathbf{y}'$ can thus be formulated as the evaluation of a rational function in the coordinates of $\mathbf{x}'$ as

$$ \begin{aligned} \mathbf{y}' = \lambda(c\mathbf{x} + d)^{r-1}\mathbf{y} &= \frac{\lambda(c\mathbf{x} + d)^{r-1}}{\Gamma\left(\frac{d\mathbf{x}' - b}{-c\mathbf{x}' + a}\right)} = \frac{\lambda(c\mathbf{x} + d)^{r-1}}{\sum_{i=0}^{r} \gamma_i \left(\frac{d\mathbf{x}' - b}{-c\mathbf{x}' + a}\right)^i} = \frac{\lambda(c\mathbf{x} + d)^{r-1}(-c\mathbf{x}' + a)^r}{\sum_{i=0}^{r} \gamma_i (d\mathbf{x}' - b)^i (-c\mathbf{x}' + a)^{r-i}} \\ &= \frac{\lambda(ad - bc)^{r-1}(-c\mathbf{x}' + a)}{\sum_{i=0}^{r} \gamma_i (d\mathbf{x}' - b)^i (-c\mathbf{x}' + a)^{r-i}}. \end{aligned} $$

In other words, the reduced form of such rational function has in general a numerator of degree 1 and a denominator of degree $r$, i.e.

$$ \mathbf{y}' = \frac{A\mathbf{x}' + B}{\sum_{i=0}^{r} \gamma_i(\mathbf{x}')^i}, $$

with $A = -\lambda(ad - bc)^{r-1}c$ and $B = \lambda(ad - bc)^{r-1}a$. In particular, the sufficient and necessary condition for $(\mathbf{x}', \mathbf{y}')$ being an $r$-Goppa code representation is $A = 0 \iff c = 0$. In this case

$$ \mathbf{x}' = \frac{a}{d}\mathbf{x} + \frac{b}{d} \quad \text{and} \quad \mathbf{y}' = \lambda d^{r-1}\mathbf{y}. $$

□

With the previous proposition at hand, we thus distinguish two cases:

* The Goppa code is full-support, i.e. $\{x_i \mid i \in \llbracket 1, n \rrbracket\} = \mathbb{F}_{q^m}$. In this case $\{cx_i + d \mid i \in \llbracket 1, n \rrbracket\} = \{cz + d \mid z \in \mathbb{F}_{q^m}\}$ does not contain 0 iff $c = 0$ (and $d \neq 0$), i.e. $f$ is an affine map. By the existence of a Goppa code representation and by Proposition 3.3, it follows that $(\mathbf{x}, \mathbf{y})$ was already a Goppa code representation and nothing must be done.
• The Goppa code is not full-support. By computing the interpolation polynomial on the pairs $(x_i, \frac{1}{y_i})$'s we can check whether $(x, y)$ is an $r$-Goppa code representation. If not, Proposition 3.3 implies that a necessary condition for $(x', y')$ being an $r$-Goppa code representation is that $c \neq 0$. Without loss of generality, we can thus assume $c = 1$, take the linear factor $\lambda = 1$ and consider the candidate maps:

$$ (x, y) \mapsto (x', y') = \left( \frac{ax + b}{x + d}, (x + d)^{r-1}y \right). $$

A simple method to get one good map is to choose at random $(a, b, d)$ and compute the degree of the interpolation polynomial for the pairs $(x'_i, \frac{1}{y'_i})$'s until this is equal to $r$. The degrees of freedom for the affine map show that the probability of finding a sought map is

$$ \frac{(q^m - 1)q^m}{(q^m - 1)q^{2m}} = q^{-m}, $$

that is typically linear in the inverse of the length $n$. By quotienting the maps with respect to the group of affine maps, the worst case complexity becomes $q^m$ times the cost of interpolation polynomial that can be upper bounded by $n^2$. From our experiments, we observed that few more than $r$ pairs must be interpolated to determine whether the polynomial has degree equal to or larger than $r$.

## 4. DESCRIPTION OF STRUCTURED MATRICES IN THE CODE OF QUADRATIC RELATIONSHIPS

Recall that $\mathcal{A}$ is the canonical basis of of $(\mathcal{A}_r(x, y)^\perp)_{\mathbb{F}_{q^m}}$. We will study the matrix code $\mathcal{C}_{\text{mat}}(\mathcal{A})$, whose elements have a special structure and are easier to treat. This will be instrumental to describe a set of rank-2 matrices in the matrix code of quadratic relationships for a binary Goppa code of degree $r = 2$, whose dimension is 3 as a variety:

**Proposition 4.1.** Let $\mathcal{C}_{\text{mat}}$ be the matrix code of quadratic relationships corresponding to the dual of an $[n, n - 2m]$ binary Goppa code in the extension field with a square-free Goppa polynomial of degree 2. Let $\mathcal{P}_2^+(M)$ be the corresponding Pfaffian ideal as defined in (8) and where $M$ is the generic skew-symmetric matrix of size $2m \times 2m$. Then $\text{dim } V(\mathcal{P}_2^+(M)) \ge 3$.

This proposition will be better explained and proved afterwards.

We remark again that the following description is not limited to Goppa codes of degree $r = 2$, but it also applies to alternant codes or higher degrees. Let us now consider the following block shape for an element of $\mathcal{A} \in \mathcal{C}_{\text{mat}}(\mathcal{A})$

$$ \mathbf{A} = \begin{bmatrix} \mathbf{A}_{0,0} & \mathbf{A}_{1,0}^\top & \cdots & \mathbf{A}_{m-1,0}^\top \\ \mathbf{A}_{1,0} & \mathbf{A}_{1,1} & \cdots & \mathbf{A}_{m-1,1}^\top \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{A}_{m-1,0} & \mathbf{A}_{m-1,1} & \cdots & \mathbf{A}_{m-1,m-1} \end{bmatrix}, $$

with $\mathbf{A}_{l,l} \in \text{Sym}(r, \mathbb{F}_{q^m})$, and give a description of the $r \times r$ blocks $\mathbf{A}_{i,j}$'s below and intersecting the main diagonal, i.e. for $i \ge j$, for the matrix $\mathbf{A}$ associated with a given algebraic relation. The blocks above the main diagonal can be easily obtained
by transposition. In particular, we can identify identities that correspond to sparse and constant low-rank matrix codewords. We split such matrices into several types.

**Type 1.** Let $a+b=2c$ and $0 \le a < c < b \le r-1$. The quadratic relation

$$ (x^a y)^{q^l} \star (x^b y)^{q^l} = (x^c y)^{q^l} \star (x^c y)^{q^l} $$

translates into $a_a^{q^l} \star a_b^{q^l} - a_c^{q^l} \star a_d^{q^l} = 0$ with respect to the basis $\mathcal{A}$ and thus it is associated with the matrix $\mathcal{A}$ such that

$$ A_{l,l} = \begin{bmatrix} a & c & b \\ \mathbf{0} & 1 & 0 \\ -2 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix} \begin{array}{c} a \\ c \\ b \end{array}, \quad \text{and } A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (l,l). $$

We remark that, in characteristic $2, -2=0$, and thus $A_{l,l}$ has only two nonzero entries. Therefore $\text{Rank}(\mathcal{A}) = \text{Rank}(A_{l,l}) = \begin{cases} 3 & \text{if field characteristic} \ne 2 \\ 2 & \text{if field characteristic} = 2 \end{cases}$. We also observe that Type 1 matrices exist only for $r \ge 3$.

**Type 2.** Let $0 \le a < c < d < b \le r-1$ and $a+b=c+d$. The quadratic relation

$$ (x^a y)^{q^l} \star (x^b y)^{q^l} = (x^c y)^{q^l} \star (x^d y)^{q^l} $$

translates into $a_a^{q^l} \star a_b^{q^l} - a_c^{q^l} \star a_d^{q^l} = 0$ with respect to the basis $\mathcal{A}$ and thus it is associated with the matrix $\mathcal{A}$ such that

$$ A_{l,l} = \begin{bmatrix} a & c & d & b \\ \mathbf{0} & 1 & 0 & 0 \\ -1 & 0 & 1 & 0 \\ 1 & 0 & 0 & 1 \end{bmatrix} \begin{array}{c} a \\ c \\ d \\ b \end{array}, \quad \text{and } A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (l,l). $$

Therefore $\text{Rank}(\mathcal{A}) = \text{Rank}(A_{l,l}) = 4$. We observe that Type 1 matrices exist only for $r \ge 4$.

**Remark 4.2.** For $a+b=c+d$ even, Type 2 matrices can be derived as linear combinations of two Type 1 matrices thanks to the equality

$$ a_a^{2^l} \star a_b^{2^l} - a_c^{2^l} \star a_d^{2^l} = (a_a^{2^l} \star a_b^{2^l} - a_{\frac{a+b}{2}}^{2^l} \star a_{\frac{a+b}{2}}^{2^l}) - (a_c^{2^l} \star a_d^{2^l} - a_{\frac{c+d}{2}}^{2^l} \star a_{\frac{c+d}{2}}^{2^l}) $$

that holds under the conditions above.

Moreover, we can obtain linear dependencies within the set of Type 2 matrices. Indeed let $a+b=c+d=e+f$ with $0 \le a < c < e < f < d < b \le r-1$. Then the equality

$$ a_a^{2^l} \star a_b^{2^l} - a_c^{2^l} \star a_d^{2^l} = (a_a^{2^l} \star a_b^{2^l} - a_e^{2^l} \star a_f^{2^l}) - (a_c^{2^l} \star a_d^{2^l} - a_e^{2^l} \star a_f^{2^l}) $$

induces a linear dependency on the matrices.
**Type 3.** Let $q = 2$ be the field size of a Goppa code with a square-free Goppa polynomial and $0 \le a < b \le r - 1$. In the quadratic relation

$$ (x^a y)^{2l} \star (x^b y)^{2l} = (x^{a+b} y^2)^{2l-1} \star (x^{a+b} y^2)^{2l-1}, $$

the term $(x^a y)^{2l} \star (x^b y)^{2l}$ translates into $a_a^{2l} \star a_b^{2l}$ with respect to the basis $\mathcal{A}$, while $(x^{a+b} y^2)^{2l-1} \star (x^{a+b} y^2)^{2l-1}$ is the square of a codeword in $\mathcal{G}(x, \Gamma)_{\mathbb{F}_{q^m}}^\perp$. Indeed

$$ (x^{a+b} y^2)^{2l-1} \in \mathbf{GRS}_{2r}(x, y^2)^{(2l-1)} \subseteq \mathcal{A}_{2r}(x, y^2)_{\mathbb{F}_{q^m}}^\perp = \mathcal{A}_{2r}(x, 1/\Gamma(x)^2)_{\mathbb{F}_{q^m}}^\perp = \mathcal{G}(x, \Gamma)_{\mathbb{F}_{q^m}}^\perp $$

with the last equality following from Theorem 2.5. Therefore, as shown in [CMT23, Proposition 9], this quadratic relation is associated with the matrix $\mathcal{A}$ such that

$$ A_{l,l} = \begin{bmatrix} a & b \\ \mathbf{0} & 1 \\ 1 & \mathbf{0} \end{bmatrix}^a, \quad \text{and} \quad A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (l,l). $$

Therefore $\mathrm{Rank}(\mathcal{A}) = \mathrm{Rank}(A_{l,l}) = 2$.

**Remark 4.3.** Type 1 and Type 3 matrices are the only ones described in [CMT23] and are exactly those of rank $\le 3$. In the case of field characteristic 2, these are indeed the targets of the Pfaffian modeling. Note that, in the case of a square-free binary Goppa code, Type 1 matrices are included in Type 3 matrices and correspond to the choice $a+b$ being even. Moreover, Type 2 matrices can be obtained as linear combinations of two Type 3 matrices thanks to the equality

$$ a_a^{2l} \star a_b^{2l} - a_c^{2l} \star a_d^{2l} = (a_a^{2l} \star a_b^{2l} - a_{a+b}^{2l-1} \star a_{a+b}^{2l-1}) - (a_c^{2l} \star a_d^{2l} - a_{c+d}^{2l-1} \star a_{c+d}^{2l-1}) = 0 $$

that holds whenever $a+b=c+d$.

**Type 4.** Let $a < c, b > d, (u-l) \mod m \le e_{\mathcal{A}} \stackrel{\mathrm{def}}{=} [\log_q(r+1)]$ and $aq^l+bq^u = cq^l+dq^u$. The quadratic relation

$$ (x^a y)^{q^l} \star (x^b y)^{q^u} = (x^c y)^{q^l} \star (x^d y)^{q^u} $$

translates into $a_a^{q^l} \star a_b^{q^u} - a_c^{q^l} \star a_d^{q^u} = 0$ with respect to the basis $\mathcal{A}$ and thus it is associated with the matrix $\mathcal{A}$ such that

• if $u > l$:

$$ A_{u,l} = \begin{bmatrix} a & c \\ \mathbf{0} & -1 \\ 1 & \mathbf{0} \end{bmatrix}^d, \quad \text{and} \quad A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (u,l). $$
• if $l > u$:

$$ A_{u,l}^{\top} = \begin{bmatrix} a & c \\ \mathbf{0} & -1 \\ 1 & \mathbf{0} \end{bmatrix}^{\begin{matrix} d \\ b \end{matrix}}, \quad \text{and } A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (l,u). $$

Therefore $\text{Rank}(\mathbf{A}) = \text{Rank}(A_{u,l}) + \text{Rank}(A_{u,l}^{\top}) = 4$. Differently from the previous types, these matrices are not block diagonal.

**Remark 4.4.** We can obtain linear dependencies within the set of Type 4 matrices. Indeed let $aq^l + bq^u = cql + dq^u = eq^l + fq^u$ with $a < c < e, f < d < b$. Then the equality

$$ a_a^{q^l} \star a_b^{q^u} - a_c^{q^l} \star a_d^{q^u} = (a_a^{q^l} \star a_b^{q^u} - a_e^{q^l} \star a_f^{q^u}) - (a_c^{q^l} \star a_d^{q^u} - a_e^{q^l} \star a_f^{q^u}) $$

induces a linear dependency on the matrices.

We also observe that Type 4 matrices exist only starting from $r \ge 3$.

**Type 5.** Let $q = 2$ be the field size of a Goppa code with a square-free Goppa polynomial $\Gamma(z) = \sum_{a=0}^{r} \gamma_a z^a$. Fix $u, l \in [0, m-1]$ such that $1 \le (u-l) \mod m \le v \stackrel{\text{def}}{=} [\log_2 r]$ and let $s \stackrel{\text{def}}{=} 2^{(u-l-1)} \mod m w$, for some $w \in [0, 2r-2]$. For all $a \in [0, r-1]$, we define

$$ B_a \stackrel{\text{def}}{=} \left[ \left\lfloor \frac{a+s-r+1}{2^{(u-l)} \mod m} \right\rfloor, \left\lceil \frac{a+s}{2^{(u-l)} \mod m} \right\rceil \right] \cap [0, r-1]. $$

For all $a \in [0, r]$, let us also define $c_{(a,b)} = a + s - 2^{(u-l)} \mod mb$ and $\gamma_{c_{(a,b)},b} \in \mathbb{F}_{q^m}$, $b \in B_a$, such that $\sum_{b \in B_a} \gamma_{c_{(a,b)},b} = \gamma_a$. In the quadratic relation

$$ \begin{aligned} & \sum_{a=0}^{r} \left( \sum_{b \in B_a} \gamma_{c_{(a,b)},b}^{2l} (x^{c_{(a,b)}} y)^{2l} \star (x^b y)^{2u} \right) \\ &= \sum_{a=0}^{r} \left( \sum_{b \in B_a} \gamma_{c_{(a,b)},b} x^a \right)^{2l} x^{2ls} y^{2u+2l} \\ &= x^{2ls} y^{2u} \\ &= (x^w y^2)^{2^{(u-2)} \mod m} \star (x^w y^2)^{2^{(u-2)} \mod m}, \end{aligned} $$

the term $\sum_{a=0}^{r} \left( \sum_{b \in B_a} \gamma_{c_{(a,b)},b}^{2l} (x^{c_{(a,b)}} y)^{2l} \star (x^b y)^{2u} \right)$ translates into

$\sum_{a=0}^{r} \left( \sum_{b \in B_a} \gamma_{c_{(a,b)},b}^{2l} a_{c_{(a,b)}}^{2l} \star a_b^{2u} \right)$ with respect to the basis $\mathcal{A}$, while $(x^w y^2)^{2^{(u-2)} \mod m} \star (x^w y^2)^{2^{(u-2)} \mod m}$ is the square of a codeword in $\mathcal{G}(\mathbf{x}, \Gamma)_{\mathbb{F}_{q^m}}^{\perp}$ because of Theorem 2.5. Therefore, analogously to Type 3 matrices, whenever $\forall a \in [0, r]$, $B_a \ne \emptyset$, this quadratic relation is associated with the matrix $\mathbf{A}$ such that
• if $u > l$:

$$ A_{u,l} = \begin{bmatrix} \cdots & \cdots & \cdots \\ \vdots & \vdots & \vdots \\ \cdots & \gamma_{i,b}^{2l} & \cdots \\ \vdots & \vdots & \vdots \\ \cdots & \cdots & \cdots \end{bmatrix}_b, \quad \text{and} \quad A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (u,l). $$

• if $l > u$:

$$ A_{u,l}^{\top} = \begin{bmatrix} \cdots & \cdots & \cdots \\ \vdots & \vdots & \vdots \\ \cdots & \gamma_{i,b}^{2l} & \cdots \\ \vdots & \vdots & \vdots \\ \cdots & \cdots & \cdots \end{bmatrix}_b, \quad \text{and} \quad A_{i,j} = \mathbf{0}_{r \times r} \text{ for } 0 \le j \le i \le m-1, (i,j) \ne (l,u). $$

where $\gamma_{i,b}$ is set to 0 for any $i \notin \{c_{(a,b)} | a \in [0, r]\}$.

This is the most articulated type of matrix, and in general it is not straightforward to calculate its rank. Since $B_a$ must be nonempty for every $a \in [0, r]$ and $||[0, r]|| = r + 1 > r$, at least two rows of $A_{u,l}$ are nonzero and it can be verified that they cannot all be linearly dependent. This implies that $\text{Rank}(A) = 2\text{Rank}(A_{u,l}) \ge 4$. However, for any $r, u, l$ and for any admissible choice of $s$, we can choose the $\gamma_{c_{(a,b)},b}$'s in such a way that only two consecutive rows are nonzero. In particular, we can determine sparse matrices (with only $2(r+1)$ nonzero entries) of rank 4. We provide a couple of examples below.

**Example 4.5.** Let $r = 6$, $u = 1$, $l = 0$ and let us take $s = 1$. The matrix $A$ such that

$$ A_{1,0} = \begin{bmatrix} 0 & \gamma_0 & \gamma_1 & \gamma_2 & \gamma_3 & \gamma_4 \\ 0 & 0 & 0 & 0 & \gamma_5 & \gamma_6 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} $$

and $A_{i,j} = \mathbf{0}_{r \times r}$ for $0 \le j \le i \le m-1, (i,j) \ne (u,l)$, belongs to $\mathcal{C}_{\text{mat}}(A)$ and has rank 4.

**Example 4.6.** Let $r = 6$, $u = 2$, $l = 0$ and let us take $s = 2 \cdot 5 = 10$. The matrix $A$ such that

$$ A_{3,1} = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \gamma_0^2 & \gamma_1^2 & \gamma_2^2 & \gamma_3^2 & 0 & 0 \\ \gamma_4^2 & \gamma_5^2 & \gamma_6^2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} $$

and $A_{i,j} = \mathbf{0}_{r \times r}$ for $0 \le j \le i \le m-1, (i,j) \ne (u,l)$, belongs to $\mathcal{C}_{\text{mat}}(A)$ and has rank 4.
**The Pfaffian variety with respect to a square-free Goppa polynomial of degree $r = 2$.** Let $\mathbb{F}$ be a finite field of characteristic 2, $\mathcal{C} \subset \mathbb{F}^n$ an $[n, s]$ linear code with basis $\mathcal{C}_{\text{mat}}(\mathcal{V})$, $M = (m_{i,j}) \in \text{Skew}(s, \mathbb{F})$ the generic skew-symmetric matrix (i.e. all $\binom{s}{2}$ entries below the main diagonal are seen as independent variables) and $m$ the vector of length $\binom{s}{2}$ containing all the independent variables corresponding to the entries of $M$. We recall here the definition of the generic Pfaffian ideal $\mathcal{P}_2(M) \in \mathbb{F}[m]$ for rank 2.

**Definition 4.7** (Pfaffian ideal for rank 2). The *Pfaffian ideal* of rank 2 for $M$ in characteristic 2 is

$$ (7) \qquad \mathcal{P}_2(M) \stackrel{\text{def}}{=} \langle m_{i,j}m_{k,l} + m_{i,k}m_{j,l} + m_{i,l}m_{j,k} \mid 1 \le i < j < k < l \le s \rangle. $$

The Hilbert series of the quotient $\mathbb{F}[m]/\mathcal{P}_2(M)$ is known [GK04] and the dimension of the associated variety is $2s - 3$.

In [CMT23], the Pfaffian ideal $\mathcal{P}_2^+(M) \in \mathbb{F}[m]$ for rank 2 with respect to the matrix code $\mathcal{C}_{\text{mat}}(\mathcal{V})$ has been defined. This can be written as

$$ (8) \qquad \mathcal{P}_2^+(M) = \mathcal{P}_2(M) + \langle L_1(m), \dots, L_t(m) \rangle, $$

where the $t = \binom{s}{2} - \dim_{\mathbb{F}} \mathcal{C}_{\text{mat}}(\mathcal{V})$ linearly independent linear polynomials $L_i$'s in $m$ express the fact that $M$ belongs to the matrix subspace $\mathcal{C}_{\text{mat}}(\mathcal{V})$. This ideal was introduced because, by evaluating the Hilbert function at a high enough degree, alternant and Goppa codes can be distinguished from random codes. In particular, if $\mathcal{C} \subset \mathbb{F}_{qm}^n$ is a random $[n, rm]$ code and $n > 3rm - 3$, then with high-probability the variety $V(\mathcal{P}_2^+(M)) = \{0\}$. On the other hand, if $\mathcal{C} = \mathcal{G}(\mathbf{x}, \Gamma) \perp_{\mathbb{F}_m^\perp}$, where $\mathcal{G}(\mathbf{x}, \Gamma)$ is an $[n, n - rm]$ binary Goppa code with a square-free Goppa polynomial defined from a field extension of degree $m$ and $r \ge 3$, then [CMT23, Proposition 16] shows that

$$ (9) \qquad \dim V(\mathcal{P}_2^+(M)) \ge 2r - 3. $$

The reason why the result does not include the case $r = 2$ is strongly connected to the distinguishability of the GRS code $\text{GRS}_r(\mathbf{x}, \mathbf{y})$. Indeed the smallest value for which two Schur's products of different pairs of codewords in $\text{GRS}_r(\mathbf{x}, \mathbf{y})$ coincide is 3: $(\mathbf{x}^2\mathbf{y}) \star (\mathbf{y}) = (\mathbf{x}\mathbf{y})^{*2}$. Intuitively, this is reasonable: the vectors $\mathbf{x}$ and $\mathbf{y}$ are a compact representation of the GRS code, but any 2-dimensional code is determined by two linearly independent codewords. This fact is inherited when considering subfield subcodes of GRS codes: the alternant code $\mathcal{A}_2(\mathbf{x}, \mathbf{y})$ is not distinguishable from random codes in general. However, a binary Goppa code of degree 2 with a square-free Goppa polynomial remains in principle distinguishable and $V(\mathcal{P}_2^+(M)) \supseteq \{0\}$. This is obvious from the existence of rank-2 matrices in $\mathcal{C}_{\text{mat}}(\mathcal{A})$. Indeed, by fixing $l$ and choosing $a = 0, b = 1$ in the Type 3 construction, we obtain the matrix $\mathbf{A} \in \mathcal{C}_{\text{mat}}(\mathcal{A})$ such that

$$ \mathbf{A}_{l,l} = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, \qquad \mathbf{A}_{i,j} = \mathbf{0}_{2 \times 2} \quad \text{otherwise.} $$

This immediately implies that $\dim V(\mathcal{P}_2^+(M)) \ge 1$ getting back the lower bound in (9) for $r = 2$ too. We recall and finally prove Proposition 4.1, which shows that in this case the lower bound on the dimension of the variety is not tight.

**Proposition 4.8.** Let $\mathcal{C}_{\text{mat}}$ be the matrix code of quadratic relationships corresponding to the dual of an $[n, n - 2m]$ binary Goppa code in the extension field
with a square-free Goppa polynomial of degree 2. Let $\mathcal{P}_2^+(M)$ be the corresponding Pfaffian ideal as defined in (8) and where $M$ is the generic skew-symmetric matrix of size $2m \times 2m$. Then $\dim V(\mathcal{P}_2^+(M)) \ge 3$.

*Proof.* We consider a subspace of $\mathcal{C}_{\text{mat}}(\mathcal{A})$ spanned by some of the matrices presented in Section 2. Let us fix some $l \in [0, m-1]$ and take

* the Type 3 matrix obtained by taking $a = 0, b = 1$ and $l$;

* the Type 3 matrix obtained by taking $a = 0, b = 1$ and $l+1$;

* the Type 5 matrices obtained by taking $s = 0, u = l+1, \gamma_{c(0,0),0} = \gamma_0, \gamma_{c(1,0),0} = \gamma_1, \gamma_{c(2,1),1} = \gamma_2$ and $\gamma_{i,b} = 0$ otherwise;

* the Type 5 matrices obtained by taking $s = 1, u = l+1, \gamma_{c(0,0),0} = \gamma_0, \gamma_{c(1,1),1} = \gamma_1, \gamma_{c(2,1),1} = \gamma_2$ and $\gamma_{i,b} = 0$ otherwise.

We fix $l=0$ for simplicity, but the same argument works for any other value in $[0, m-1]$. Let $\lambda = (\lambda_1, \dots, \lambda_4) \in \mathbb{F}_{q^m}^4$ be the vectors of coefficients in the linear combination of the 4 matrices above. We thus obtain the parametrized matrix

$$ A(\lambda) = \begin{bmatrix} 0 & \lambda_1 & \lambda_3\gamma_0 & \lambda_3\gamma_2 + \lambda_4\gamma_1 \\ \lambda_1 & 0 & \lambda_3\gamma_1 + \lambda_4\gamma_0 & \lambda_4\gamma_2 \\ \lambda_3\gamma_0 & \lambda_3\gamma_1 + \lambda_4\gamma_0 & 0 & \lambda_2 \\ \lambda_3\gamma_2 + \lambda_4\gamma_1 & \lambda_4\gamma_2 & \lambda_2 & 0 \end{bmatrix} \quad \begin{matrix} \mathbf{0}_{4 \times 2m-4} \\ \mathbf{0}_{2m-4 \times 4} \\ \mathbf{0}_{2m-4 \times 2m-4} \end{matrix} $$

The only possible nonzero $4 \times 4$ minor is the top left one. This is a principal minor, thus the submatrix is skew-symmetric and its determinant is the square of a polynomial in its entries called *pfaffian*, which we denote with *pf*. A straightforward computation gives

$$
\begin{align*}
\det & \begin{pmatrix}
0 & \lambda_1 & \lambda_3\gamma_0 & \lambda_3\gamma_2 + \lambda_4\gamma_1 \\
\lambda_1 & 0 & \lambda_3\gamma_1 + \lambda_4\gamma_0 & \lambda_4\gamma_2 \\
\lambda_3\gamma_0 & \lambda_3\gamma_1 + \lambda_4\gamma_0 & 0 & \lambda_2 \\
\lambda_3\gamma_2 + \lambda_4\gamma_1 & \lambda_4\gamma_2 & \lambda_2 & 0
\end{pmatrix} \\
& = pf^2 \begin{pmatrix}
0 & \lambda_1 & \lambda_3\gamma_0 & \lambda_3\gamma_2 + \lambda_4\gamma_1 \\
\lambda_1 & 0 & \lambda_3\gamma_1 + \lambda_4\gamma_0 & \lambda_4\gamma_2 \\
\lambda_3\gamma_0 & \lambda_3\gamma_1 + \lambda_4\gamma_0 & 0 & \lambda_2 \\
\lambda_3\gamma_2 + \lambda_4\gamma_1 & \lambda_4\gamma_2 & \lambda_2 & 0
\end{pmatrix} \\
& = (\lambda_1\lambda_2 + \lambda_3\lambda_4\gamma_0\gamma_2 + \lambda_3^2\gamma_1\gamma_2 + \lambda_3\lambda_4\gamma_1^2 + \lambda_3\lambda_4\gamma_0\gamma_2 + \lambda_4^2\gamma_0\gamma_1)^2 \\
& = (\lambda_1\lambda_2 + \lambda_3^2\gamma_1\gamma_2 + \lambda_3\lambda_4\gamma_1^2 + \lambda_4^2\gamma_0\gamma_1)^2.
\end{align*}
$$

We want to study for which $\lambda$ the pfaffian $\lambda_1\lambda_2 + \lambda_3^2\gamma_1\gamma_2 + \lambda_3\lambda_4\gamma_1^2 + \lambda_4^2\gamma_0\gamma_1$ equals 0. For any free choice of $\lambda_3, \lambda_4$ two cases may occur:

* if $\lambda_3^2\gamma_1\gamma_2 + \lambda_3\lambda_4\gamma_1^2 + \lambda_4^2\gamma_0\gamma_1 = 0$, then the equality is obtained by fixing one between $\lambda_1$ or $\lambda_2$ to 0 and the other can take any value over $\mathbb{F}_{q^m}$;

* if $\lambda_3^2\gamma_1\gamma_2 + \lambda_3\lambda_4\gamma_1^2 + \lambda_4^2\gamma_0\gamma_1 \neq 0$, then the equality is obtained by taking any $\lambda_1 \neq 0$ and $\lambda_2 = \lambda_1^{-1}$.

Therefore, there are 3 degrees of freedom in the choice of $\lambda$ and since all the corresponding matrices belong to $\mathcal{C}_{\text{mat}}(\mathcal{A})$, this implies that $\dim V(\mathcal{P}_2^+(M)) \ge 3$. $\square$
The previous proposition shows that we can fix 3 variables in the Pfaffian system and still expect to have non-trivial solutions, i.e. rank-2 matrices in $\mathscr{C}_{\text{mat}}(\mathcal{B})$, with overwhelming probability in the specialized non-homogeneous system.

## 5. RETRIEVING THE BASIS OF A GRS CODE

Analogously to the previous section, we focus here on the case of a binary Goppa code with a square-free Goppa polynomial of degree 2 and adapt the attack from [CMT23, Section 6] to this setting. We first recall the setting of the attack proposed in [CMT23] for distinguishable parameters with respect to the notion of distinguishability given in [FGO$^{+}$11, MT23]. In this framework, under the condition that $3 \le r < q+1$ ($3 \le r < q-1$ respectively) the matrix code $\mathscr{C}_{\text{mat}}(\mathcal{A})$ originated by a generic alternant code (generic Goppa code respectively) contains only block diagonal elements (with $m$ blocks of size $r \times r$). This very special shape allowed to recover a basis of the alternant/Goppa code, by sampling almost full-rank matrices in the code and gaining information about codewords lying in a single GRS code from the kernels of these matrices.

However, the conditions are not satisfied here for several reasons:

* the Goppa code is not distinguishable in the sense of [FGO$^{+}$11, MT23];

* the Goppa polynomial degree $r = 2 < 3$;

* for Goppa codes it was required that $r < q-1$, but here $r = q = 2$.

We thus follow an alternative approach. Suppose we are able to sample rank-2 matrices in $\mathscr{C}_{\text{mat}}(\mathcal{B})$ by solving the Pfaffian system specialized into 3 variables. In this section, we describe how to recover a basis of one of the $m$ codes $\mathbf{GRS}_2(x^{q^j}, y^{q^j})$. The algorithm is therefore an adaptation of [CMT23, Section 6], where kernels are computed from low-rank matrices instead of almost full-rank ones.

A set of rank-2 matrices in $\mathscr{C}_{\text{mat}}(\mathcal{A})$ has been exhibited in the previous section. Below the Gilbert-Varshamov distance computed with respect to the space of skew-symmetric matrices of size $rm$, all the solutions of the Pfaffian system are expected to have the structure described in the proof of Proposition 4.1, or the analogous one for another fixed value of $l \in [0, m-1]$, with very high probability. We will exploit that any rank-2 matrix in the code $\mathscr{C}_{\text{mat}}(\mathcal{A})$ has this structure. We recall from [CMT23, Proposition 10] that the parameters above the Gilbert-Varshamov distance correspond to those for which

$$n > 3m - 3.$$

Therefore, the attack we will now present works for binary Goppa codes with a square-free Goppa polynomial of degree 2 and is based on the following standard assumption that we have extensively verified through experiments (on both TII challenges and randomly generated instances):

**Assumption 5.1.** Let $\mathscr{G}(\mathbf{x}, \Gamma)$ be a binary $[n, n-2m]$ Goppa code with a square-free Goppa polynomial $\Gamma$ of degree 2 and let $n > 3m-3$. Let $\mathcal{A}$ be the canonical basis of $\mathscr{G}(\mathbf{x}, \Gamma)_{\Gamma^{\perp}_{q^m}}$ as given in (1). Then, for $n \to \infty$, a rank 2 matrix in $\mathcal{A} \in \mathscr{C}_{\text{mat}}(\mathcal{A})$ is such that only 4 blocks are non-zero, in particular

$$\exists l \in [0, m-1] \text{ s.t. } \forall (u, v) \notin \{(l, l), (l+1, l), (l+1, l+1)\} \text{ mod } m, \quad \mathbf{A}_{u,v} = \mathbf{0}_{r \times r},$$
**Algorithm 1** Sketch of the attack for binary square-free Goppa codes of order 2

1: Choose a basis $\mathcal{B} = (b_1, \dots, b_r, b_1^q, \dots, b_r^q, \dots, b_1^{q^{m-1}}, \dots, b_r^{q^{m-1}})$ for $\mathcal{G}(\mathbf{x}, \Gamma)_{\mathbb{F}_{q^m}}^{\perp}$.

2: **repeat**

3: Find two matrices $B_1, B_2 \in \mathcal{C}_{\text{mat}}(\mathcal{B})$ of rank 2

4: $K_1 \leftarrow \text{ker}(B_1)$

5: $K_2 \leftarrow \text{ker}(B_2)$

6: $\mathcal{V} \leftarrow K_1 \cap K_2$

7: $\mathcal{V} \leftarrow \mathcal{V} + \mathcal{V}^{(q)}\mathbf{S} \quad \triangleright \mathbf{S}$ is defined as in (12)

8: $\mathbf{GRS} \leftarrow \mathcal{V}^{\perp} \cdot \mathbf{H}_{\mathcal{B}} \quad \triangleright \mathbf{H}_{\mathcal{B}}$ is defined as in (11)

9: **until** $\dim_{\mathbb{F}_{q^m}} \mathbf{GRS} = 2$ and $\mathbf{GRS} \not\subseteq \mathbb{F}_q^n$

10: Apply the Sidelnikov-Shestakov attack on **GRS**

i.e.

$$ \mathbf{A} = \begin{bmatrix} \mathbf{0}_{r \times r} & & & & & \mathbf{0}_{r \times r} \\ & \ddots & & & & \mathbf{0}_{r \times r} \\ & & \mathbf{A}_{l-1, l-1} & \mathbf{A}_{l, l-1}^{\top} & & \mathbf{A}_{l, l} & \ddots \\ & & \mathbf{A}_{l, l-1} & \mathbf{A}_{l, l} & & \mathbf{A}_{l-1, l-1}^{\top} & \ddots \\ & & & \ddots & & \ddots & \mathbf{0}_{r \times r} \end{bmatrix}. $$

with probability $1 - o(1)$.

In particular the shape of $\mathbf{A}$ in Assumption 5.1 is the same (minus diagonal shift) as the one of $\mathbf{A}(\lambda)$ in Proposition 4.1 for an admissible value of the parameter $\lambda$ that makes $\mathbf{A}(\lambda)$ of rank 2.

Algorithm 1 provides a sketch of the attack.

It succeeds if at some iteration of the repeat cycle the code **GRS** is one of the $m$ GRS codes of which $\mathcal{G}(\mathbf{x}, \Gamma)$ is a subfield subcode. Indeed, in this case, the well-known Sidelnikov-Shestakov attack allows to retrieve a valid pair of support and multiplier for **GRS** that also defines an alternant code that coincides with $\mathcal{G}(\mathbf{x}, \Gamma)$.

Hence the key recovery of Algorithm 1 follows on the spot from the next proposition.

**Proposition 5.2.** Consider an iteration of the repeat/until loop of Algorithm 1. For $n \to \infty$ and under Assumption 5.1, the equation

$$ (\mathcal{V} + \mathcal{V}^{(q)}\mathbf{S})^{\perp} \cdot \mathbf{H}_{\mathcal{B}} = \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q'} $$

holds with probability $\frac{1}{m}(1 - o(1))$ at least.

In the next subsection, we provide a proof of Proposition 5.2 that is therefore a proof of correctness for Algorithm 1 under Assumption 5.1.

5.1. **Explanation of Algorithm 1 under Assumption 5.1.** Algorithm 1 starts by computing a basis $\mathcal{B}$ of $\mathcal{G}(\mathbf{x}, \Gamma)_{\mathbb{F}_{q^m}}^{\perp}$ with a special shape:

$$ (10) \qquad \mathcal{B} = (b_1, \dots, b_r, b_1^q, \dots, b_r^q, \dots, b_1^{q^{m-1}}, \dots, b_r^{q^{m-1}}). $$

An efficient procedure to obtain a basis like this has already been explained in [CMT23]. Given a basis $\mathcal{V} = (v_1, \dots, v_k)$ of an $[n, k]$ code (for instance $\mathcal{A}$ or $\mathcal{B}$)
we denote by $H_V$ the $k \times n$ matrix whose rows are the elements of $V$ in the same order:

$$ (11) \qquad H_V \stackrel{\text{def}}{=} \begin{pmatrix} v_1 \\ \vdots \\ v_k \end{pmatrix}. $$

Let us define the right $r$-cyclic shift matrix $S \in \text{GL}_{mr}(\mathbb{F}_{q^m})$ as

$$ (12) \qquad S \stackrel{\text{def}}{=} \begin{pmatrix} I_r & & & \\ & I_r & & \\ & & \ddots & \\ & & & I_r \end{pmatrix}. $$

Note that $S^{-1} = S^\top$ is the left $r$-cyclic shift matrix. We first recall, without proving it, a preliminary result from [CMT23] that also comes in handy here.

**Lemma 5.3.** Whenever a basis $\mathcal{B}$ has the form given in (10), $\mathcal{C}_{\text{mat}}(\mathcal{B})$ is stable by the operation

$$ M \mapsto S^\top M^{(q)} S. $$

The next results characterize the structure of the kernel of a rank 2 matrix $A \in \mathcal{C}_{\text{mat}}(A)$.

**Lemma 5.4.** Let $A, B$ be the two bases introduced before and $P$ the change of basis, i.e. $H_B = PH_A$. Let $B \in \mathcal{C}_{\text{mat}}(B)$ be of rank 2 and $n > 3m - 3$. Then $\exists l \in [0, m-1]$ such that

$$ \ker(B)(P^{-1})^{\top} P^{-1} H_B \supset \sum_{j \in [0, m-1] \setminus \{(l-1) \bmod m), l\}} \text{GRS}_2(x, y)^{q^j} $$

with probability $1-o(1)$.

*Proof.* For better readability, we will assume in the following that $l \in [1, m-2]$, but the same arguments work for $l = 0, m-1$ as well. Let $P^\top BP \in \mathcal{C}_{\text{mat}}(A)$. From Assumption 5.1, with overwhelming probability, $P^\top BP$ has only 4 non-zero blocks, in particular

$$ (13) \qquad P^\top BP = \begin{bmatrix} 0_{r \times r} & & & & & & 0_{r \times r} \\ & \ddots & & & & & \ddots \\ & & A_{l-1, l-1} & A_{l, l-1}^\top & & & \\ & & A_{l, l-1} & A_{l, l} & & & \\ & \ddots & & & \ddots & & \\ & & & & & \ddots & \\ 0_{r \times r} & & & & & & 0_{r \times r} \end{bmatrix}. $$

Let $c \in \sum_{j \in [0, m-1] \setminus \{(l-1) \bmod m), l\}} \text{GRS}_2(x, y)^{q^j}$. Then $c = dH_A$, where $d = (0_r, \dots, 0_r, d_l, d_{l+1}, 0_r, \dots, 0_r)$.

This implies that

$d \in \ker(P^\top BP),$

which is equivalent to

$dP^\top \in \ker(B),$
since $\mathbf{P}$ is invertible. Hence, we obtain

$$ \mathbf{c} = d\mathbf{H}_A = d(\mathbf{P}^{\top}(\mathbf{P}^{-1})^{\top})\mathbf{P}^{-1}\mathbf{H}_B \in \ker(\mathbf{B})(\mathbf{P}^{-1})^{\top}\mathbf{P}^{-1}\mathbf{H}_B. \quad \square $$

**Lemma 5.5.** Let $\mathbf{B} \in \mathcal{C}_{\text{mat}}(\mathbf{B})$, $\mathcal{V} = \ker(\mathbf{B})$ and $\mathbf{S}$ be defined as in (12). Then $\mathcal{V}^{(q)}\mathbf{S} = \ker(\mathbf{S}^{\top}\mathbf{B}^{(q)}\mathbf{S})$.

*Proof.* This readily follows from the fact that $\mathbf{S}$ is invertible with inverse $\mathbf{S}^{\top}$. Indeed, $\forall \mathbf{v} \in \mathcal{V}$,

$$ \begin{align*} 0 &= \mathbf{v}\mathbf{B} \\ \iff 0 &= (\mathbf{v}\mathbf{B})^q\mathbf{S} = \mathbf{v}^q\mathbf{B}^{(q)}\mathbf{S} = (\mathbf{v}^q\mathbf{S}) \cdot \mathbf{S}^{\top}\mathbf{B}^{(q)}\mathbf{S}. \quad \square \end{align*} $$

Let $\mathbf{B}_1$ and $\mathbf{B}_2$ be the two matrices sampled at line 3 in Algorithm 1 and consider the case where $\mathbf{P}^{\top}\mathbf{B}_1\mathbf{P}$ and $\mathbf{P}^{\top}\mathbf{B}_2\mathbf{P}$ are as in Equation (13) for the same indices $l-1 \mod m$ and $l$. This will happen with probability $1/m$. Then, since $\dim_{\mathbb{F}_{q^m}} \ker(\mathbf{B}_1) = \dim_{\mathbb{F}_{q^m}} \ker(\mathbf{B}_2) = rm-2$ and $\mathbf{B}_1$ and $\mathbf{B}_2$ are independent, we expect that $\dim_{\mathbb{F}_{q^m}} \ker(\mathbf{B}_1) \cap \ker(\mathbf{B}_2) = rm-4$ with high probability. If this is the case, the fact that

$$ \dim_{\mathbb{F}_{q^m}} \sum_{j \in [0, m-1] \setminus \{(l-1) \mod m, l\}} \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^j} = rm - 4 $$

in conjunction with Proposition 5.4 implies that

$$ (14) \qquad \mathcal{V}(\mathbf{P}^{-1})^{\top}\mathbf{P}^{-1}\mathbf{H}_B = \sum_{j \in [0, m-1] \setminus \{(l-1) \mod m, l\}} \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^j}, $$

where

$$ \mathcal{V} \stackrel{\text{def}}{=} (\ker(\mathbf{B}_1) \cap \ker(\mathbf{B}_2)). $$

We are finally ready to prove Proposition 5.2 under Assumption 5.1, thus showing how the space $\mathcal{V}$ unveils a basis for a single GRS code.

*Proof of Proposition 5.2.* From Assumption 5.1 and the argument shown above about matrices $\mathbf{B}_1$ and $\mathbf{B}_2$, we have that Equation (14) holds with probability at least $\frac{1}{m}(1-o(1))$. In this case, by Lemmata 5.4 and 5.5, we deduce that

$$ \mathcal{V}^{(q)}\mathbf{S}(\mathbf{P}^{-1})^{\top}\mathbf{P}^{-1}\mathbf{H}_B = \sum_{j \in [0, m-1] \setminus \{l, (l+1) \mod m\}} \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^j}. $$

Under the usual assumption that all the $m$ GRS codes have trivial intersection, we obtain

$$ (\mathcal{V} + \mathcal{V}^{(q)}\mathbf{S})(\mathbf{P}^{-1})^{\top}\mathbf{P}^{-1}\mathbf{H}_B = \sum_{j \in [0, m-1] \setminus \{l\}} \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^j}. $$

Let us now pick $\mathbf{v}^{\perp} \in (\mathcal{V} + \mathcal{V}^{(q)}\mathbf{S})^{\perp}$. For any $\mathbf{v} \in \mathcal{V} + \mathcal{V}^{(q)}\mathbf{S}$, we can write

$$ 0 = \langle \mathbf{v}, \mathbf{v}^{\perp} \rangle = \langle \mathbf{v} \mathbf{I}_{rm}, \mathbf{v}^{\perp} \rangle = \langle \mathbf{v} (\mathbf{P}^{\top})^{-1} \mathbf{P}^{\top}, \mathbf{v}^{\perp} \rangle = \langle \mathbf{v} (\mathbf{P}^{-1})^{\top}, \mathbf{v}^{\perp} \mathbf{P} \rangle. $$

Therefore $\mathbf{v}^{\perp}\mathbf{P}$ is zero outside the $j$-th block. Hence

$$ (\mathcal{V} + \mathcal{V}^{(q)}\mathbf{S})^{\perp}\mathbf{H}_B = ((\mathcal{V} + \mathcal{V}^{(q)}\mathbf{S})^{\perp}\mathbf{P})\mathbf{H}_A \subseteq \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^j}, $$
<table><caption>TABLE 1. TII challenges with Goppa polynomial degree 2</caption><thead><tr><th>q</th><th>r</th><th>claimed bit complexity λ</th><th>m</th><th>n</th><th>n > 3rm − 3 ?</th><th>average time attack</th></tr></thead><tbody><tr><td rowspan="7">2</td><td rowspan="7">2</td><td>22</td><td>5</td><td>32</td><td>yes</td><td>&lt;3s</td></tr><tr><td>39</td><td>5</td><td>28</td><td>yes</td><td>&lt;3s</td></tr><tr><td>41</td><td>5</td><td>27</td><td>no (equal)</td><td>~10s</td></tr><tr><td>43</td><td>5</td><td>26</td><td>no</td><td>&lt;1min</td></tr><tr><td>44</td><td>6</td><td>61</td><td>yes</td><td>&lt;10s</td></tr><tr><td>48</td><td>6</td><td>60</td><td>yes</td><td>&lt;10s</td></tr><tr><td>58</td><td>6</td><td>57</td><td>yes</td><td>&lt;10s</td></tr><tr><td>63</td><td>6</td><td>55</td><td>yes</td><td>&lt;10s</td></tr><tr><td>65</td><td>6</td><td>54</td><td>yes</td><td>&lt;10s</td></tr><tr><td>68</td><td>6</td><td>53</td><td>yes</td><td>&lt;10s</td></tr></tbody></table>

and since $\dim_{\mathbb{F}_{q^m}} ((\mathcal{Y} + \mathcal{Y}^{(q)}\mathbf{S})^{\perp}) = rm - \dim_{\mathbb{F}_{q^m}} (\mathcal{Y} + \mathcal{Y}^{(q)}\mathbf{S}) = 2$, we get

$$ (\mathcal{Y} + \mathcal{Y}^{(q)}\mathbf{S})^{\perp} \mathbf{H}_{\mathcal{B}} = \mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^l}. $$

□

At this stage, it is enough to apply the Sidelnikov-Shestakov attack [SS92] on $\mathbf{GRS}_2(\mathbf{x}, \mathbf{y})^{q^l} = (\mathcal{Y} + \mathcal{Y}^{(q)}\mathbf{S})^{\perp} \mathbf{H}_{\mathcal{B}}$. The support-multiplier pair output by this procedure is also a valid support-multiplier pair for the Goppa code $\mathcal{G}(\mathbf{x}, \Gamma) = \mathcal{A}_2(\mathbf{x}, \mathbf{y})$.

**Remark 5.6.** It is easy to see that a slightly refined version of Algorithm 1 guarantees its termination, under Assumption 5.1. Even if the sampled matrices $\mathbf{B}_1$ and $\mathbf{B}_2$ do not lead to the same shape of Equation (13), there must be $l \in [0, m-1]$ such that $\mathbf{B}_1$ and $(\mathbf{S}^{\top})^l \mathbf{B}_2^{(q^l)} \mathbf{S}^l$ do. Therefore, at most $m$ iterations are needed in order to get the GRS code.

We conclude the section by giving the parameters of various TII challenges broken by this attack in Table 1. We run experiments in MAGMA on an Intel Core i7-1355U Processor. The variance of the attack timing computed on several resolutions is pretty high, due to the randomicity in the variable specialization, but on average all instances such that $n > 3rm - 3$ take less than 10 seconds. When instead $n \le 3rm - 3$, Assumption 5.1 does not hold anymore and rank-2 matrices other than those described in Proposition 4.1 are expected to belong to the matrix code. However, the attack is still supposed to work if the good matrices are sampled. Therefore, if $3m - 3 - n$ is a small natural number, the attack may still be practical, despite not having polynomial-time complexity anymore. Table 1 provides a couple of such examples.

## 6. CONCLUSIONS

In this paper, we analyzed in detail the matrix code of quadratic relationships, introduced in [CMT23], originated by a Goppa code. We described and categorized structured matrices with low rank, relating them to polynomial identities.

We extended the approach used in [CMT23] to break instances of binary Goppa codes of degree 2, thus solving two TII challenges in a matter of a few seconds. To this aim, we first studied the variety associated with the Pfaffian ideal, proving that
its dimension is at least 3. Then, from solutions of the Pfaffian system obtained by specializing 3 variables, we devised an efficient algorithm to reconstruct a GRS code that builds upon the strategy of [CMT23]. This demonstrates the effectiveness of the Pfaffian modeling not only for distinguishing purposes but also for mounting key-recovery attacks.

Finally, we introduced the notion of Goppa code representation for Goppa codes and provided a procedure to get one of them from a generic pair of support and multiplier.

## ACKNOWLEDGMENTS

The authors would like to thank Jean-Pierre Tillich and the anonymous reviewers for their careful reading of the manuscript and for their valuable comments and suggestions, which helped to reorganize the material and significantly improve its quality.

## REFERENCES

[ABC<sup>+</sup>22] Martin Albrecht, Daniel J. Bernstein, Tung Chou, Carlos Cid, Jan Gilcher, Tanja Lange, Varun Maram, Ingo von Maurich, Rafael Mizoczki, Ruben Niederhagen, Edoardo Persichetti, Kenneth Paterson, Christiane Peters, Peter Schwabe, Nicolas Sendrier, Jakub Szefer, Cen Jung Tjhai, Martin Tomlinson, and Wang Wen. Classic McEliece (merger of Classic McEliece and NTS-KEM). https://classic.mceliece.org, November 2022. Fourth round finalist of the NIST post-quantum cryptography call.

[Ber10] Daniel J. Bernstein. Grover vs. McEliece. In Nicolas Sendrier, editor, *Post-Quantum Cryptography 2010*, volume 6061 of LNCS, pages 73–80. Springer, 2010.

[BJMM12] Anja Becker, Antoine Joux, Alexander May, and Alexander Meurer. Decoding random binary linear codes in $2^{n/20}$: How $1+1=0$ improves information set decoding. In *Advances in Cryptology - EUROCRYPT 2012*, LNCS. Springer, 2012.

[BM17] Leif Both and Alexander May. Optimizing BJMM with Nearest Neighbors: Full Decoding in $2^{2/21^n}$ and McEliece Security. In *WCC Workshop on Coding and Cryptography*, September 2017.

[BMT23] Magali Bardet, Rocco Mora, and Jean-Pierre Tillich. Polynomial time key-recovery attack on high rate random alternant codes. CoRR, abs/2304.14757, 2023.

[CC98] Anne Canteaut and Florent Chabaud. A new algorithm for finding minimum-weight words in a linear code: Application to McEliece's cryptosystem and to narrow-sense BCH codes of length 511. *IEEE Trans. Inform. Theory*, 44(1):367–378, 1998.

[CFS01] Nicolas Courtois, Matthieu Finiasz, and Nicolas Sendrier. How to achieve a McEliece-based digital signature scheme. In *Advances in Cryptology - ASIACRYPT 2001*, volume 2248 of LNCS, pages 157–174, Gold Coast, Australia, 2001. Springer.

[CMT23] Alain Couvreur, Rocco Mora, and Jean-Pierre Tillich. A new approach based on quadratic forms to attack the McEliece cryptosystem. In *International Conference on the Theory and Application of Cryptology and Information Security*, pages 3–38. Springer, 2023.

[Dum89] Il'ya Dumer. Two decoding algorithms for linear codes. *Probl. Inf. Transm.*, 25(1):17–23, 1989.

[Dür87] Arne Dür. The automorphism groups of Reed-Solomon codes. *Journal of Combinatorial Theory, Series A*, 44:69–82, 1987.

[FGO<sup>+</sup>11] Jean-Charles Faugère, Valérie Gauthier, Ayoub Otmani, Ludovic Perret, and Jean-Pierre Tillich. A distinguisher for high rate McEliece cryptosystems. In *Proc. IEEE Inf. Theory Workshop- ITW 2011*, pages 282–286, Paraty, Brasil, October 2011.

[GK04] Sudhir R Ghorpade and Christian Krattenthaler. The Hilbert series of Pfaffian rings. In *Algebra, Arithmetic and Geometry with Applications: Papers from Shreeram S. Abhyankar's 70th Birthday Conference*, pages 337–356. Springer, 2004.
[KT17] Ghazal Kachigar and Jean-Pierre Tillich. Quantum information set decoding algorithms. In *Post-Quantum Cryptography 2017*, volume 10346 of LNCS, pages 69–89, Utrecht, The Netherlands, June 2017. Springer.

[LS01] Pierre Loidreau and Nicolas Sendrier. Weak keys in the McEliece public-key cryptosystem. *IEEE Trans. Inform. Theory*, 47(3):1207–1211, 2001.

[McE78] Robert J. McEliece. *A Public-Key System Based on Algebraic Coding Theory*, pages 114–116. Jet Propulsion Lab, 1978. DSN Progress Report 44.

[MMT11] Alexander May, Alexander Meurer, and Enrico Thomae. Decoding random linear codes in $O(2^{0.054n})$. In Dong Hoon Lee and Xiaoyun Wang, editors, *Advances in Cryptology - ASIACRYPT 2011*, volume 7073 of LNCS, pages 107–124. Springer, 2011.

[MO15] Alexander May and Ilya Ozerov. On computing nearest neighbors with applications to decoding of binary linear codes. In E. Oswald and M. Fischlin, editors, *Advances in Cryptology - EUROCRYPT 2015*, volume 9056 of LNCS, pages 203–228. Springer, 2015.

[Mor23] Rocco Mora. *Algebraic techniques for decoding Reed-Solomon codes and cryptanalyzing McEliece-like cryptosystems*. PhD thesis, Sorbonne Université, 2023.

[MP12] Irene Márquez-Corbella and Ruud Pellikaan. Error-correcting pairs for a public-key cryptosystem. CBC 2012, Code-based Cryptography Workshop, 2012. Available on http://www.win.tue.nl/~ruudp/paper/59.pdf.

[MS86] Florence J. MacWilliams and Neil J. A. Sloane. *The Theory of Error-Correcting Codes*. North-Holland, Amsterdam, fifth edition, 1986.

[MT23] Rocco Mora and Jean-Pierre Tillich. On the dimension and structure of the square of the dual of a goppa code. *Designs, Codes and Cryptography*, 91(4):1351–1372, 2023.

[Pat75] N. Patterson. The algebraic decoding of Goppa codes. *IEEE Trans. Inform. Theory*, 21(2):203–207, 1975.

[Pra62] Eugene Prange. The use of information sets in decoding cyclic codes. *IRE Transactions on Information Theory*, 8(5):5–9, 1962.

[Ran15] Hugues Randriambololona. On products and powers of linear codes under componentwise multiplication. In *Algorithmic arithmetic, geometry, and coding theory*, volume 637 of Contemp. Math., pages 3–78. Amer. Math. Soc., Providence, RI, 2015.

[RSA78] Ronald L. Rivest, Adi Shamir, and Leonard M. Adleman. A method for obtaining digital signatures and public-key cryptosystems. *Commun. ACM*, 21(2):120–126, 1978.

[Sen00] Nicolas Sendrier. Finding the permutation between equivalent linear codes: The support splitting algorithm. *IEEE Trans. Inform. Theory*, 46(4):1193–1203, 2000.

[Sen10] Nicolas Sendrier. On the use of structured codes in code based cryptography. In L. Storme S. Nikova, B. Preneel, editor, *Coding Theory and Cryptography III*, pages 59–68. The Royal Flemish Academy of Belgium for Science and the Arts, 2010.

[Sho94] Peter W. Shor. Algorithms for quantum computation: Discrete logarithms and factoring. In S. Goldwasser, editor, *FOCS*, pages 124–134, 1994.

[SS92] Vladimir Michilovich Sidelnikov and S.O. Shestakov. On the insecurity of cryptosystems based on generalized Reed-Solomon codes. *Discrete Math. Appl.*, 1(4):439–444, 1992.

[Ste88] Jacques Stern. A method for finding codewords of small weight. In G. D. Cohen and J. Wolfmann, editors, *Coding Theory and Applications*, volume 388 of LNCS, pages 106–113. Springer, 1988.