arXiv:2610.03460cs.ITOct 2026

Manuscript Offprint

arXiv:2610.03460

Code distances of matrix rank-metric codes under Add-and-Remove transformations

Gianira N. Alfarano, Rakhi Pratihar, Adrien Vinçotte

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

For a matrix rank-metric code C and an integer i, the i-th subcode distance of C is the largest minimum rank distance of an i-dimensional subcode of C. We study how subcode distances change under the Add-and-Remove construction, in which a subcode of codimension ℓs\ell_s is kept and a space of dimension ℓa\ell_a is added; this construction is used, with Gabidulin codes, in the MIRANDA signature scheme. For arbitrary matrix codes, we give inequalities between the subcode distances of the original and of the new code, and we show that Delsarte duality interchanges ℓs\ell_s and ℓa\ell_a. For matrix Gabidulin codes, whose subcode distances are given by an explicit formula, we show that, if ℓs<max⁡{m,n}\ell_s < \max\{m, n\}, then within each block of indices (a−1)max⁡{m,n}+1,…,amax⁡{m,n}(a-1)\max\{m, n\} + 1, \ldots, a\max\{m, n\} not exceeding dim⁡Fq(Cs)\dim_{\mathbb{F}_q}(\mathcal{C}_s), all but the last ℓs\ell_s subcode distances are the same as for the Gabidulin code, and the remaining ones decrease by at most one; a small example shows that such a decrease can occur. We also express the minimum distance of the new code in terms of the rank distance between the added space and the common subcode. For MIRANDA, the lower bound on the minimum distance of the dual public code used by the known distinguisher when ℓs=0\ell_s = 0 is a special case of these results; for the proposed parameters, where ℓs>0\ell_s > 0, the same bound holds for a subcode of codimension ℓs\ell_s of the dual public code.

Keywords: rank-metric codes, code distances, Gabidulin codes, Add-and-Remove, code-based cryptography

1 Introduction

Rank-metric codes, introduced by Delsarte and Gabidulin [4, 5], are classical objects in coding theory, with applications to random network coding [17] and to code-based cryptography [6, 7, 11]; see also the surveys [1, 9]. A central challenge in rank-metric cryptography is designing public codes that hide an exploitable algebraic structure while preserving good distance properties. The Add-and-Remove construction of [3] produces such a code by keeping a large subcode of a structured code and adding a space that intersects the original code trivially;

G.N.A. is supported by the Agence Nationale de la Recherche through grant number ANR-24-CPJ1-0075-01. R.P. has been supported by the ANR-DFG through grant number ANR-22-CE92-0075. A.V. acknowledges the support of the DGA and the CreachLab.

it is the basis of the MIRANDA signature scheme [3]. It is then natural to ask how much of the structure of the original code is still visible in the new one.

The minimum distance alone does not answer this question. Finer invariants for rank-metric codes have been studied: generalized and relative generalized rank weights [14, 10], q-polymatroidal invariants [8], and invariants related to rank-metric equivalence [12]. Recently, Camps-Moreno, Gorla, and López introduced code distances, obtained by optimizing minimum distance over subcodes or supercodes of prescribed dimension [2]. In particular, the subcode distances αi\alpha_{i}, where αi\alpha_{i} is the largest minimum distance of an i-dimensional subcode, can distinguish some inequivalent MRD codes having the same parameters [2]. They are therefore natural candidates for detecting hidden structure.

In this paper we determine which subcode distances are necessarily preserved by the Add-and-Remove construction. Starting from a matrix code C\mathcal{C}, the construction keeps a subcode Cs≤C\mathcal{C}_s \leq \mathcal{C} of codimension ℓs\ell_s and adds a subspace A\mathcal{A} of dimension ℓa\ell_a with A∩C={0}\mathcal{A} \cap \mathcal{C} = \{0\}, yielding D=Cs⊕A\mathcal{D} = \mathcal{C}_s \oplus \mathcal{A}. In the version of MIRANDA based on Gabidulin codes, this is used to hide the extension-field structure of a Gabidulin code [3]. We use repeatedly the fact that C∩D=Cs\mathcal{C} \cap \mathcal{D} = \mathcal{C}_s, so that ℓs\ell_s and ℓa\ell_a are the codimensions of C∩D\mathcal{C} \cap \mathcal{D} in C\mathcal{C} and in D\mathcal{D}, respectively.

Our contributions are as follows.

General matrix codes. We give inequalities between the subcode distances of C\mathcal{C}, Cs\mathcal{C}_s and D\mathcal{D}, and we show that the dual code D⊥\mathcal{D}^\perp is obtained from the dual code C⊥\mathcal{C}^\perp by the same construction with ℓs\ell_s and ℓa\ell_a interchanged.

Matrix Gabidulin codes. Using the chain of Gabidulin subcodes, we compute all subcode distances of a Gabidulin code. For the Add-and-Remove code, the inequalities above then become equalities for most indices. More precisely, if ℓs<μ=max⁡{m,n}\ell_s < \mu = \max\{m, n\}, then for i≤dim⁡Fq(Cs)i \leq \dim_{\mathbb{F}_q}(\mathcal{C}_s) the value αi(D)\alpha_i(\mathcal{D}) can differ from αi(C)\alpha_i(\mathcal{C}) only if ii is one of the last ℓs\ell_s indices among (a−1)μ+1,…,aμ(a-1)\mu+1,\ldots,a\mu for some aa, and in that case it is smaller by at most one. For instance, if ℓs=1\ell_s = 1, then αi(D)=αi(C)\alpha_i(\mathcal{D}) = \alpha_i(\mathcal{C}) whenever μ∤i\mu \nmid i. A small example shows that the decrease by one does occur.

Minimum distance and the MRD property. The minimum distance d(D)=αdimD(D)\mathrm{d}(\mathcal{D}) = \alpha_{\mathrm{dim}} \mathcal{D}(\mathcal{D}) also depends on the position of A\mathcal{A} with respect to Cs\mathcal{C}_s. We express d(D)\mathrm{d}(\mathcal{D}) in terms of the rank distance between A\mathcal{A} and Cs\mathcal{C}_s and characterize when D\mathcal{D} is MRD. We also consider the case where Cs\mathcal{C}_s is the Gabidulin code of Fqμ\mathbb{F}_{q^\mu}-dimension one less; then all subcode distances αi(D)\alpha_i(\mathcal{D}) with i≤dim⁡Fq(Cs)i \leq \dim_{\mathbb{F}_q}(\mathcal{C}_s) attain the Singleton bound.

Application to MIRANDA. Rank-metric cryptosystems built from Gabidulin codes have a long history [6, 11], and their algebraic structure has also been the source of structural attacks [13]. In the special case ℓs=0\ell_s = 0, the lower bound on the minimum distance of the dual public code used in the distinguisher of [3] is a special case of our bounds. For the proposed parameter sets, where ℓs>0\ell_s > 0, the same bound holds for a subcode of codimension ℓs\ell_s of the dual public code, and we obtain similar bounds for the other subcode distances.

Several questions remain open: how often the decrease at the exceptional indices occurs, in particular for the MIRANDA parameters, what happens for MRD codes that are not Gabidulin codes, and whether subcode distances can be used in a polynomial-time distinguisher. The last question requires knowledge of the subcode distances of random matrix codes, which we leave for future work.