Manuscript Offprint
arXiv:2609.31517A search-to-decision reduction for the linear code equivalence problem
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We present a polynomial-time reduction from the search variant of the linear code equivalence problem (i.e. the search for a linear isometry between the inputs) to its decisional variant. More precisely, given two linearly equivalent codes , we show how to recover a linear isometry between them by making a polynomial number of queries to an oracle for decisional linear code equivalence. First, we prove that search-Permutation Code Equivalence (search-PCE – the problem of finding a permutation mapping to ) reduces in polynomial time to PCE (i.e. the problem of deciding if there is a permutation map from to ) via at most oracle calls on instances of dimension and length at most . We then extend this approach to linearly equivalent codes: we recover the permutation part of a linear isometry via at most calls to a Linear Code Equivalence (LCE) oracle on instances of the same size, and we give a deterministic polynomial-time algorithm to recover the diagonal part once this permutation is known. Altogether, this yields a polynomial-time procedure to recover a linear isometry from an oracle for decisional LCE. From a linear-algebraic perspective, our results provide an explicit reconstruction of a monomial equivalence between two matrix representations from oracle access to the corresponding orbit membership problem.
1 Introduction
Given two linear codes and of length over a finite field , the Permutation Code Equivalence problem (PCE) consists in finding a permutation map such that . If we are given the image of a basis of via , this problem is computationally easy. On the other hand, if we only know an arbitrary basis of , then there is no known efficient algorithm for solving general instances of PCE. In most of the literature, PCE is phrased in its decisional variant: given and , decide whether there is such that . On the other hand, the search variant of PCE requires us to find such that . In the following, we call these two variants PCE and search-PCE. PCE can be generalized to general linear isometries between codes. The Linear Code Equivalence Problem (LCE) is the task of deciding if there is a linear isometry such that , while the most generic variant of the code equivalence
*Department of Mathematics and Statistics, University of South Florida, Tampa, FL 33620 USA. E-mail: {biasse,gmicheli,bprada,phillipwaitkevich}@usf.edu.
An extended abstract of this paper was presented at the 2023 IEEE ISIT conference.
problem consists in deciding if there is a field isomorphism and such that . In the rest of this paper, we focus on PCE and LCE. Interestingly, the available algorithms for the resolution of the most generic instances of the code equivalence problem actually do it by solving the search variant. From a linear-algebraic point of view, the problem is to reconstruct a monomial transformation between two matrix representations of equivalent codes; our arguments exploit repeated or proportional column structure and, in the linear case, the behavior of supports under row reduction. In particular, the code equivalence problem can be viewed as a matrix equivalence problem under the action of the monomial group, combining left multiplication by and right multiplication by permutation and diagonal matrices. Our reductions exploit structural properties of this action, such as the behavior of repeated or proportional columns and the invariance of row-reduced forms, to reconstruct a representative of the equivalence class. In this paper, we show that search-PCE can be efficiently solved by using an oracle to PCE, and that search-LCE can be efficiently solved by using an oracle to LCE.
The Code Equivalence problem in cryptography The code equivalence problem intersects cryptography based on error correcting codes (a.k.a “code-based cryptography”). In the McEliece cryptosystem [1], the private key is a code , and the public key is where is a secret permutation. Note that being able to solve PCE (or search-PCE) does not imply being able to break the McEliece cryptosystem because in this case, we are only given . If potential candidates for are given to us (for example in the context of a key exposure attack), then we can decide if any of them is the private key by solving PCE, but in general there are too many possible secret keys to efficiently reduce the cryptanalysis of McEliece to PCE (or search-PCE).
A Zero-Knowledge protocol due to Girault [2] first used PCE as a hardness assumption. This identification scheme both relies on the hardness of the binary syndrome decoding problem and of search-PCE. This scheme was later improved by Sendrier and Simos [3, Sec. 4.2]. Biasse, Micheli, Persichetti and Santini described the identification (and digital signature) scheme LESS [4] which uses search-PCE (or search-LCE) as its sole security assumption (through a rigorous security proof). From a high level perspective, the task of solving search-PCE (resp. search-LCE) (and thus breaking LESS) can be viewed as inverting the group action of (resp. ) on the set of linear codes equivalent to a given code . From this perspective, cryptography based on the hardness of search-PCE and search-LCE falls under the umbrella of “hard homogeneous spaces” described by Couveignes [5], and “Cryptographic Group Actions” (see [6]). Hence, many results applying to this family of schemes, including follow-up works from the isogeny-based scheme CSIDH [7], can be used to enhance code equivalence-based cryptosystems. This way, practical improvements to LESS were described in [8], as well as advanced signature functionalities (ring signatures, identity based signatures) enabled by the cryptographic group action framework [9].
Prior work on the resolution of the code equivalence problem In 1982, Leon [10] described an algorithm to solve search-PCE that relies on the following observation: since preserves the Hamming weight of a codeword, we can attempt to draw pairs by computing the sets of weight-w codewords in and and matching them when they have the same multisets of entries. With enough valid pairs, can be recovered. The complexity of Leon's algorithm is exponential, but this approach seems to offer the best performance in practice in the general case. Since the publication of cryptosystems based on the code equivalence problem, some follow-up works brought practical improvements to Leon's method [11, 12] to solve search-PCE and search-LCE without changing the overall complexity class.
Besides Leon’s algorithm and related works, algorithms exist to solve search-PCE efficiently for codes of small hull (the intersection of a code with its dual). For example, Sendrier’s Support Splitting Algorithm (SSA [13]) relies on the concept of a signature function that takes a code as input, and returns the same value for two equivalent codes. Sendrier’s signature function is based on the weight enumerator function whose calculation takes time where is the dimension of the hull. In the case of a hull of small dimension, this algorithm can be efficient, however, if a code is weakly self-dual, then the complexity is exponential. Note that SSA can be extended to the resolution of search-LCE by considering the closure of the input codes and applying SSA. However, when , the closure of a code is always weakly self-dual, which means that for the vast majority of instances of search-LCE, SSA has exponential complexity. The work of Bardet, Otmani, and Saheed-Taha [14] shows that when , an instance of search-PCE efficiently reduces to an instance of the Weighted Graph Isomorphism (WGI) problem. The resulting complexity is in , where denotes the cost of solving WGI in a graph of size , which can be done in quasi-polynomial time with Babai’s algorithm [15]. An algebraic approach was also investigated in [16] where the code equivalence problem was reduced to the resolution of a system of quadratic equations. With trivial hull, the system can be solved efficiently via the block linearization technique, but in the case of an arbitrary hull, the complexity appears to be exponential. The deterministic algorithm with the best asymptotic run time to solve PCE is due to Babai [17], and it runs in time . This work was generalized by Bennett et al. [18] who presented a -time deterministic algorithm for search-LCE, as well as randomized -time algorithms for search-PCE and search-LCE, and -time quantum algorithms for search-PCE and search-LCE.
In terms of complexity theory, it is worth noting that code equivalence is unlikely to be NP-complete. More specifically, Petrank and Roth showed in [19] that if code equivalence were NP-complete, then the polynomial hierarchy would collapse at the first level, which is widely believed to be untrue. In the same paper, they showed that the Graph Isomorphism (GI) problem efficiently reduced to PCE. Until Babai's groundbreaking work on GI [15], this was often used to justify the alleged hardness of PCE. However, this is no longer relevant to gauge the computational hardness of PCE (except in the very special case of h = 0, an efficient solution to GI does not seem to imply an efficient solution to PCE).
Finally, it is worth noting that generalizations of the code equivalence problem to rank metric codes have recently received some attention. Recent work proposed optimized methods for the resolution of the code equivalence problem in rank metric codes [20, 21], and Chou et al. suggested the use of this problem as the hardness assumption for a new identification scheme [22].
Our contribution Despite these advances, all existing algorithms for search-PCE and search-LCE operate independently of any oracle for their decisional counterparts. A natural question – standard in complexity theory but largely unaddressed for code equivalence – is whether a solver for the decisional problem can be leveraged to solve the search problem. We answer this affirmatively.
First, we prove that search-PCE reduces to PCE with a polynomial number of oracle calls.
Theorem 1. There is a polynomial-time algorithm to solve search-PCE on input codes that uses at most calls to an oracle for PCE on input codes of dimension and length at most over .
Second, we prove that search-LCE reduces to LCE in the sense that one can recover the permutation part of a linear isometry with a polynomial number of oracle calls.
Theorem 2. There is a polynomial-time algorithm which, on input two linearly equivalent codes, recovers a permutation such that there exists with satisfying , using at most calls to an oracle for LCE on input codes of dimension and length at most over .
Finally, given such a permutation , we prove that the diagonal part v can be recovered deterministically in polynomial time. This yields a polynomial-time procedure to recover a full linear isometry from an oracle for LCE. The deterministic reconstruction of the diagonal part of a monomial transformation from linear-algebraic data is a key technical contribution of this work. While a standard approach based on solving linear systems is known, it is inherently heuristic in general. We replace it with a method based on row-reduced echelon forms and connectivity properties of column supports, yielding a fully deterministic procedure.
This paper is organized as follows. Section 2 introduces the necessary background and notation. Section 3 proves Theorem 1, namely the reduction from search-PCE to PCE. Section 4 proves the corresponding reduction for LCE at the level of the permutation part: given two linearly equivalent codes, it shows how to recover a permutation for which there exists such that maps one code to the other. Section 5 then addresses the recovery of the diagonal part. After recalling a folklore heuristic approach and a simpler projective-frame-based special case for context, we present a new deterministic polynomial-time method to recover from , thereby completing the reconstruction of a full linear isometry.
Relation to prior work. A preliminary version of this work appeared as an extended abstract in the proceedings of ISIT 2023 [23]. That version establishes the search-to-decision reduction for permutation code equivalence, corresponding to the results of Section 3 of the present paper. The current manuscript extends these results in several directions. In particular, we develop a reduction for linear code equivalence, which requires additional techniques to recover the diagonal part of the transformation once the permutation is known. This leads to the deterministic reconstruction method of Section 5, which has no analogue in the conference version.
Definition 1 (Permutation matrix). Let . The permutation matrix satisfying if and otherwise acts via a right multiplication by permuting columns according to . More specifically, if , and , then the column of index of is the column of index of .
Given the natural correspondence between permutations and their associated permutation matrices, we use the notation to denote the vector-matrix multiplication between the row vector and the permutation matrix , as well as to denote the image of by the permutation associated with . When is a permutation matrix, we say that . We also define the support of a permutation as the set of indexes where it does not act like the identity. With the above definition, two linear codes with generator matrices are permutationally equivalent if and only if there exist an invertible matrix and a permutation matrix such that .
Definition 2 (PCE). Let be codes. The Permutation Code Equivalence problem (PCE) is the task of deciding if there is such that . Equivalently, if are generator matrices for and , PCE is the task of deciding if there is an invertible matrix and a permutation matrix such that .
In many references, the permutation code equivalence problem is formulated in its decisional variant (like above). The search variant (denoted search-PCE) consists in finding the permutation such that , or equivalently finding such that . When and are generator matrices of permutationally equivalent codes, we denote this by . In the rest of the paper, we often say that such a realizes the equivalence between and . Note that such a is not in general unique. When the automorphism groups of the codes and are not trivial (i.e. there exist and such that ), the 's realizing the equivalence between and are a coset of the automorphism group of . Permutation equivalence can be extended to codes that are image of each other by a linear isometry. Two such codes are said to be linearly equivalent, and this property is denoted by .
Proposition 3. All linear isometries of can be uniquely identified by . The image of is given by
Hence, an isometry necessarily acts via a permutation of the columns, followed by the scaling of the entries by non-zero scalars. From a matrix point of view, a linear isometry acts on the columns of via right multiplication by the permutation matrix corresponding to , followed by the right multiplication by the diagonal matrix : APD. A matrix of the form PD is a monomial matrix.
Definition 3 (LCE). Let be -linear codes. The Linear Code Equivalence problem (LCE) is the task of deciding if there exists such that . Equivalently, if are generator matrices for and , LCE is the task of deciding if there is an invertible matrix , a permutation matrix , and a diagonal matrix such that .
As for permutation code equivalence, LCE is stated as the decisional variant of the linear code equivalence, while we denote by search-LCE the problem of finding such that , or equivalently, finding such that .
Definition 4 (Reduced row echelon form (RREF)). Let . We say that is in reduced row echelon form (RREF) if the following conditions hold:
-
every nonzero row of A has a leftmost nonzero entry equal to 1;
-
the leftmost nonzero entry of each nonzero row lies strictly to the right of the leftmost nonzero entry of the preceding nonzero row;
-
each column containing a leftmost nonzero entry of a row has zeros in all its other positions;
-
all zero rows, if any, occur below the nonzero rows.
The leftmost nonzero entry of a nonzero row is called a pivot, and its column is called a pivot column. Columns that are not pivot columns are called non-pivot columns. For a matrix A, we denote by the unique reduced row echelon form row-equivalent to A.
Proposition 4 (Uniqueness of the RREF with prescribed pivots). Let , and let be column indices. There is at most one matrix such that:
-
B is row-equivalent to A;
-
B is in reduced row echelon form;
-
the pivot columns of B are exactly .
In particular, is unique.
Proposition 5 (Polynomial-time computation of the RREF). Let , and suppose that the pivot columns of are known. Then can be computed in polynomial time by Gaussian elimination. More generally, given a candidate set of pivot columns, one can decide in polynomial time whether it is the pivot set of a reduced row echelon form row-equivalent to A, and if so compute that form.
3 Search to decision reduction for PCE
In this section, we present our efficient reduction from search-PCE to PCE. In a nutshell, it consists in iteratively searching for for where is a permutation matrix such that for the generator matrices spanning the two input codes. The main idea is to test whether by extending the generator matrix with repetitions of its -th column, and by extending the generator matrix with repetitions of its -th column. The PCE oracle returns a positive answer if , thus allowing us to compute the image of at . Further extensions of and calls to the PCE oracle allow us to find all images of the secret permutation. Note that we cannot simply compute the image of at all with independent calls to the oracle because there might exist multiple solutions to search-PCE that do not agree with each other at all indices.
We start with a lemma that allows us to assume a certain choice for the images of a solution at indices where has repeated columns. The idea is the following: if the columns are all identical, so will be the columns . Hence, a permutation equal to on inputs other than will also satisfy .
Lemma 6. Let and be matrices such that there exists an invertible matrix and a permutation matrix such that . Let be a set of indexes corresponding to columns of equal to the -th column of . Let .
Then, for every bijection between and , there exists a permutation matrix such that the permutation corresponding to restricted to is equal to , restricted to is equal to , and .
Proof. Simply observe that any permutation of columns of indexed by leads to an automorphism of because . Now choose a permutation matrix such that for all , , and for , . Such a has support . Choose as the composition of and . This means that for and in terms of matrices, . It follows directly that we have .
Thanks to Lemma 6, if we know that , and if the columns are all identical, then there are solutions satisfying for some and for .
Next, we show how to compute the image of one element of via by using the oracle. Without loss of generality, we assume that we need to compute the image of 1. This means that, given , we want to decide whether there is a permutation matrix such that for some and . Let be the maximum number of times a column in a matrix is repeated. Clearly, since . Let be the columns of and be the columns of . Let us append to the columns equal to , thus constructing the matrix
and let us append to F the m columns equal to , thus constructing the matrix
Let us ask the oracle if the code generated by is permutationally equivalent to the code generated by .
Proposition 7. The answer from the PCE oracle on input determines if there is a P such that :
(i) If negative, then for any permutation matrix realizing the equivalence between and .
(ii) If positive, there are and a permutation matrix with and .
Proof. Item (i): If the answer is negative, then for any permutation matrix realizing the equivalence between and , as we now explain. Suppose the contrary, i.e. the answer is negative and there exists a realizing the equivalence between and such that . Then, set to be the permutation of that is equal to on and such that for all . Then we have
So there is at least one permutation map realizing the equivalence between and , and therefore the answer could not have been negative.
Item (ii): Suppose now that the answer is positive, then we have to prove that can be chosen such that . Let be the number of times the column is repeated in . Let be a permutation realizing the equivalence of and and an invertible matrix such that . Notice that there is only one column of repeated times, and only one column of repeated times. Hence, it must be that , where is the set indexes of columns of equal to the -th column. Using Lemma 6, this implies that can be chosen such that and for any . Moreover, we also have that for all . These arguments show that can be constructed to ensure that its restriction to belongs to (i.e. ) and satisfies . It follows immediately an equivalence between and given by since
so in particular .
Let us now show by induction on the number of indices for which we know an image how to do the general step. We assume that we found the set of indices whose images by a permutation realizing the equivalence between and are known. This means that we know that there exist and a permutation matrix such that and for all and . The reader should notice that it is important to carry over the information of the previous steps as we need to be able to extend the “same” permutation step by step (i.e., when we move to the next element in the domain, we need to avoid finding an image of another permutation – for example in the case in which the automorphism group of the code acts transitively, thus allowing any possible image for the index ). In the rest of this section, we show that by using the oracle, we can decide whether there exists a with for some such that for some and for all . Let again be the maximum number of times a column of (or ) is repeated. Let us define the sets and . Since we counted columns without repetitions, we must have . Append to : columns equal to , columns equal to , and eventually columns equal to , and denote the resulting matrix by . Analogously, append to : columns equal to , columns equal to , and eventually columns equal to , thus obtaining . Let be the number of columns of and .
Fact 1. The matrices and span equivalent codes.
Proof. Since there is such that , we know that and span equivalent codes. Indeed, for such a , we have , so we can extend to a permutation defined by for , and for to get .
Fact 2. There is a permutation matrix and an invertible matrix such that
satisfying for all .
Proof. Any permutation such that there is with , has the property that the associated invertible matrix satisfies for all . This is because the number of times the column is repeated is unique in the matrix for all for and the number of times the column is repeated is unique for the matrix , and equal to the number of times is repeated in . This means that , where is the set of indices such that the -th column of is equal to . Hence, by Lemma 6 applied to , there is a permutation satisfying for all and for an invertible matrix .
Now, let us take an element . Consider the column . If , then for some . Next, find a column of equal to with an index (such must exist, or otherwise columns are repeated a different number of times, which is not possible for equivalent generator matrices). Using Lemma 6, there exists realizing the equivalence between and with for and . Then, extend as .
Let us now suppose that . We append to a number of columns equal to , thus obtaining and to let us append columns equal to , obtaining . Now, we ask the oracle if the two codes generated by and are equivalent.
Proposition 8. The answer from the PCE oracle allows us to decide if there is a realizing the equivalence between and while agreeing with on and such that :
(i) If the answer is negative, then for any permutation matrix realizing the equivalence between and and agreeing with on all inputs from .
(ii) If the answer is positive, there are and a permutation matrix with , for and .
Proof. Item (i): If the answer is negative, then there cannot be a permutation matrix agreeing with on with as we now explain. Let be the total number of columns of . If could be extended to some with then we would have that
for such that by constructing as for all and for all . So the answer of the oracle could not have been negative.
Item (ii): If the answer is positive, then we have to prove that the partially identified permutation we have previously generated can be extended by setting . Since the answer is positive, the codes generated by and are equivalent. Let be a permutation that realizes the equivalence, i.e. for some . We are now going to derive from the permutation realizing the equivalence between and a permutation that realizes the equivalence between and (i.e. such that there exists with ) and such that (so that can be extended to on ). In other words, we are going to show that if one has constructed a set of correct images for a permutation realizing the equivalence, then there is a permutation realizing the equivalence between and that satisfies the following properties:
• it agrees with on ,
• it maps t to ,
• it maps to .
The restriction of such permutation to will provide an equivalence between and satisfying for all and therefore further extending on the larger set .
Since the column vectors and are repeated the same unique number of times in (resp. in ), we necessarily have . We know that maps indices of columns of equal to to indices of columns of equal to . In addition, using Lemma 6, we know that there are permutations that map these indices in any arbitrary order. In particular, we can assume that
•
- for (i.e. is in the block of the last indices).
• for any bijection
.
Moreover, such permutation maps to . Hence, its restriction to is a permutation realizing an equivalence between and . But we already observed in Fact 2 that such a could be assumed to agree on with realizing the equivalence between and , and satisfying for all . Therefore, by defining as the restriction of to , we proved that if the answer of the oracle is positive, there exists a permutation of the columns of that realizes the equivalence with and that can be chosen with the property for all .
To conclude the reduction from search-PCE to PCE, we simply iterate these steps until . This procedure is outlined in Algorithm 1. At the end, we have identified one of the potential permutation matrices realizing the equivalence between and . The corollary below gives the specific count of oracle calls performed during the course of this reduction, together with an upper bound on the input size.
Corollary 9. Algorithm 1 performs at most calls to an oracle to PCE with input codes of dimension and length at most over and eventually returns a permutation matrix such that there exists an invertible matrix with .
Require: Generator matrices of two codes such that there are and a permutation matrix with .
Ensure: A permutation matrix such that there is with .
1: maximum number of columns in that are equal to each other.
2: , , , , .
3: for do
4: if is not equal to an element of then
5: Let , and .
6: , .
7: for do
8: Append copies of at the end of .
9: Append copies of at the end of .
10: end for
11: for do
12: , .
13: Append copies of at the end of .
14: Append copies of at the end of .
15: if then
16: , , , , .
17: break
18: else
19: Let such that is equal to .
20: Find such that is equal to .
21: , , .
22: end if
23: end for
24: end if
25: end for
26: return
Algorithm 1: Search to decision reduction for PCE.
4 Search to decision reduction for LCE
Let be two codes. In this section, we show how to reduce the problem of finding such that there exists for some with to LCE.
Now let be generator matrices of two -linear codes that are linearly equivalent. They satisfy the relation for some invertible matrix , permutation matrix , and diagonal matrix with non-zero diagonal entries. We define the equivalence relation on by . By proportionality, we shall mean equivalence by .
We begin by introducing a property analogous to Lemma 6. Notice that if columns of G are mutually proportional, the columns will be as well. Thus, a permutation equal to P on inputs other than results in being proportional to G. Unlike previously, these columns are not guaranteed to be identical. However, due to proportionality, further rescaling of the columns is enough to cause them to match. This means that there exists a additional diagonal matrix identical to on all inputs other than such that .
Lemma 10. Let be generator matrices of two -linear codes such that there exist a non-singular , permutation matrix , and diagonal matrix satisfying . Let be a set of indices of proportional columns of . Let . Then for every bijection , there exists a permutation matrix such that restricted to is , restricted to is , and for some diagonal matrix .
Proof. Begin by fixing an arbitrary bijection . Let the permutation matrix be such that for all and for all . Note that . Now construct a diagonal matrix such that for columns of we have for all and for all . Note that the first restriction on is always satisfiable because the columns indexed by are proportional.
Notice now that since for all
and for all .
Now consider the diagonal matrix and permutation matrix . By definition of , we have that , , and , . Finally, we obtain
We have shown that any solution to may be converted to a new solution where bijectively maps, in any chosen way, the indices of one set of proportional columns of to the indices of the corresponding set of proportional columns of under the action of . Moreover, we have shown in the proof of Lemma 10 that could be constructed independently of . This suggests that when searching for a solution , we can find first, and then retrieve . As we shall show, our strategy allows us to first find a valid by use of an LCE oracle. We then use to compute .
We denote by the set of columns in a matrix that are proportional to a column vector , and the set of indices of all columns in that are proportional to a column vector . Before we state a key theorem, we need an important remark.
Remark 1. Let and be matrices over that generate linearly equivalent codes via the relation with for some diagonal matrix and permutation matrix . Let be a maximal set of indices of proportional columns in (i.e., if we added the index of another column of to , it would no longer be a set indices of proportional columns in ). Let . Then gets mapped to a maximal set of indices of proportional columns in such that . Furthermore, if is the only maximal set of indices of proportional columns in , and is the only maximal set of indices of proportional columns in , then it must be the case that .
Algorithm 2 shows how to compute a permutation matrix such that there are and a diagonal matrix with given access to an LCE oracle. The overall strategy is similar to that of Algorithm 1. The key difference is that instead of identifying sets of identical columns, we identify sets of columns that are proportional.
Require: Generator matrices of two codes such that there are and a monomial matrix with .
Ensure: A permutation matrix such that there are and a diagonal matrix with .
1: maximum number of columns in that are proportional to each other.
2: .
3: for do
4: if is not proportional to an element of then
5: Let , and .
6: , .
7: for do
8: Append hm copies of at the end of .
9: Append hm copies of at the end of .
10: end for
11: for do
12: , .
13: Append copies of at the end of .
14: Append copies of at the end of .
15: if then
16: .
17: break
18: end if
19: end for
20: else
21: Let such that is proportional to .
22: Find such that is proportional to .
23: .
24: end if
25: end for
26: return
Algorithm 2: Computing with an LCE oracle.
Theorem 11. Let and be matrices over that generate linearly equivalent codes via the relation with . Then, Algorithm 2 computes a permutation such that there is an invertible matrix and a diagonal matrix satisfying .
Proof. First iteration: We show how to compute the image of one element of via a that satisfies for some diagonal matrix by using a decisional oracle. Without loss of generality, we need to compute the image of 1. Let be the maximum number of columns in that are proportional to each other. Let . We want to test if there exist and satisfying and . Let be the columns of and let be the columns of . Create a new matrix by appending copies of to
G and create a new matrix by appending m copies of to F. We ask the LCE oracle if the codes generated by and are linearly equivalent.
-
If the oracle says "no", then there is no monomial matrix PD realizing the linear equivalence between the codes generated by G and F such that . Indeed, if there was such a linear equivalence between G and F, then one could extend this linear equivalence to a linear equivalence between and by creating an permutation matrix and diagonal matrix such that and for , and and for . But this equivalence between and should not exist according to the LCE oracle.
-
If the oracle says "yes", then let and be a permutation and diagonal matrix satisfying the linear equivalence between and , and let be an invertible matrix such that . Let , and . Because is the only maximal set of pairwise-proportional columns in and is the only maximal set of pairwise-proportional columns in , by Remark 1 we have that . Let be a permutation such that and for all . By Lemma 10 applied to and , there exist a permutation , a diagonal matrix , and an invertible matrix such that , , and . It follows that there is a linear equivalence given by , the permutation , and diagonal matrix . Hence, we have shown the existence a monomial matrix that defines a linear isometry between and such that .
iteration: Suppose by induction that we have established the existence of a monomial matrix where is diagonal and is a permutation matrix such that for , and that the images of elements in the set under the permutation are known. Let be the set of these elements. Let
That is, is the set of nonproportional columns in whose image under is known. Similarly define . Note that we need to consider the nonproportional columns to ensure that the number of repetitions per appended column is unique. Let . We now show how to find the image of via a new permutation such that for and such that there is an invertible matrix and a diagonal matrix satisfying for .
Case 1: Suppose that for some . Observe that is nonempty because belongs to this set. Therefore, there exists an such that . Indeed, by Remark 1, since and are maximal sets of proportional columns of (resp. ), we have . Hence, . Consider a permutation
such that and for all . We can apply Lemma 10 to , , to prove the existence of a permutation such that for all and such that , with for some diagonal matrix . Observe that in this case, one does not need to call an oracle for LCE.
Case 2: Suppose that is not proportional to any column in the set . Let . As before, let be the maximum number of columns in that are proportional to each other. Create a new matrix by appending to : copies of , copies of , , copies of , and copies of and similarly create a new matrix by appending to : copies of , copies of , , copies of , and copies of . Observe that we have appended columns to . Now, we ask the LCE oracle if the codes generated by and are linearly equivalent.
If the oracle says "no", then for any permutation matrix that defines a linear equivalence between and and that satisfies for all . If there were such a linear equivalence relation between and , i.e. for an invertible matrix , a permutation matrix and a diagonal matrix , then one could extend this linear equivalence to a linear equivalence between and by creating a permutation matrix (where is the number of columns of ) and an diagonal matrix such that and for , for all , and for all we have that for all . This contradicts the assumption that no linear equivalence relation exists between and .
If the oracle says "yes", then there exist an invertible matrix , a permutation matrix , and a diagonal matrix such that . Let such that there are an invertible and a diagonal matrix with and for which we know the images at the indices in . We want to show that can be extended to a such that and for an invertible matrix and a diagonal matrix . As in the case of the search to decision reduction for PCE, we need to argue that there is a defining the linear equivalence relation between and satisfying the following properties:
• it agrees with on ,
• it maps t to ,
• it maps to .
If such a exists, then its restriction to gives us , and the diagonal matrix satisfies the desired linear equivalence relation.
Observe that by construction of , for any , we have that , and that is unique (in the sense that no other maximal set of proportional columns in has size and no other maximal set of proportional columns in has size ). In particular, according to Remark 1, this means that we must have . By applying Lemma 10 to , , and defined below, we can assume that
•
- for (i.e. is in the block of the last indices).
• for any bijection
.
Moreover, such permutation maps to . Hence, its restriction to is a permutation satisfying for and . By induction, we know that can be assumed to agree on with . We define as the restriction of to . It defines a linear equivalence relation between and , and it satisfies for all . By induction, the statement hold for all iterations.
Corollary 12. Algorithm 2 performs at most calls to an LCE oracle with input codes of dimension and length at most over and eventually returns a permutation matrix such that there exists an invertible matrix and a diagonal matrix with .
5 Finding the diagonal entries
Let be two linear codes of length over such that there exists a linear isometry such that . Given , we show how to efficiently compute such that satisfies . Our main result in this section is Theorem 17, which gives a deterministic polynomial-time algorithm for recovering the diagonal part once the permutation is known. This task arises for example in algorithms for solving search-LCE that build on Leon's search-PCE problem [10]. Beullens [12, Sec. 4] adapted it to the case of search-LCE and used a backtracking method to recover the linear isometry from several pairs of the form where is a 2-dimensional subcode. Later, Barenghi, Biasse, Persichetti and Santini [11, Sec. 5.2] reformulated Beullen's approach into an explicit two-step process: first compute , then derive . The approach is given as follows: assume is a generator matrix for , and is a parity-check matrix for . Assume is a known permutation matrix and an unknown diagonal matrix such that corresponds to . They find the unknown coefficients of by noticing that the identity
induces linear equations between them. This approach is given from a very high level perspective in [11, Sec. 5.2] because it is considered folklore. However, to the best of our knowledge, its careful analysis does not appear anywhere in the literature, and it appears to be heuristic. We recall this method for completeness.
The purpose of this section is twofold. We first recall the standard approach, which formulates the recovery of the diagonal entries as a linear system derived from the identity . While this method is natural from a linear-algebraic perspective, it is in general only heuristic, as the resulting system may admit multiple solutions and does not guarantee nonzero diagonal entries. We then discuss a simpler deterministic strategy in the presence of a projective frame, where proportionality constraints uniquely determine the linear action. We provide some intuition for this approach. In a projective reconstruction, one typically relies on a column whose coordinates are all nonzero, allowing all scaling factors to be determined simultaneously. In the absence of such a frame, the proportionality constraints do not determine the linear action uniquely and may admit degenerate solutions. In contrast, our method does not require such a column. Instead, it exploits overlaps between the supports of multiple columns: each column induces relations between scaling factors on its support, and when these supports form a connected structure, these local constraints propagate across all coordinates. In this way, the diagonal entries can be recovered consistently without requiring a projective frame, by propagating local constraints through the support structure.
Crucially, one has to identify a solution for whose coefficients are non-zero. It is typically ensured when the system is overdetermined and has a unique solution. However, in general, we may only assume that it has rank . The diagonal matrices derived from the space of solutions have the shape where and where the are linear functions. Let
The task of finding a solution with non-zero coefficients reduces to the task of finding such that . If the degree of in a variable is greater than , we substitute by to reduce our task to the search for such that where is the reduction of modulo . In the absence of additional structural assumptions, this step is naturally viewed as heuristic. Empirically, for typical instances, a small number of random choices of suffices to obtain a nonzero evaluation.
A possible rigorous and deterministic way to derive the unknown diagonal coefficients would be to first search for such that where is a generator matrix for and is a generator matrix for (given found via the methods of Section 4). Hence, satisfies the collinearity constraints on the columns of and where . If the columns of (and hence of ) contain a projective frame, Lemma 13 shows that any non-zero solution for will be invertible (and hence lead to a solution for ). The search for can be linearized by turning each condition into homogeneous linear equations given by for each pair of indices . Solutions to the resulting linear system are exactly the matrices that satisfy for some diagonal matrix , and from Lemma 13, a non-zero solution must be invertible.
Lemma 13 (Projective agreement on a frame forces equality up to scalar). Let be nonzero vectors. Assume that among the projective points there exists a projective frame, i.e., there are indices such that are linearly independent and, when writing
all coefficients satisfy .
Suppose there exists and nonzero scalars such that
Let be any matrix satisfying the projective constraints
i.e., for each there exists with . Then either , or is invertible and there exists such that
Equivalently, the induced projective transformation (when defined) is unique and equals .
Proof. For each we have . Define . Then for all ,
In particular, for we have . Since are a basis, is diagonal in this basis: for any ,
Now apply this to with all : on one hand , and on the other hand
Comparing coefficients in the basis gives for all , hence for all (since ). Therefore is a scalar matrix.
If then and thus . Otherwise is invertible, hence is invertible and .
Remark 2 (Why the frame hypothesis is needed). If the set does not contain a projective frame, the conclusion can fail. For example, if the columns only represent the coordinate axes , then any diagonal matrix satisfies for all , without being a scalar multiple of the identity when the are not all equal.
To circumvent this restriction, we replace the projective frame requirement with a weaker, global condition based on the supports of the columns. Rather than relying on a single column, we exploit overlaps between the supports of multiple columns. Each column relates the scaling factors on the coordinates in its support, and when these supports form a connected structure, these local relations propagate across all coordinates. In this way, the diagonal entries can be recovered consistently without ever requiring a column with full support.
Lemma 14. Let be a full-rank matrix with and be a diagonal matrix. Then there exists such that .
Proof. Let be such that . Now consider the matrix such that for all where are the indices of the pivot columns of SA. Note that there are indeed pivot columns since has full rank. Notice then that
D'SAD is also in RREF because the pivot columns of SA remain unchanged after multiplying its columns by the elements of D and rows by the elements of . But then is a non-singular matrix such that has reduced row echelon form, and so by uniqueness. We conclude that .
Corollary 15. Let be a full-rank matrix with and be a diagonal matrix. Then and have 0's at the same indices.
Proof. Simply notice that, in the proof of Lemma 14, the diagonal elements of and are nonzero. Therefore, each element of differs from its corresponding element of only by multiplication by a non-zero scalar.
We can now construct an efficient algorithm for calculating a diagonal matrix D that, with our obtained permutation matrix P, composes the linear isometry between our two linear codes. We start by dealing with the special case where the non-pivot columns of have connected support. We formally define this property below:
Definition 5 (Connected supports). We say that column vectors have connected support if there is an ordering of such that if is the support of , we have
We call a connected ordering of the columns .
Lemma 16. Let be generator matrices of -linear codes where the non-pivot columns of have connected support, and such that there exist a non-singular matrix , and permutation matrix such that for some diagonal matrix . Given , and , Algorithm 3 computes such that in polynomial time.
Proof. First observe by Lemma 14 that
for some diagonal matrix .
The matrix has the property that for all , if is the -th column of , and is the -th column of , then (more specifically, ). Let be the support of (and hence since they have same support). Then for any vector we have
Require: Let be generator matrices of codes such that the non-pivot columns of have connected support, and a permutation matrix such that there are , and a diagonal matrix with .
Ensure: and a diagonal matrix with .
1: Compute with and .
2: a connected ordering of the non-pivot columns of .
3: , .
4: for do
5: -th column of . -th column of .
6: support of (and hence of ).
7: if then
8: .
9: else
10: Let . .
11: end if
12: for do
13: ,
14: end for
15: end for
16: Let be the columns of .
17: Let be the columns of .
18: .
19: for do
20: Let be an index satisfying .
21: .
22: end for
23: .
24: return
Algorithm 3: Computation of the diagonal coefficients (connected case).
Now, let us show the loop invariant of Steps 4-15. Let be the diagonal matrix that satisfies , and let . Then
At the beginning of the first iteration of the loop, . Hence , and at the end of the iteration, we have
Now assume that we enter an iteration, and that at the beginning of the loop, the invariant is satisfied. Let us show that the loop invariant is still satisfied at the end of the loop. In Step 5, there exists such that
For the index chosen in Step 10, we have (since we know that ). Note that we know that since has non-pivot columns of connected support. For , we have , hence:
Then we set to
Hence, if , at the end of the loop, we have
This resulting diagonal matrix is such the -th column of is proportional to the -th column of . Notice that the pivot columns remain proportional despite multiplication by . Then Steps 19-22 successfully recover a multiple of the actual for all . Indeed, (note that we have excluded zero columns by restricting ourselves to non-pivots of connected support).
We will now show that this multiple of is an acceptable diagonal matrix for the resolution of our instance of search-LCE. Notice that we now have . That is, , and so . But is a product of non-singular matrices, and is thus non-singular. Therefore, is such that , as desired.
The run time of the algorithm is polynomial in the size of the input.
In the case where the non-pivot columns of do not have a connected support the codes generated by G and F are decomposable i.e. they are permutationally equivalent to a direct sum
for some and indecomposable codes satisfying for all . Standard methods such as [24, Alg. 1] allow the computation of the corresponding permutation and irreducible components in polynomial time. This means that we get permutation matrices , invertible matrices , and generator matrices of the form
such that the , generate indecomposable codes (in particular: their information sets have connected support), and , . With the decisional LCE oracle, we can test which generate a code linearly equivalent to the code generated by an . Hence, after calls to the LCE oracle, we can assume that there exist invertible matrices , permutation matrices and diagonal matrices such that
Each can be recovered using Algorithm 2 while we get the from Algorithm 3. This means that we have
where S is invertible, P is a permutation matrix, and D is a diagonal matrix.
Require: Generator matrices of codes such that there are , a permutation matrix , and a diagonal matrix with .
Ensure: A permutation matrix , a diagonal matrix and such that .
1: Get permutation matrix and invertible matrix such that where the generate irreducible codes .
2: Get permutation matrix and invertible matrix such that where the generate irreducible codes .
3: for do
4: Test if .
5: end for
6: Rearrange to ensure that , .
7: for do
8: Use Algorithms 2 and 3 to find invertible matrices , permutation matrices , and diagonal matrices such that
9: end for
10: .
11: .
12:
13: return
Algorithm 4: Search to Decision reduction for LCE (general case).
Theorem 17. Let be generator matrices of -linear codes, and such that there exist a non-singular matrix , and permutation matrix such that for some diagonal matrix . Given , Algorithm 4 computes such that . in polynomial time.
Together with Corollary 12, Theorem 17 completes the polynomial-time search-to-decision reduction for LCE: given access to a decisional LCE oracle, one can recover a full linear isometry between any two linearly equivalent codes in polynomial time. This places search-LCE and decisional LCE in the same complexity class under polynomial-time reductions.
References
[1] R. McEliece, A public-key cryptosystem based on algebraic coding theory, DSN progress report 42 (44) (1978) 114–116.
[2] M. Girault, A (non-practical) three-pass identification protocol using coding theory, in: J. Seberry, J. Pieprzyk (Eds.), Advances in Cryptology — AUSCRYPT '90, Springer Berlin Heidelberg, Berlin, Heidelberg, 1990, pp. 265–272.
[3] N. Sendrier, D. Simos, The hardness of code equivalence over and its application to code-based cryptography, in: P. Gaborit (Ed.), Post-Quantum Cryptography, Springer Berlin Heidelberg, Berlin, Heidelberg, 2013, pp. 203–216.
[4] J. Biasse, G. Micheli, E. Persichetti, P. Santini, LESS is more: Code-based signatures without syndromes, in: A. Nitaj, A. Youssef (Eds.), Progress in Cryptology - AFRICACRYPT 2020 - 12th International Conference on Cryptology in Africa, Cairo, Egypt, July 20-22, 2020, Proceedings, Vol. 12174 of Lecture Notes in Computer Science, Springer, 2020, pp. 45–65. doi:10.1007/978-3-030-51938-4_3.
URL https://doi.org/10.1007/978-3-030-51938-4\_3
[5] J.-M. Couveignes, Hard homogeneous spaces, IACR Cryptol. ePrint Arch. (2006) 291. URL http://eprint.iacr.org/2006/291
[6] N. Alamati, L. D. Feo, H. Montgomery, S. Patranabis, Cryptographic group actions and applications, in: S. Moriai, H. Wang (Eds.), Advances in Cryptology - ASIACRYPT 2020 - 26th International Conference on the Theory and Application of Cryptology and Information Security, Daejeon, South Korea, December 7-11, 2020, Proceedings, Part II, Vol. 12492 of Lecture Notes in Computer Science, Springer, 2020, pp. 411–439. doi:10.1007/978-3-030-64834-3_14.
URL https://doi.org/10.1007/978-3-030-64834-3\_14
[7] W. Castryck, T. Lange, C. Martindale, L. Panny, J. Renes, CSIDH: an efficient post-quantum commutative group action, in: T. Peyrin, S. Galbraith (Eds.), Advances in Cryptology - ASIACRYPT 2018 - 24th International Conference on the Theory and Application of Cryptology and Information Security, Brisbane, QLD, Australia, December 2-6, 2018, Proceedings, Part III, Vol. 11274 of Lecture Notes in Computer Science, Springer, 2018, pp. 395–427. doi:10.1007/978-3-030-03332-3_15.
URL https://doi.org/10.1007/978-3-030-03332-3\_15
[8] A. Barenghi, J. Biasse, E. Persichetti, P. Santini, LESS-FM: fine-tuning signatures from the code equivalence problem, in: J. H. Cheon, J. Tillich (Eds.), Post-Quantum Cryptography - 12th International Workshop, PQCrypto 2021, Daejeon, South Korea, July 20-22, 2021, Proceedings, Vol. 12841 of Lecture Notes in Computer Science, Springer, 2021, pp. 23–43. doi:10.1007/978-3-030-81293-5_2.
URL https://doi.org/10.1007/978-3-030-81293-5\_2
[9] A. Barenghi, J. Biasse, T. Ngo, E. Persichetti, P. Santini, Advanced signature functionalities from the code equivalence problem, Int. J. Comput. Math. Comput. Syst. Theory 7 (2) (2022) 112–128. doi:10.1080/23799927.2022.2048206. URL https://doi.org/10.1080/23799927.2022.2048206
[10] J. Leon, Computing automorphism groups of error-correcting codes, IEEE Transactions on Information Theory 28 (3) (1982) 496–511.
[11] A. Barenghi, J. Biasse, E. Persichetti, P. Santini, On the computational hardness of the code equivalence problem in cryptography, Advances in Mathematics of Communications 17 (1) (2022) 23–55.
[12] W. Beullens, Not enough LESS: an improved algorithm for solving code equivalence problems over , in: O. Dunkelman, M. J. Jr., C. O'Flynn (Eds.), Selected Areas in Cryptography - SAC 2020 - 27th International Conference, Halifax, NS, Canada (Virtual Event), October 21-23, 2020, Revised Selected Papers, Vol. 12804 of Lecture Notes in Computer Science, Springer, 2020, pp. 387–403. doi:10.1007/978-3-030-81652-0_15. URL https://doi.org/10.1007/978-3-030-81652-0\_15
[13] N. Sendrier, Finding the permutation between equivalent linear codes: The support splitting algorithm, IEEE Trans. Inf. Theory 46 (4) (2000) 1193–1203. doi:10.1109/18.850662. URL https://doi.org/10.1109/18.850662
[14] M. Bardet, A. Otmani, M. Saeed-Taha, Permutation code equivalence is not harder than graph isomorphism when hulls are trivial, in: IEEE International Symposium on Information Theory, ISIT 2019, Paris, France, July 7-12, 2019, IEEE, 2019, pp. 2464–2468. doi:10.1109/ISIT.2019.8849855.
URL https://doi.org/10.1109/ISIT.2019.8849855
[15] L. Babai, Graph isomorphism in quasipolynomial time [extended abstract], in: D. Wichs, Y. Mansour (Eds.), Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016, ACM, 2016, pp. 684–697. doi:10.1145/2897518.2897542.
URL https://doi.org/10.1145/2897518.2897542
[16] M. Saeed-Taha, Approche algeébrique sur l'équivalence des codes, Ph.D. thesis, Université de Rouen Normandie (2017).
[17] L. Babai, P. Codenotti, J. A. Grochow, Y. Qiao, Code equivalence and group isomorphism, in: D. Randall (Ed.), Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2011, San Francisco, California, USA, January 23-25, 2011, SIAM, 2011, pp. 1395–1408. doi:10.1137/1.9781611973082.107. URL https://doi.org/10.1137/1.9781611973082.107
[18] H. Bennett, D. Bhatia, J.-F. Biasse, M. Durisheti, L. LaBuff, V. P. Lavorante, P. Waitkevich, Asymptotic improvements to provable algorithms for the code equivalence problem, Cryptology ePrint Archive, Paper 2025/187 (2025). URL https://eprint.iacr.org/2025/187
[19] E. Petrank, R. Roth, Is code equivalence easy to decide?, IEEE Trans. Inf. Theory 43 (5) (1997) 1602–1604. doi:10.1109/18.623157. URL https://doi.org/10.1109/18.623157
[20] A. Couvreur, T. Debris-Alazard, P. Gaborit, On the hardness of code equivalence problems in rank metric (2020). doi:10.48550/ARXIV.2011.04611. URL https://arxiv.org/abs/2011.04611
[21] K. Reijnders, S. Samardjiska, M. Trimoska, Hardness estimates of the code equivalence problem in the rank metric, Cryptology ePrint Archive, Paper 2022/276, https://eprint.iacr.org/2022/276 (2022). URL https://eprint.iacr.org/2022/276
[22] T. Chou, R. Niederhagen, E. Persichetti, T. H. Randrianarisoa, K. Reijnders, S. Samardjiska, M. Trimoska, Take your MEDS: Digital signatures from matrix code equivalence, Cryptology ePrint Archive, Paper 2022/1559, https://eprint.iacr.org/2022/1559 (2022). URL https://eprint.iacr.org/2022/1559
[23] J.-F. Biasse, G. Micheli, A search-to-decision reduction for the permutation code equivalence problem, in: 2023 IEEE International Symposium on Information Theory (ISIT), 2023, pp. 602–607. doi:10.1109/ISIT54713.2023.10206940.
[24] J.-F. Biasse, A. V. Hostetler, A. Jaindungarwal, Code equivalence and automorphism problems for codes (2026). arXiv:2609.25483. URL https://arxiv.org/abs/2609.25483