New binary and ternary LCD codes
Abstract
Producción Científica
Full text
1 New binary and ternary LCD codes Carlos Galindo, Olav Geil, Fernando Hernando and Diego Ruano Abstract LCD codes are linear codes with important cryptographic applications. Recently, a method has been presented to transform any linear code into an LCD code with the same parameters when it is supported on a finite field with cardinality larger than 3. Hence, the study of LCD codes is mainly open for binary and ternary fields. Subfieldsubcodes of J-affine variety codes are a generalization of BCH codes which have been successfully used for constructing good quantum codes. We describe binary and ternary LCD codes constructed as subfield-subcodes of J-affine variety codes and provide some new and good LCD codes coming from this construction. Index Terms LCD codes, complementary dual, subfield-subcodes, J-affine variety codes, toric codes. INTRODUCTION IT is well-known that the hull C∩C⊥of a linear code C, with (Euclidean) dual C⊥, does not vanish in general; but when this holds, the code Cis called a linear code with complementary dual (LCD). LCD codes were introduced by Massey [22] to provide an optimum linear coding solution for the twouser binary adder channel and prove the existence of asymptotically good LCD codes; previously he studied LCD cyclic codes (reversible codes) in [21]. The literature contains considerable information about the characterization and construction of this family of codes, being [28], [30], [27] some of the oldest references. Apart from applications in data storage, LCD codes are also useful for obtaining lattices [15] and in network coding [2], [29]. Interesting applications of LCD codes in cryptography have been recently discovered. They play a role in counter-measures to passive and active side-channel analyses on embedded cryptosystems. We remark that the implementation of cryptographic algorithms could suffer attacks (SCA or FIA) for extracting the secret key. SCA (side-channel attacks) consist of passively recording some leakage to retrieve the key and FIA (fault injection attacks) consist of actively perturbing the computation to alter the output. One of the main sources of interest in LCD codes comes from the fact that they provide linear complementary pairs of codes. A linear complementary pair of codes (C1, C2)consists of two codes in Fn qwith dimensions kand n−ksuch that C1+C2=Fn q. These pairs have been used in [3], [4] for protecting implementations of symmetric cryptosystems against SCA, with level of protection depending on the minimum distance of C⊥ 2, and FIA, with level of protection depending on the minimum distance of C1. The above mentioned applications have caused a huge interest in LCD codes and many papers on this topic appeared very recently. An important contribution is [6], where the authors prove that, for q > 3, q-ary LCD codes are as good as q-ary linear codes. That is, for every linear code over a field Fqwith more than 3 elements, one can construct an LCD code with the same parameters from that code. Accepted for publication in IEEE Transactions on Information Theory. by The Danish Council for Independent Research (Grant No. DFF–4002-00367), in part by the Spanish MINECO/FEDER (Grants No. MTM2015-65764-C3-2-P and MTM2015-69138-REDT), in part by University Jaume I (Grant No. P1-1B2015-02), and in part by RYC- 2016-20208 (AEI/FSE/UE). C. Galindo is with Instituto Universitario de Matem´ aticas y Aplicaciones de Castell´ on, and Departamento de Matem´ aticas, Jaume I University, Spain. e-mail: [email protected]. O. Geil is with the Department of Mathematical Sciences, Aalborg University, Denmark. e-mail: [email protected]. F. Hernando is with Instituto Universitario de Matem´ aticas y Aplicaciones de Castell´ on, and Departamento de Matem´ aticas, Jaume I University, Spain, and with the Department of Mathematical Sciences, Aalborg University, Denmark. e-mail: [email protected]. D. Ruano is with IMUVA (Mathematics Research Institute), University of Valladolid, Spain, and with the Department of Mathematical Sciences, Aalborg University, Denmark. email: [email protected].
2 With respect to binary and ternary LCD codes, the best LCD codes known to exist are reversible and are derived from BCH codes [16], [17], [23], [18]. As it is well-known, subfield-subcodes from codes over large fields can give rise to good codes over small fields. BCH codes are subfield-subcodes of Reed- Solomon codes and families of binary and ternary BCH LCD and cyclic LCD codes have been constructed in [17] and [18] for few lengths. Some good binary reversible codes of odd length n, for 5≤n≤257, are given in [23], where the authors determine all the parameters for 5≤n≤99. In this paper we consider LCD codes coming from subfield-subcodes of the so-called J-affine variety codes. These codes are images of evaluation maps from vector spaces of polynomials in several variables generated by suitable monomials. Our LCD codes may be regarded as a generalization of BCH codes, including extensions to the case of more variables, and allow us to reach a wider variety of lengths. Their metric structure and duality properties have been studied and successfully used to construct quantum stabilizer codes in previous works of the authors [10], [11], [12], [9], [8]. For the univariate case, binary subfield-subcodes of J-affine variety codes with odd length provide reversible codes, which essentially coincide with those in [23]; however, we are able to provide examples (see Example 1 in Section III) with lengths not covered in the literature and our codes are derived from generic results (Theorems 17 and 19) which can simplify some computations. Furthermore, with one variable, we obtain unknown ternary LCD codes having good parameters; several examples are also shown in Section III. Considering more than one variable, we get a much broader spectrum of lengths. Theorems 20 and 21, and Remark 22 provide a wide variety of new LCD codes with previously unknown lengths, having some of them good parameters. As a sample, in Section III we give several families of LCD codes which, according to [14], contain many optimal or best known linear codes. Moreover, we provide new LCD codes with a length that can be obtained with a BCH code (our univariate case) but with better parameters. Decoding procedures may be useful for the cryptographic applications of LCD codes. Decoding algorithms have been described for some families of codes considered in this paper [7], [20]. We believe that these algorithms may be adapted to all of them. I. LCD J-AFFINE VARIETY CODES In this section we consider J-affine variety codes. These linear codes were introduced in [12] and used for constructing quantum codes. We review some results concerning self-orthogonality that will allow us to characterize LCD codes in this family. Finally, we give parameters for some families of LCD J-affine variety codes. The LCD codes provided in this section are not new or they do not have the best known parameters, as we will remark later, however, they are instrumental for introducing the LCD codes in Section II which are new and good binary and ternary LCD codes. Along this paper, q=prwill be a positive power of a prime number p. Let m≥1be an integer and fix mintegers Nj>1such that Nj−1divides q−1for j= 1,2, . . . , m. Let R:= Fq[X1, X2, . . . , Xm] be the ring of polynomials in mvariables and with coefficients in the finite field Fq. Consider a subset J⊆ {1,2, . . . , m}and the ideal IJin Rgenerated by the binomials XNj j−Xjwhen j6∈ Jand by XNj−1 j−1otherwise. Set ZJ={P1, P2, . . . , PnJ}the zero-set of IJover Fq. Note that the jth coordinate, for j∈J, of the points in ZJis different from zero and nJ=Qj /∈JNjQj∈J(Nj−1). Furthermore, denote Tj=Nj−2when j∈Jand Tj=Nj−1otherwise; then define HJ={0,1, . . . , T1}×{0,1, . . . , T2}×···×{0,1, . . . , Tm} and, for any a= (a1, . . . , am)∈ HJ, set Xa=Xa1 1· · · Xam m. Consider the quotient ring RJ:= R/IJand the evaluation map evJ:RJ→FnJ qgiven by evJ(f)=(f(P1), f(P2), . . . , f(PnJ)) , where fdenotes both the equivalence class and any polynomial representing it. As is well-known, evJis a bijection, and in particular one has that {evJ(Xa)|a∈ HJ}constitutes a basis for the image.
3 Definition 1. Let ∆be a non-empty subset of HJ. The J-affine variety code given by ∆is the Fq-vector subspace EJ ∆of FnJ qgenerated by evJ(Xa),a∈∆. We denote by CJ ∆the (Euclidean) dual code of EJ ∆. Observe that the dimension of EJ ∆equals the cardinality of ∆, and consequently the dimension of CJ ∆is nJ−card(∆). Note that the univariate case contains the family of Reed-Solomon codes and for J={1,2, . . . , m}and Nj=qfor every j, one has a generalized toric code [25]. It is also clear that the J-affine variety code EJ ∆is LCD if and only if its dual code CJ ∆is LCD. The following result, which can be found in [12, Proposition 1], gives the metric structure of J-affine variety codes. Proposition 2. Let J⊆ {1,2, . . . , m}. Consider a,b∈ HJand let Xaand Xbbe two monomials representing elements in RJ. Then, the inner product evJ(Xa)·evJ(Xb)is different from 0if, and only if, the following two conditions are satisfied. •For every j∈J, it holds that aj+bj≡0 mod (Nj−1), (i.e., aj=Nj−1−bjwhen aj+bj>0 or aj=bj= 0). •For every j /∈J, it holds that –either aj+bj>0and aj+bj≡0 mod (Nj−1), (i.e., aj=Nj−1−bjif 0< aj, bj< Nj−1 or (aj, bj)∈ {(0, Nj−1),(Nj−1,0),(Nj−1, Nj−1)} otherwise), –or aj=bj= 0 and p6 | Nj. The following remark illustrates how to construct LCD J-affine variety codes. Remark 3. Proposition 2 allows us to obtain sets ∆which lead to LCD codes. Consider for instance the case q= 33,m= 2,J={1,2},N=N1=N2= 33, and look for a set ∆⊂ HJsuch that EJ ∆is an LCD code. From Proposition 2, we deduce that the points in HJcan be divided into two sets. The first set consists of what we will call symmetric points, and they are ((N−1)/2,(N−1)/2) = (13,13),(0,0), ((N−1)/2,0) = (13,0) and (0,(N−1)/2) = (0,13). For a symmetric point a, we have that evJ(Xa) is orthogonal to evJ(Xb)for all b∈ HJ\ {a}and evJ(Xa)·evJ(Xa)6= 0. Thus, suitable sets ∆can contain, or not contain, symmetric points. The rest of the points in HJare called asymmetric. In order to have an LCD code and when one desires ∆to contain an asymmetric point (a1, a2),a1, a2≤N−1, the point (N−1−a1, N −1−a2)(named reciprocal) must also be added to ∆, and vice versa. Notice that, here, N−1should be identified with zero. Indeed, one has that evJ(X(a1,a2))is not orthogonal to evJ(X(N−1−a1,N−1−a2))and they are both orthogonal to evJ(Xb)for every bdifferent from (a1, a2)and (N−1−a1, N −1−a2). So to get suitable sets ∆, we can consider any of the above given symmetric points and pairs as described, for instance one may have (7,16),(19,10) ∈∆. The procedure is a bit different when J={2}instead of J={1,2}. First we notice that in the case treated above the obtained dual code is also generated by the evaluation of monomials and, therefore, it is aJ-affine variety code. In this second case, assuming that we desire that (0,10) ∈∆, our code be LCD and the dual code be also J-affine variety code, again by Proposition 2, we must add to ∆the points (0,16),(26,16) and (26,10). The following result generalizes the above two cases and the terminology introduced herein to the general class of J-affine variety codes whose dual is again a J-affine variety code. Theorem 4. Let ∆be a subset of HJ. The J-affine variety code EJ ∆is LCD with its dual code also being J-affine variety if and only if ∆is a union of sets Racontaining aand those elements b∈ HJsuch that: •For every j6∈ J,bj=Nj−1−ajif 0< aj< Nj−1, and bj∈ {0, Nj−1}otherwise. •For every j∈J,bj=Nj−1−ajif 0< aj< Nj−1, and bjequals 0otherwise. Moreover bjmay also be equal to ajin the case when either ai= 0 or ai=Ni−1for some i /∈J. Any two distinct exponents band b0in Raare called reciprocal, and awill be named symmetric whenever card(Ra) = 1. Points that are not symmetric are called asymmetric.
4 Proof. Let a∈∆and b∈ Raand assume 0< aj< Nj−1for j /∈J, and 0≤aj< Nj−1for j∈J. By Proposition 2, evJ(Xa)is not orthogonal to evJ(Xb), and therefore both a,b∈∆to guarantee that EJ ∆is LCD. It is also clear that if ∆ = Ra, the (Euclidean) dual code CJ ∆is generated by the complement of ∆in HJ. Finally, when aj=Nj−1or aj= 0 for j6∈ J, for constructing an LCD code whose dual is generated by monomials, one should have in EJ ∆, and not in CJ ∆, those vectors evJ(Xb)which are not orthogonal to evJ(Xa). This proves the result. Remark 5. The cardinality of the sets Radescribed in Theorem 4 is a power of 2. It is 1or 2if no coordinate of aequals 0or Nj−1for some j6∈ J. When J6={1,2, . . . , m}and pdoes not divide Njfor j6∈ J, one can also get LCD J-affine variety codes by including in ∆subsets R0 aof Rawith cardinality a power of 2whose elements have the i-th coordinate equal to either 0or Ni−1for some indices iin the set {1,2, . . . , m}\Jand the corresponding evaluation vectors are not orthogonal. In this case, reasoning for ∆ = R0 a, the dual code is generated by the evaluation of the monomials in HJ\Raand polynomials which are linear combinations of monomials with exponents in Raand orthogonal to the evaluation of the monomials in R0 a. In generic cases, the dual space, contains a vector space with dimension nJ−card(R0 a)which proves that EJ ∆is an LCD code. When considering this type of codes, we only consider the elements in R0 aas reciprocal. As an easy example, setting p= 3,q= 33,m= 2,N1=N2= 14,J={2},a= (0,1) and ∆ = R0 a={(0,1),(0,12)}, it holds that EJ ∆is a LCD code of dimension 2. Notice that ∆ = Ra= {(0,1),(0,12),(13,12),(13,1)}gives another LCD code with dimension 4. Some of the codes presented in [5, Corollary 3.6] can be recovered by considering the univariate case of J-affine variety codes, with J={1}. The following result states parameters for LCD codes coming from the univariate case of J-affine variety codes. We note that our contribution in this article, for the univariate case, is not supplying LCD codes coming from Proposition 6, but LCD subfield-subcodes of J-affine variety codes that will be presented in Theorem 12. Proposition 6. Let Nbe a positive integer such that N−1divides q−1and set another positive integer δ, such that 1≤δ≤(N−1)/2if N−1is even and δ≤N/2−1otherwise. For J=∅and ∆ = {0,1, . . . , δ −1, N −δ, . . . , N −2, N −1}, it holds that the dual code CJ ∆of the J-affine variety code EJ ∆is LCD with parameters [N, N −2δ, 2δ]q. Furthermore, for J={1}and ∆ = {0,1, . . . , δ − 1, N −δ, . . . , N −2}, the codes EJ ∆and CJ ∆are LCD and MDS with parameters [N−1,2δ−1, N −2δ+ 1]qand [N−1, N −2δ, 2δ]q, respectively. Proof. We prove first the statement for the case when J={1}. It is clear that CJ ∆is the J-affine variety EJ ∆0code given by ∆0={δ, δ + 1, . . . , N −δ−1}. Now setting ∆00 ={0,1, . . . , N −2δ−1}, it holds that {evJ(Xa)|a∈∆0}={evJ(Xa)∗evJ(Xδ) : a∈∆00}, where ∗denotes the component-wise product. Since wt(evJ(Xδ)) = N−1, both codes have the same parameters. So the dimension is clear and the distance follows from the fact that a polynomial of degree N−1−2δhas at most N−1−2δzeroes. The parameters of EJ ∆follow from the fact that CJ ∆is MDS. The proof is analogous when J=∅, again CJ ∆is the J-affine variety EJ ∆0code given by ∆0= {δ, δ + 1, . . . , N −δ−1}, and let ∆00 ={0,1, . . . , N −2δ−1}. We have that {evJ(Xa)|a∈∆0}= {evJ(Xa)∗evJ(Xδ) : a∈∆00}. Since wt(evJ(Xδ)) = N−1(the first coordinate is equal to zero), the minimum distance of EJ ∆0is one unit less than the minimum distance of EJ ∆00 , which is equal to 2δ+ 1, and the result holds. Now, for the general case and using Theorem 4, we get a new family of LCD codes with a designed minimum distance. To prove it, we will need the following lemma which was stated in [9, Proposition 4.1].
5 Lemma 7. Consider the ring RJand fix a monomial ordering. Let f(X1, . . . , Xm)be a polynomial of minimum total degree representing an equivalence class in RJand let Xa=Xa1 1· · · Xam mbe the leading monomial of f. Then card {P∈ZJ|f(P)6= 0} ≥ δa, where δa:= m Y j=1 (Nj−j−aj), jbeing equal to 1if j∈Jand j= 0 otherwise. Proposition 8. Keep the notation as at the beginning of this section setting Nj>1,j= 1,2, . . . , m, such that Nj−1divides q−1. Let J={1,2, . . . , m}and fix αj< Tj/2if Tjis even and αj≤(Tj−1)/2 otherwise. Consider the subset of HJ,∆ = L1×L2× · · · × Lm, where Lj={Tj/2−αj, . . . , Tj/2, . . . , Tj/2 + αj} if Tjis even and Lj={(Tj−1)/2−αj,...,(Tj−1)/2 + αj}otherwise. Then, writing Aj= 2αj+ 1, the code CJ ∆is an LCD code with parameters "nJ, nJ− m Y j=1 Aj,≥min j∈J{Aj+ 1}#q . Proof. Theorem 4 proves that CJ ∆is LCD. Moreover, multiplying each generator of EJ ∆by evJ(1/Qj∈JXβj j) for suitable powers βj, one obtains a monomially equivalent code (see [19, Section 4]) EJ ∆0where the bottom left corner of the box ∆0is 0. The codes EJ ∆and EJ ∆0have the same dimension and distance and the same weight enumerators (see again [19]). Proposition 2 shows that the dual code CJ ∆0has the same minimum distance as the code EJ ∆00 , where ∆00 ={0, . . . , T1}×{0, . . . , T2}×···×{0, . . . , Tm}\ {0, T1, T1−1, . . . , T1−A1+ 1} × · · · × {0, Tm, Tm−1, . . . , Tm−A1+ 1}. Then, the result follows after applying Lemma 7. Notice that when Nj−1 = q−1,EJ ∆00 is a toric code and the result holds by [19, Theorem 3] or [24, Example 5.1]. Now, and up to the end of this section, for providing a unified treatment according to the different sets J, we make a shift for the exponent of the monomials defining our code. Such a set is HJ={1, 1+ 1, . . . , 1+T1}×{2, 2+ 1, . . . , 2+T2} × · · · × {m, m+ 1, . . . , m+Tm}. Identifying Tj+jwith 0, for j∈J, we obtain a bijection from HJto HJ. Note that HJand HJare two different sets of exponents satisfying that the equivalence classes of the corresponding monomials in RJare the same. Then, we consider the following set of monomials in R N(J, t) = Xb|j≤bj≤Nj−1,1≤j≤m, and m Y j=1 (bj+ 1 −j)< t, where j= 1 if j∈Jand it equals zero otherwise. The hyperbolic code Hyp(J, t)[26], [13] can be defined as the (Euclidean) dual of the code given by the vector subspace of FnJ qgenerated by the evaluation
6 by evJof the classes in RJof the monomials in N(J, t). By [9, Proposition 4.3], the minimum distance of Hyp(J, t)is larger than t−1. With the help of that code, we state the following result which will be useful. Proposition 9. With the notation as in the above paragraph and at the beginning of this section, set Nj>1, for j= 1,2, . . . , m, such that Nj−1divides q−1. Fix a positive integer such that t≤nJ= Qj /∈JNjQj∈J(Nj−1), assume that p|Njfor all j6∈ Jand consider the set ∆(J, t) = N(J, t)∪N(J, t)r, where N(J, t)ris the set of reciprocal elements (defined as in Theorem 4 or in Remark 5) of those in N(J, t), where we notice that for j∈J,Nj−1must be identified with 0. Then, the (Euclidean) dual CJ ∆(J,t) of the J-affine variety code EJ ∆(J,t)is a J-affine LCD code with parameters [nJ, nJ−card (∆(J, t)) ,≥t]q. Proof. The construction of the code containing elements and reciprocal proves that we obtain an LCD code. The bound on the distance is also clear because we consider a code contained in the code Hyp(J, t) whose distance is larger than t−1. We are not directly interested in the LCD codes given by the above results because of the recent paper [6] that shows the existence of LCD codes for q > 3as good as linear codes. We will use them for obtaining suitable subfield-subcodes which will give rise to good binary and ternary LCD codes. II. LCD SUBFIELD-SUBCODES OF J-AFFINE VARIETY CODES Keep the notation as in Section I. For j∈J, let ZTj=Z/hNj−1iwhere we represent its classes by {0,1, . . . , Tj}. For j6∈ J, we represent the classes of Z/hNj−1iby {1,2, . . . , Tj}and define ZTj= {0} ∪ Z/hNj−1i, where we represent its classes by {0,1, . . . , Tj}. A subset Iof the Cartesian product ZT1×ZT2×· · ·×ZTmis called a cyclotomic set with respect to pif p·x∈Ifor any x= (x1, x2, . . . , xm)∈ I, where p·x= (px1, px2, . . . , pxm).Iis said to be minimal (with respect to p) whenever it contains all the elements that can be expressed as pi·xfor some fixed element x∈Iand some nonnegative integer i. Within each minimal cyclotomic set I, we pick a representative a= (a1, a2, . . . , am)given by nonnegative integers such that a1is the minimum of the first coordinates of the nonnegative representatives of the elements in I,a2is the minimum of the second coordinates of those elements in Ihaving a1as a first coordinate and the remaining coordinates, a3, . . . , amare defined in the same way. We will denote by Iathe cyclotomic set Iwith representative aand by Athe set of representatives of the minimal cyclotomic sets. Thus, the set of minimal cyclotomic sets will be {Ia}a∈A. In addition, we will denote ia:= card(Ia). Note that one can consider the cyclotomic sets with respect to an intermediate power ps, such that sdivides r, however, since we only want to consider the case when pequals 2 and 3, we set s= 1. Consider aand let bbe a reciprocal of a. Abusing the notation, let Ibbe the cyclotomic set that contains b. Taking into account the ring structure behind the two different sets ZTj, one gets the following straightforward result. Lemma 10. Let a∈ A and let bbe a reciprocal element. Then for every element in Iathere is a unique reciprocal element in Iband both cyclotomic sets have the same cardinality. In addition, if ais asymmetric, then Ia∩Ib=∅. With the above notation, we say that a cyclotomic set Iais symmetric if Ia=Ibfor all reciprocal element b. Otherwise we will say that it is asymmetric. In addition, we define a partition of Aas follows A=A1∪ A2(A1∩ A2=∅), where A1consists of the representatives of the symmetric cyclotomic sets and, for the asymmetric sets Ia6=Ia0, where aand a0are reciprocal elements, we consider ain A1if a<a0for the lexicographical ordering. The subfield-subcode of a J-affine variety code EJ ∆over Fq=Fpris defined as EJ,σ ∆:= E∆∩FnJ p. Consider the following maps tr : Fq→Fp,tr(x) = x+xp+· · · +xpr−1;tr :FnJ q→FnJ pgiven componentwise by tr(x), and T:RJ→ RJdefined by T(f) = f+fp+· · · +fpr−1. We say that a class f∈RJevaluates to Fpwhenever f(a)∈Fpfor all a∈ZJ. In [10, Proposition 5] it is proved that f
7 evaluates to Fpif and only if f=T(g)for some g∈ RJ. Now, considering for each a∈ A, the close to Tmap, Ta:RJ→ RJ,Ta(f) = f+fp+· · · +fp(ia−1) , we get the following result about the dimension of the code EJ,σ ∆. The proof is analogous to that in [10, Theorem 4]. Theorem 11. Let ∆be a subset of HJand set ξaa primitive element of the field Fpia. Then, a basis of the vector space EJ,σ ∆is given by the images under the map evJof the set of classes in RJ [ a∈A|Ia⊆∆ {Ta(ξs aXa)|0≤s≤ia−1}. A. Binary and ternary LCD subfield-subcodes coming from the univariate case We devote this section to provide binary and ternary LCD codes obtained as subfield-subcodes of univariate J-affine variety codes. The reasoning in Proposition 6 and the above paragraphs in Section II support the proof. We assume that pequals 2 or 3. Proposition 12. Let Nbe a positive integer such that N−1divides q−1. Recall that q=prfor a positive integer r. With the above notation, write A1={a0= 0 < a1< a2<· · · < az}the first set in the above given partition of A. Let t∈ {1,2, . . . , z}, and set ∆=∆1∪∆2, where ∆1=Ia0∪Ia1∪ · · · ∪ Iat and ∆2is the union of the cyclotomic cosets with the reciprocal elements (as in Theorem 4) to those in ∆1. Then the dual code of EJ,σ ∆over Fpis LCD and has parameters: [N−1, N −1−card(∆),≥2at+1]p when J={1}, and [N, N −card(∆),≥2at+1]potherwise (J=∅). Proof. Theorem 4 and Lemma 10 prove that our code is LCD. Theorem 11 determines the dimension of our code since the set ∆only contains minimal cyclotomic sets. Finally, the same reasoning as in Proposition 6 and the fact that we are considering subfields-subcodes of J-affine variety codes given by the union of consecutive minimal cyclotomic cosets proves the bound for the minimum distance. Indeed, in this case the minimum distance of the dual of the subfield-subcode coincides with that of the subfield-subcode of the dual code which is not less than that of the dual code. Remark 13. Note that when J=∅and 3 = p6 | N, we may consider sets ∆1as above such that IN1−1 is not in ∆2(see Remark 5). In this case a reasoning close to the proof of Propositions 6 and 8 shows that one can obtain ternary codes with parameters [N, N −card(∆),≥2at+1 −1]3, where the dimension of the obtained code is one unit more than in Proposition 12 because ∆has one element less. For the sake of generality, we provide formulae for the dimension under certain assumptions. First, we need some lemmas regarding cyclotomic sets, that are simply cyclotomic cosets for the one-variable case. The first one is essentially [1, Lemma 8]. Lemma 14. Let N > 1be an integer such that N−1divides q−1and assume that pbr/2c< N −1≤pr−1. Then, for all 1≤a≤(N−1)pdr/2e/(pr−1), the cyclotomic sets Iahave cardinality r. Next we characterize symmetric cyclotomic sets. Recall that q=prand we are interested only in the cases p= 2 and p= 3. Lemma 15. Let N > 1be an integer such that N−1divides q−1, where p∈ {2,3}. Then, the cyclotomic set Ia, with a > 0, is symmetric if and only if a=N−1 pj+ 1, for some j∈ {0,1, . . . , r −1}such that pj+ 1 is a divisor of N−1.
8 Proof. It follows from the fact that Iais symmetric whenever there exists j∈ {0,1, . . . , r −1}such that a=N−1−apj, that is a= (N−1)/(pj+ 1). The following result gives sufficient conditions for asymmetry of cyclotomic sets when m= 1. Proposition 16. Keep the above notations, that is N > 1such that N−1divides q−1and p∈ {2,3}. Then: •If ris odd, there are no symmetric cyclotomic set, unless when p= 3 and 2divides N−1. In this case, the unique symmetric cyclotomic set is I(N−1)/2. •Otherwise (for reven), one has that Iais asymmetric if a < (N−1)/(pr 2+ 1). Proof. For a start we consider the case when ris odd. First we assume that j= 0, then pj+1 = 2. When p= 2,q−1 = 2r−1 = 2(2r−1−1) + 1 and so N−1is odd, therefore pj+ 1 does not divide N−1and there is no symmetric cyclotomic set by Lemma 15. In case p= 3, if N−1is even, then pj+ 1 divides N−1and we have a cyclotomic symmetric set by Lemma 15. Suppose now that j > 0, write r=kj +l,0≤l < j, and consider the Euclidean division between the polynomials Xr−1and Xj+ 1: Xr−1 = Xr−j−Xr−2j+Xr−3j− · · · + (−1)k−1Xl· Xj+ 1+ (−1)kXl−1. Specializing Xto the value p, we get that if jdoes not divide rthen pj+ 1 does not divide q−1. The same holds on the contrary, when l= 0, since rodd implies kodd and the remainder is not zero. Finally assume that ris even. The symmetric cyclotomic set with smallest representative is given by the largest divisor of the form pj+ 1 of N−1, for j∈ {0,1, . . . , r −1}. The largest possible divisor is given by j=r/2, hence the representative of a symmetric set is larger than or equal to (N−1)/(pr 2+ 1) and the result holds. We are now ready to explicitly determine all the parameters of some of the codes described in Proposition 12. We consider the first cyclotomic set I0, pairs of asymmetric cyclotomic sets and possibly, a symmetric cyclotomic and IN−1. Actually, our next two results hold for any prime p. Theorem 17. Keep the above notation where Nis a positive integer such that N−1divides q−1. Assume that pbr/2c< N −1≤pr−1, and consider the first set of representatives of cyclotomic sets A1={a0= 0 < a1< a2<· · · < az}in the above given partition of A. Let t∈ {1,2, . . . , z}be such that at≤(N−1)pdr/2e/(pr−1), and set ∆=∆1∪∆2, where ∆1=Ia0∪Ia1∪ · · · ∪ Iat and ∆2the union of the cyclotomic cosets with reciprocal elements to those in ∆1. Then, •If ris odd or if ris even and at6= (N−1)pr/2/(pr−1), the dual code of EJ,σ ∆, over Fp, is LCD and has parameters: [N−1, N −2tr −2,≥2at+1]pwhen J={1}, and [N, N −2tr −2,≥2at+1]p otherwise (J=∅). •If ris even and at= (N−1)pr/2/(pr−1), the dual code of EJ,σ ∆, over Fp, is LCD and has parameters: [N−1, N −(2t−1)r−2,≥2at+1]pwhen J={1}, and [N, N −(2t−1)r−2,≥2at+1]potherwise (J=∅). Proof. The bound for the minimum distance follows from Proposition 12. Next we give a proof for the dimension of the codes.
9 If ris odd or if ris even and at6= (N−1)pr/2/(pr−1), then, by Lemma 14, the cardinality of all cyclotomic sets considered to define ∆is r, excepting I0(and occasionally IN−1if J=∅); note that both sets have cardinality 1. Moreover, by Proposition 16, the cyclotomic sets Iaj,j6= 0, N −1, considered to define ∆are asymmetric, which concludes the proof. If ris even and at= (N−1)pr/2/(pr−1), then the cardinality of all cyclotomic sets considered to define ∆(with the exception of I0and possibly IN−1) is still rby Lemma 14. Furthermore, by Proposition 16, all the cyclotomic sets considered to define ∆are asymmetric but I0and possibly IN−1, and Iatwhich is symmetric. Therefore, the equality 2r(t−1) + r= (2t−1)rfinishes the proof. To conclude this subsection, we prove that using Lemma 9 in [1] one can avoid to consider representatives of cyclotomic sets, however in some cases, one will obtain codes with a smaller range of minimum distances. With our notation, Lemma 9 in [1] is the following result. Lemma 18. With the above notation, let Nbe a positive integer such that N−1|pr−1and suppose that pbr/2c< N −1≤pr−1. If x, y are distinct integers in the range 1≤x, y ≤min{b(N−1)pdr/2e/(pr− 1) −1c, N −2}which are not zero modulo p, then the cyclotomic cosets defined by xand yare different. The latter lemma determines an interval of integers where the corresponding cyclotomic sets are all different and allows us to prove the following result. Theorem 19. Let q=pr, where ris a positive integer and p∈ {2,3}. Let Nbe a positive integer such that N−1divides q−1and pbr/2c< N −1≤pr−1. Then, for each integer δsuch that 2≤δ≤min{b(N−1)pdr/2e/(pr−1)c, N −2}, there exist two LCD codes with length N−1and N, respectively, designed minimum distance ≥2δand dimension k=N−2(rd(δ−1)(1 −1/p)e)−2. Proof. We are considering sets ∆as above where tis the largest integer such that at< δ ≤at+1. Notice that the conditions in our statement also fulfil the conditions in Lemma 14, and therefore all the cyclotomic sets (with the exception of I0and possibly IN−1) have cardinality r. Moreover, since 2≤δ≤min{b(N−1)pdr/2e/(pr−1)c, N −2}, the representatives of the cyclotomic sets we use satisfy 1≤a≤min{b(N−1)pdr/2e/(pr−1) −1c, N −2}. Under this condition, Proposition 16 states that we have no symmetric cyclotomic set (excepting I0). Finally, Lemma 18 guarantees that, in order to compute the dimension of our codes, we only have to count how many integers, in the range of the statement, are not congruent with zero module p. The result holds since there are exactly rd(δ−1)(1 −1/p)esuch integers. By Remark 13, when 3 = p6 | Nand J=∅, the hypotheses in Theorems 17 and 19 allow us to construct codes of length Nof dimension one more and minimum distance one less than those given in the mentioned results. B. Binary and ternary LCD subfield-subcodes coming from the multivariate case In this section we state two results providing LCD codes which are not reversible codes. They are obtained as dual codes of subfield-subcodes of J-affine variety codes and reach lengths that are not achievable with BCH codes. Our first result considers subfield-subcodes of J-affine variety codes given by the union of cyclotomic sets whose representatives are in the box defined in Proposition 8 and the second one is similar but taking representatives in the set ∆(J, t)defined in Proposition 9. Using Lemma 10, they can be proved reasoning in a similar way as we did in Propositions 8 and 9. Our first result is the following. Theorem 20. Let Nj,1≤j≤m, be positive integers such that Nj−1divides q−1. Assume that J={1,2, . . . , m}and fix αj< Tj/2if Tjis even and αj≤(Tj−1)/2otherwise. Consider the subset of HJ,∆ = L1×L2× · · · × Lmwhere Lj={Tj/2−αj, . . . , Tj/2, . . . , Tj/2 + αj}if Tjis even and