Next Article in Journal
Quantum–Classical Optimization for Efficient Genomic Data Transmission
Previous Article in Journal
Scheduling Optimization of a Vehicle Power Battery Workshop Based on an Improved Multi-Objective Particle Swarm Optimization Method
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Two Families of Optimal Binary Linear Complementary Pairs of Codes

1
National Trusted Embedded Software Engineering Technology Research Center, East China Normal University, Shanghai 200062, China
2
Hubei Key Laboratory of Applied Mathematics, Hubei University, Wuhan 430062, China
3
College of Science, Nanjing University of Posts and Telecommunications, Nanjing 211100, China
4
The School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai 200240, China
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(17), 2791; https://doi.org/10.3390/math13172791
Submission received: 3 August 2025 / Revised: 29 August 2025 / Accepted: 29 August 2025 / Published: 30 August 2025

Abstract

The optimal security parameters for binary linear complementary pair (LCP) codes are open. Inspired by this, we study LCPs of codes. In this paper, we construct two families of optimal binary LCPs of codes.

1. Introduction

Let q be a prime power and let F q denote the finite field with q elements. A pair of linear codes ( C ,   D ) of length n over F q is called a linear complementary pair (LCP) [1] if their direct sum C D produces a full space F q n . ( C ,   D ) is an LCP of codes, which means that the two codes C ,   D have complementary dimensions and a trivial intersection. If the dimension of C is k, then ( C ,   D ) is called an [ n ,   k ] LCP of codes. In special cases, when ( C ,   C ) is an LCP of codes, C is called a linear complementary dual (LCD) code. In recent years, there has been a lot of research on LCD codes (see [2,3,4,5,6,7,8,9,10,11]), but there is relatively little research specifically focused on the LCPs of codes. The LCD and LCPs of codes have been used in the framework of direct sum masking and haves been proposed as countermeasures against side channel attacks (SCAs) and fault injection attacks (FIAs) ([12,13,14]). In this application, the minimum distance d ( C ) is used to measure protection against FIA, whereas the minimum distance d ( D ) of the dual of the second code is used to measure protection against SCA. The joint security against the two attacks is provided by min { d ( C ) ,   d ( D ) } , which is known as the security parameter of the LCP of codes. Note that in the case of an LCD code C , the security parameter is only d ( C ) .
Carlet et al. [15] proved that there is a monomial transformation (equivalence) σ on F q n such that ( C ,   σ ( C ) ) is LCP, where C is a nonbinary [ n ,   k ,   d ] linear code on F q . In this case, the security parameter is only d, where d = d ( C ) = d ( σ ( C ) ) . Therefore, the best security parameter problem for the nonbinary LCP of codes is settled. In addition, the same article showed that an [ n ,   k ,   d ] binary code can produce a binary LCP of codes ( C ,   D ) with d ( C ) = d ( D ) d 1 . Therefore, the best security parameter for binary LCPs of codes is open for further study. We set
d L C P ( n ,   k ) = max { min { d ( C ) ,   d ( D ) } : ( C ,   D ) i s a n [ n ,   k ] b i n a r y L C P } .
Let d L C P ( n ,   k ) represent the highest minimum distance among [ n ,   k ] binary LCD codes, and d L ( n ,   k ) represent the highest minimum distance among binary linear [ n ,   k ] codes; then,
d L C D ( n ,   k ) d L C P ( n ,   k ) d L ( n ,   k ) .
If the minimum distance of an [ n ,   k ] linear code is d L ( n ,   k ) , then we say the linear code is optimal. If the security parameter of an [ n ,   k ] LCP of codes ( C ,   D ) is d L ( n ,   k ) , then we say the LCP of codes ( C ,   D ) is optimal.
The results in [15] yielded that d L C D ( n ,   k ) d L ( n ,   k ) 1 . For n 18 or k 4 , the best security parameters of binary [ n ,   k ] LCPs of codes were determined in [16]. Moreover, the authors described a sufficient condition for d L C D ( n ,   k ) = d L ( n ,   k ) 1 and gave a conjecture of a necessary condition. An infinite family of optimal binary LCPs of codes were constructed from Solomon–Stiffler codes by G u ¨ neri [17]. Li et al. [18] solved an open problem proposed by Carlet et al. [15] and showed a conjecture proposed by Choi et al. [16]. Moreover, the authors also studied linear complementary pairs of codes in [19,20].
This paper is organized as follows. In Section 2, we give some notations and preliminaries. In Section 3, we study binary LCPs of codes and construct two families of optimal binary LCPs of codes. We conclude the paper in Section 4.

2. Preliminaries

Definition 1
(Walsh spectrum). If α F 2 k * , the Walsh transform of f ( x ) is defined as
W f ( α ) = x F 2 k ( 1 ) f ( x ) + Tr 2 2 k ( α x ) .
Lemma 1
([21]). Let Ω = { E i F 2 2 k : dim F 2 E i = k ,   E i E j = { 0 } } , then z E i and z E j if and only if z = 0 , where E i ,   E j Ω ,   i j , and z F 2 2 k .
Lemma 2.
For any k-dimensional subspace E of F 2 2 k ,
x E y F 2 ( 1 ) y ( a · x ) = 2 k + 1 , if a E , 2 k , if a E ,
where a { 0 } .
Lemma 3
([22]). For any positive integer k and arbitrary a F 2 k * , the Walsh spectrum of Tr 2 2 k ( a x 1 ) defined on F 2 k can take any value divisible by 4 in the range [ 2 k 2 + 1 + 1 ,   2 k 2 + 1 + 1 ] .
The following is the well-known Griesmer bound on the length of a linear code.
Lemma 4
(Griesmer bound). For any [ n ,   κ ,   d ] linear code over F 2 , we have
n i = 0 κ 1 d 2 i ,
where x denotes the smallest integer greater than or equal to x.
For any [ n ,   κ ,   d ] binary linear code, if n = i = 0 κ 1 d 2 i , then we say that this code meets the Griesmer bound. In general, a binary linear code is called optimal if there is no binary linear code with parameters [ n ,   κ + 1 ,   d ] [23]. We can easily verify that any linear code meeting the Griesmer bound is optimal. In this paper, we focus on optimizing the largest d for the binary linear code with a given length n and dimension κ .
For an [ n ,   κ ,   d ] binary linear code, we say that this code is distance-optimal if there is no [ n ,   κ ,   d + 1 ] linear code over F 2 . When the lengths and dimensions of linear codes are fixed, there are many references on finding the largest d—see [23,24,25,26], for instance—and in these references, the same notation “distance-optimal” has been mentioned. Any binary linear code [ n ,   κ ,   d ] is distance-optimal provided that
n < i = 0 κ 1 d + 1 2 i .

3. Two Families of Optimal Binary LCPs of Codes

Let k > 2 be any integer and Tr 2 2 2 k denote the trace function from F 2 2 k onto F 2 , Tr 2 2 k denote the trace function from F 2 k onto F 2 , and Tr 2 k 2 2 k denote the trace function from F 2 2 k onto F 2 k . Following the approach in [27], for any set D = { d 1 ,   d 2 ,   ,   d n } F 2 2 k * , we define a linear code of length n over F 2 by
C D = { ( Tr 2 2 2 k ( x d 1 ) ,   Tr 2 2 2 k ( x d 2 ) ,   ,   Tr 2 2 2 k ( x d n ) ) : x F 2 2 k } ,
and call D the defining set of C D .
In fact, Tr 2 2 2 k ( a x ) = a · x , where a = ( a 1 ,   a 2 ,   ,   a 2 k ) T and x = ( x 1 ,   x 2 ,   ,   x 2 k ) T in F 2 2 k , and the Euclidean inner product of a and x is defined by
a · x = i = 1 2 k a i x i .
Hence C D = { ( x · d 1 ,   x · d 2 ,   ,   x · d n ) : x F 2 2 k } = { x T G : x F 2 2 k } , where G is an 2 k × n matrix over F 2 constructed by the column vectors d 1 ,   d 2 ,   ,   d n , i.e., G = [ d 1 ,   d 2 ,   ,   d n ] .
In this paper, G is called a generalized generator matrix of a linear code C D of length n over F 2 .
Construction 1.
Let α be a primitive element of F 2 k , i.e., F 2 k * = α . Let F ( x ) be a one-to-one map from F 2 k to F 2 k , and F ( 0 ) = 0 . Let V 1 = { 1 ,   α ,   ,   α 2 k 2 } = F 2 k * , V 2 = { F ( 1 ) ,   F ( α ) ,   ,   F ( α 2 k 2 ) } = F 2 k * , and U = { u 1 ,   u 2 ,   ,   u t } be a t-subset of F 2 2 k F 2 k . For u i ,   u j U , u i V 1 u j V 1 ( i j ) . Define
D 1 = { x ,   u 1 x ,   u 2 x ,   ,   u t x : u i U ,   x V 1 } ,
D 2 = { y ,   u 1 x ,   u 2 x ,   ,   u t x : u i U ,   x V 1 ,   y V 2 } .
Using D 1 and D 2 as defining sets, we obtain binary linear codes C D 1 and C D 2 as
C D 1 = { ( Tr 2 2 2 k ( a d 1 ) ,   Tr 2 2 2 k ( a d 2 ) ,   ,   Tr 2 2 2 k ( a d n ) ) : a F 2 2 k ,   d i D 1 } ,
C D 2 = { ( Tr 2 2 2 k ( b d 1 ) ,   Tr 2 2 2 k ( b d 2 ) ,   ,   Tr 2 2 2 k ( b d n ) ) : b F 2 2 k ,   d i D 2 } .
Remark 1.
Let G 1 and G 2 be the generator matrices of C D 1 and C D 2 . It is clear that G 1 and G 2 in construction 1 can be transformed into each other through column transformation (rearranging column vectors). Hence C D 1 and C D 2 are always equivalent in Construction 1.
Theorem 1.
In Construction 1, the linear codes C D 1 and C D 2 are binary linear codes with parameters [ ( t + 1 ) ( 2 k 1 ) ,   2 k ] . Moreover, the weight distribution of C D 1 and C D 2 are given in Table 1.
Proof. 
It is clear that the binary linear codes C D 1 and C D 2 have length n = ( t + 1 ) ( 2 k 1 ) . The Hamming weight wt ( c a ) of a nonzero codeword c a = ( Tr 2 2 2 k ( a x ) ) x D 1 of C D 1 can be calculated as follows:
wt ( c a ) = { x D 1 : Tr 2 2 2 k ( a x ) 0 } = n 1 2 y F 2 x D 1 ( 1 ) y Tr 2 2 2 k ( a x ) = n 1 2 ( y F 2 x V 1 ( 1 ) y Tr 2 2 2 k ( a x ) + y F 2 i = 1 t x u i V 1 ( 1 ) y Tr 2 2 2 k ( a x ) ) = n 1 2 ( x V 1 y F 2 ( 1 ) y Tr 2 2 2 k ( a x ) + i = 1 t x u i V 1 y F 2 ( 1 ) y Tr 2 2 2 k ( a x ) ) = n 1 2 ( x V 1 y F 2 ( 1 ) y Tr 2 2 2 k ( a x ) + i = 1 t x u i V 1 y F 2 ( 1 ) y Tr 2 2 2 k ( a x ) ) = n 1 2 ( i = 0 t x E i y F 2 ( 1 ) y ( a · x ) 2 ( t + 1 ) ) ,
where E i can be viewed as a k-dimensional vector space over F 2 .
By Lemmas 1 and 2, we have
wt ( c a ) = t 2 k 1 , if a E i , ( t + 1 ) 2 k 1 , if a E i .
Since the Hamming weight of any nonzero codeword c a C D 1 is not equal to 0, then we get that the dimension of C D 1 is 2 k .
By similar arguments as C D 1 , we can obtain the weight distribution of C D 2 is same to C D 1 . This completes the proof of this theorem. □
Theorem 2.
If k + t > 2 k , then the linear codes C D 1 and C D 2 defined in Theorem 1 are distance-optimal with respect to the Griesmer bound.
Proof. 
By Lemma 4, we only need to prove that
n < i = 0 2 k 1 d + 1 2 i .
Note that
i = 0 2 k 1 d + 1 2 i = i = 0 2 k 1 t 2 k 1 + 1 2 i = i = 0 k 1 t 2 k 1 i + 1 2 i + i = k 2 k 1 t 2 k 1 + 1 2 i = t ( 2 k 1 ) + k + i = k 2 k 1 t 2 k 1 2 i + 1 2 i t ( 2 k 1 ) + k + i = k 2 k 1 t 2 k 1 2 i t ( 2 k 1 ) + k + i = k 2 k 1 t 2 k 1 i = t ( 2 k 1 ) + k + t ( 1 1 2 k ) = t ( 2 k 1 ) + k + t t 2 k t ( 2 k 1 ) + k + t 1 .
Then we get that
i = 0 2 k 1 d + 1 2 i t ( 2 k 1 ) + k + t 1 > ( t + 1 ) ( 2 k 1 ) = n
for k + t > 2 k . This completes the proof. □
Lemma 5.
The linear codes C D 1 and C D 2 defined in Theorem 1. Then ( C D 1 ,   C D 2 ) is LCP if and only if W f ( c ) 1 or 3 mod 4 , where f = Tr 2 2 k ( F ( x ) ) and c = Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 , a ,   b F 2 2 k * .
Proof. 
( C D 1 ,   C D 2 ) is an LCP of codes means that the two codes C D 1 ,   C D 2 have complementary dimensions, and they have a trivial intersection. By Theorem 1, it is clear that the dimension of C D 1 is equal to 2 k and the dimension of C D 2 is equal to n 2 k . Next, we just need to prove C D 1 C D 2 = { 0 } .
C D 1 C D 2 = { 0 } if and only if a F 2 2 k * ,   b F 2 2 k * , s.t. c a · c b = 1 , where c a = ( Tr 2 2 2 k ( a x ) ) x D 1 ,   c b = ( Tr 2 2 2 k ( b x ) ) x D 2 .
Define T 0 = { x F 2 k * : Tr 2 2 2 k ( a x ) = 1 and Tr 2 2 2 k ( b F ( x ) ) = 1 } ,   T i = { x F 2 k * : Tr 2 2 2 k ( a u i x ) = 1 and Tr 2 2 2 k ( b u i x ) = 1 } , where 1 i t .
Hence C D 1 C D 2 = { 0 } if and only if a F 2 2 k * ,   b F 2 2 k * s.t. i = 0 t T i is odd, so if i = 0 t T i is odd, then ( C D 1 ,   C D 2 ) is LCP.
T 0 = 1 4 y F 2 z F 2 x F 2 k * ( 1 ) y [ Tr 2 2 2 k ( a x ) 1 ] + z [ Tr 2 2 2 k ( b F ( x ) ) 1 ] = 1 4 [ 2 k + x F 2 k ( 1 ) Tr 2 2 2 k ( a x ) + Tr 2 2 2 k ( b F ( x ) ) ] = 1 4 [ 2 k + x F 2 k ( 1 ) Tr 2 2 k ( Tr 2 k 2 2 k ( a ) x ) + Tr 2 2 k ( Tr 2 k 2 2 k ( b ) F ( x ) ) ] = 1 4 [ 2 k + x F 2 k ( 1 ) Tr 2 2 k ( Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 x + F ( x ) ) ] = 1 4 [ 2 k + W f ( Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 ) ] , = 1 4 [ 2 k + W f ( c ) ] ,
where f = Tr 2 2 k ( F ( x ) ) and c = Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 .
T i = 1 4 y F 2 z F 2 x F 2 k * ( 1 ) y [ Tr 2 2 2 k ( a u i x ) 1 ] + z [ Tr 2 2 2 k ( b u i x ) 1 ] = 1 4 [ 2 k + 1 + x F 2 k * ( 1 ) Tr 2 2 2 k ( ( a + b ) u i x ) ] = 2 k 1 , if a = b , 2 k 2 , if a b .
When W f ( c ) 1 or 3 mod 4 , i = 0 t T i is odd, hence ( C D 1 ,   C D 2 ) is LCP. This completes the proof. □
Theorem 3.
The linear codes C D 1 and C D 2 are defined in Theorem 1. If k + t > 2 k and W f ( c ) 1 or 3 mod 4 , where f = Tr 2 2 k ( F ( x ) ) and c = Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 , a ,   b F 2 2 k * , then ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes.
Proof. 
By Theorem 6, d L C P ( n ,   2 k ) = d L ( n ,   2 k ) = t 2 k 1 . Combining Lemma 5, it is clear that ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes. □

3.1. A Family of Optimal Binary LCPs of Codes from x 1

Theorem 4.
The linear codes C D 1 and C D 2 defined in Theorem 1. Let F ( x ) be the inverse function x 1 of F 2 k . When k + t > 2 k , ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes.
Proof. 
By Lemmas 3, 5 and Theorem 6, it is clear that ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes. □
Example 1.
The linear codes C D 1 and C D 2 are defined in Theorem 4. Let F ( x ) be the inverse function x 1 of F 2 k . Let k = 3 ,   t = 6 . With the help of Magma, we obtain that C D 1 and C D 2 are [ 49 ,   6 ,   24 ] 2 linear codes with weight enumerator 1 + 49 z 24 + 14 z 28 and is distance-optimal with respect to the Griesmer bound. Note that C D 1 and C D 2 are equivalent. Moreover, d L C P ( 49 ,   6 ) = d L ( 49 ,   6 ) = 24 , and ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes.
Construction 2.
Let α be a primitive element of F 2 k , i.e., F 2 k * = α . Let F ( x ) be a one-to-one map from F 2 k to F 2 k , and F ( ω ) = 0 ,   ω 0 . Let V 1 = { 1 ,   α ,   ,   α 2 k 2 } , V 2 = { F ( 1 ) ,   F ( α ) ,   ,   F ( α 2 k 2 ) } , and U = { u 1 ,   u 2 ,   ,   u 2 k } be a 2 k -subset of F 2 2 k F 2 k . For u i ,   u j U , u i V 1 u j V 1 ( i j ) . Define
D 1 = { x ,   u 1 x ,   u 2 x ,   ,   u t x : u i U ,   x V 1 } { ω } ,  
D 2 = { y ,   u 1 x ,   u 2 x ,   ,   u t x : u i U ,   x V 1 ,   y V 2 } { 0 } .
Using D 1 and D 2 as defining sets, we obtain binary linear codes C D 1 and C D 2 as
C D 1 = { ( Tr 2 2 2 k ( a d 1 ) ,   Tr 2 2 2 k ( a d 2 ) ,   ,   Tr 2 2 2 k ( a d n ) ) : a F 2 2 k ,   d i D 1 } ,  
C D 2 = { ( Tr 2 2 2 k ( b d 1 ) ,   Tr 2 2 2 k ( b d 2 ) ,   ,   Tr 2 2 2 k ( b d n ) ) : b F 2 2 k ,   d i D 2 } .
Remark 2.
Let G 1 and G 2 be the generator matrices of C D 1 and C D 2 . It is clear that G 1 and G 2 in Construction 2 can be transformed into each other through column transformation (rearranging column vectors). Hence C D 1 and C D 2 are always equivalent in Construction 2.
Theorem 5.
In Construction 2, the linear codes C D 1 and C D 2 are binary linear codes with parameters [ 2 2 k 2 ,   2 k ] . Moreover, the weight distributions of C D 1 and C D 2 are given in Table 2.
Proof. 
It is clear that the binary linear codes C D 1 and C D 2 have lengths n = 2 2 k 2 . The Hamming weight wt ( c a ) of a nonzero codeword c a = ( Tr 2 2 2 k ( a x ) ) x D 1 of C D 1 can be calculated as follows:
wt ( c a ) = { x D 1 : Tr 2 2 2 k ( a x ) 0 } = n 1 2 y F 2 x D 1 ( 1 ) y Tr 2 2 2 k ( a x ) = n 1 2 ( y F 2 x V 1 ω ( 1 ) y Tr 2 2 2 k ( a x ) + y F 2 i = 1 2 k x u i V 1 ( 1 ) y Tr 2 2 2 k ( a x ) ) = n 1 2 ( y F 2 x F 2 k * ω ( 1 ) y Tr 2 2 k ( Tr 2 k 2 2 k ( a ) x ) + y F 2 i = 1 2 k x u i V 1 ( 1 ) y ( Tr 2 2 2 k ( a ) x ) ) = n 1 2 ( x F 2 k * ω y F 2 ( 1 ) y Tr 2 2 k ( Tr 2 k 2 2 k ( a ) x ) + i = 1 2 k x u i V 1 y F 2 ( 1 ) y ( Tr 2 2 2 k ( a ) x ) ) = n 1 2 ( 1 ( 1 ) Tr 2 2 2 k ( a ω ) + i = 0 2 k x E i y F 2 ( 1 ) y ( a · x ) 2 ( 2 k + 1 ) ) ,
where E i can be viewed as a k-dimensional vector space over F 2 .
By Lemma 2, we have
wt ( c a ) = 2 2 k 1 1 , if Tr 2 2 2 k ( a ω ) = 1 , 2 2 k 1 , if Tr 2 2 2 k ( a ω ) = 0 .
Since the Hamming weight of any nonzero codeword c a C D 1 is not equal to 0, then we get that the dimension of C D 1 is 2 k .
By similar arguments as for C D 1 , we can obtain that the minimum distance of C D 2 is same to C D 1 . This completes the proof of this theorem. □
Theorem 6.
The linear codes C D 1 and C D 2 defined in Theorem 5 are distance-optimal with respect to the Griesmer bound.
Proof. 
By Lemma 4, we only need to prove that
n < i = 0 2 k 1 d + 1 2 i .
Note that
i = 0 2 k 1 d + 1 2 i = i = 0 2 k 1 2 2 k 1 2 i = i = 0 2 k 1 2 2 k 1 i = 2 2 k 1 .
Then we get that
i = 0 2 k 1 d + 1 2 i > 2 2 k 2 = n .
This completes the proof. □
Lemma 6.
The linear codes C D 1 and C D 2 are defined in Theorem 5. Then ( C D 1 ,   C D 2 ) is LCP if and only if the following conditions holds:
  • W f ( c ) 0 or 2 mod 4 if Tr 2 2 2 k ( a ω ) = Tr 2 2 2 k ( b F ( ω ) ) = 1 ,
  • W f ( c ) 1 or 3 mod 4 if Tr 2 2 2 k ( a ω ) + Tr 2 2 2 k ( b F ( ω ) ) 1 ,
where f = Tr 2 2 k ( F ( x ) ) and c = Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 , a ,   b F 2 2 k * .
Proof. 
By Theorem 5, it is clear that the dimension of C D 1 is equal to 2 k and the dimension of C D 2 is equal to n 2 k . Next, we just need to prove C D 1 C D 2 = { 0 } .
Define T 0 = { x F 2 k * ω : Tr 2 2 2 k ( a x ) = 1 and Tr 2 2 2 k ( b F ( x ) ) = 1 } ,   T i = { x F 2 k * : Tr 2 2 2 k ( a u i x ) = 1 and Tr 2 2 2 k ( b u i x ) = 1 } , where 1 i t .
Since C D 1 C D 2 = { 0 } if and only if a F 2 2 k * ,   b F 2 2 k * s.t. i = 0 t T i is odd, so if i = 0 t T i is odd, then ( C D 1 ,   C D 2 ) is LCP.
T 0 = 1 4 y F 2 z F 2 x F 2 k * ω ( 1 ) y [ Tr 2 2 2 k ( a x ) 1 ] + z [ Tr 2 2 2 k ( b F ( x ) ) 1 ] = 1 4 [ 2 k 1 + ( 1 ) Tr 2 2 2 k ( a ω ) + ( 1 ) Tr 2 2 2 k ( b F ( ω ) ) ( 1 ) Tr 2 2 2 k ( a ω ) + Tr 2 2 2 k ( b F ( ω ) ) + x F 2 k ( 1 ) Tr 2 2 k ( Tr 2 k 2 2 k ( a ) x ) + Tr 2 2 k ( Tr 2 k 2 2 k ( b ) F ( x ) ) ] = 1 4 [ 2 k 4 + W f ( c ) ] , if Tr 2 2 2 k ( a ω ) = Tr 2 2 2 k ( b F ( ω ) ) = 1 , 1 4 [ 2 k + W f ( c ) ] , otherwise ,
where f = Tr 2 2 k ( F ( x ) ) and c = Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 , a ,   b F 2 2 k * .
T i = 1 4 y F 2 z F 2 x F 2 k * ( 1 ) y [ Tr 2 2 2 k ( a u i x ) 1 ] + z [ Tr 2 2 2 k ( b u i x ) 1 ] = 1 4 [ 2 k + 1 + x F 2 k * ( 1 ) Tr 2 2 2 k ( ( a + b ) u i x ) ] = 2 k 1 , if a = b , 2 k 2 , if a b .
Hence ( C D 1 ,   C D 2 ) is LCP if and only if the following conditions holds:
  • W f ( c ) 0 or 2 mod 4 if Tr 2 2 2 k ( a ω ) = Tr 2 2 2 k ( b F ( ω ) ) = 1 ,
  • W f ( c ) 1 or 3 mod 4 if Tr 2 2 2 k ( a ω ) + Tr 2 2 2 k ( b F ( ω ) ) 1 ,
where f = Tr 2 2 k ( F ( x ) ) and c = Tr 2 k 2 2 k ( a ) Tr 2 k 2 2 k ( b ) 1 , a ,   b F 2 2 k * .
This completes the proof. □
Theorem 7.
The linear codes C D 1 and C D 2 are defined in Theorem 5. If F ( x ) satisfies the conditions of Lemma 6, then ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes.
Proof. 
By Theorem 6, d L C P ( n ,   2 k ) = d L ( n ,   2 k ) = 2 2 k 1 1 . Combining Lemma 6, it is clear that ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes. □

3.2. A Family of Optimal Binary LCPs of Codes from ( x + 1 ) 1

Theorem 8.
The linear codes C D 1 and C D 2 are defined in Theorem 5. If F ( x ) is the function ( x + 1 ) 1 of F 2 k , then ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes.
Proof. 
By Lemmas 3, 6 and Theorem 7, it is clear that ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes. □
Example 2.
The linear codes C D 1 and C D 2 defined in Theorem 8. Let F ( x ) be the function ( x + 1 ) 1 of F 2 k . Let k = 4 ,   t = 16 . With the help of Magma, we obtain that C D 1 and C D 2 are [ 254 ,   8 ,   127 ] 2 linear codes with weight enumerator 1 + 128 z 127 + 127 z 128 and are distance-optimal with respect to the Griesmer bound. Note that C D 1 and C D 2 are equivalent. Moreover, d L C P ( 254 ,   8 ) = d L ( 254 ,   8 ) = 127 , and ( C D 1 ,   C D 2 ) is an optimal binary LCP of codes.

4. Conclusions

The best security parameter for binary LCPs of codes is open for further study. This is the motivation of our work. In this paper, we studied binary LCPs of codes and constructed two families of optimal binary LCPs of codes.

Author Contributions

Funding acquisition, X.L.; Methodology, X.L.; Supervision, X.L.; Writing—original draft, Z.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by National Trusted Embedded Software Engineering Technology Research Center (East China Normal University), funded by Open Foundation of Hubei Key Laboratory of Applied Mathematics (Hubei University) and National Natural Science Foundation of China (No. 12301668).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

The authors would like to thank the referees and editors for their very useful suggestions, which significantly improved this paper.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Carlet, C.; Güneri, C.; Özbudak, F.; Özkaya, B.; Solé, P. On linear complementary pairs of codes. IEEE Trans. Inf. Theory 2018, 64, 6583–6589. [Google Scholar] [CrossRef]
  2. Araya, M.; Harada, M. On the minimum weights of binary linear complementary dual codes. Cryptogr. Commun. 2020, 12, 285–300. [Google Scholar] [CrossRef]
  3. Araya, M.; Harada, M.; Saito, K. Characterization and classification of optimal LCD codes. Des. Codes Cryptogr. 2021, 89, 617–640. [Google Scholar] [CrossRef]
  4. Araya, M.; Harada, M.; Saito, K. On the minimum weights of binary LCD codes and ternary LCD codes. Finite Fields Appl. 2021, 76, 101925. [Google Scholar] [CrossRef]
  5. Bouyuklieva, S. Optimal binary LCD codes. Des. Codes Cryptogr. 2021, 89, 2445–2461. [Google Scholar] [CrossRef]
  6. Carlet, C.; Mesnager, S.; Tang, C.; Qi, Y.; Pellikaan, R. Linear codes over F q are equivalent to LCD codes for q > 3. IEEE Trans. Inf. Theory 2018, 64, 3010–3017. [Google Scholar] [CrossRef]
  7. Fu, Q.; Li, R.; Fu, F.; Rao, Y. On the construction of binary optimal LCD codes with short length. Int. J. Found. Comput. Sci. 2019, 30, 1237–1245. [Google Scholar] [CrossRef]
  8. Galvez, L.; Kim, J.L.; Lee, N.; Roe, Y.G.; Won, B.S. Some bounds on binary LCD codes. Cryptogr. Commun. 2018, 10, 719–728. [Google Scholar] [CrossRef]
  9. Harada, M. Construction of binary LCD codes, ternary LCD codes and quaternary Hermitian LCD codes. Des. Codes Cryptogr. 2021, 89, 2295–2312. [Google Scholar] [CrossRef]
  10. Harada, M.; Saito, K. Binary linear complemetary dual codes. Cryptogr. Commun. 2019, 11, 677–696. [Google Scholar] [CrossRef]
  11. Li, S.; Shi, M.; Liu, H. Several constructions of optimal LCD codes over small finite fields. Cryptogr. Commun. 2024, 16, 779–800. [Google Scholar] [CrossRef]
  12. Bringer, J.; Carlet, C.; Chabanne, H.; Guilley, S.; Maghrebi, H. Orthogonal direct sum masking: A smartcard friendly computation paradigm in a code, with Builtin protection against side-channel and fault attacks. Proc. WISTP Lect. Notes Comput. Sci. 2014, 8501, 40–56. [Google Scholar]
  13. Carlet, C.; Guilley, S. Complementary dual codes for counter-measures to side-channel attacks. Adv. Math. Commun. 2016, 10, 131–150. [Google Scholar] [CrossRef]
  14. Ngo, X.T.; Bhasin, S.; Danger, J.; Guilley, S.; Najm, Z. Linear complementary dual code improvement to strengthen encoded circuit against hardware Trojan horses. In Proceedings of the IEEE International Symposium on Hardware Oriented Security Trust (HOST), Washington, DC, USA, 5–8 May 2015; pp. 82–87. [Google Scholar]
  15. Carlet, C.; Mesnager, S.; Tang, C.; Qi, Y. On σ-LCD codes. IEEE Trans. Inf. Theory 2019, 65, 1694–1704. [Google Scholar] [CrossRef]
  16. Choi, W.H.; Güneri, C.; Kim, J.L.; Özbudak, F. Optimal binary linear complementary pairs of codes. Cryptogr. Commun. 2023, 15, 469–486. [Google Scholar] [CrossRef]
  17. Güneri, C. Optimal binary linear complementary pairs from Solomon Stiffler codes. IEEE Trans. Inf. Theory 2023, 69, 6512–6517. [Google Scholar] [CrossRef]
  18. Li, S.; Shi, M.; Ling, S. An open problem and a conjecture on binary linear complementary pairs of codes. IEEE Trans. Inf. Theory 2025, 71, 219–226. [Google Scholar] [CrossRef]
  19. Anderson, S.E.; Camps-Moreno, E.; López, H.H.; Matthews, G.L.; Ruano, D.; Soprunov, I. Relative Hulls and Quantum Codes. IEEE Trans. Inf. Theory 2024, 70, 3190–3201. [Google Scholar] [CrossRef]
  20. Bhowmick, S.; Dalai, D.K.; Mesnager, S. On Linear Complementary Pairs of Algebraic Geometry Codes over Finite Fields. Discret. Math. 2024, 347, 114193. [Google Scholar] [CrossRef]
  21. Li, X.; Yue, Q.; Tang, D. A family of linear codes from constant dimension subspace codes. Des. Codes Cryptogr. 2022, 90, 1–15. [Google Scholar] [CrossRef]
  22. Lachaud, G.; Wolfmann, J. The weights of the orthogonals of the extended quadratic binary Goppa codes. IEEE Trans. Inf. Theory 1990, 36, 686–692. [Google Scholar] [CrossRef]
  23. Huffman, W.C.; Pless, V. Fundamentals of Error-Correcting Codes; Cambridge University Press: Cambridge, UK, 2003. [Google Scholar]
  24. Li, X.; Fan, C.; Du, X. A family of distance-optimal minimal linear codes with flexible parameters. Cryptogr. Commun. 2020, 12, 559–567. [Google Scholar] [CrossRef]
  25. Tang, D.; Fan, C. A class of distance-optimal binary linear codes with flexible parameters. IEEE Commun. Lett. 2017, 21, 1893–1896. [Google Scholar] [CrossRef]
  26. Wu, Y.; Zhu, X.; Yue, Q. Optimal few-weight codes from simplicial complexes. IEEE Commun. Lett. 2020, 66, 3657–3663. [Google Scholar] [CrossRef]
  27. Ding, C. Linear codes from some 2-designs. IEEE Trans. Inf. Theory 2015, 61, 3265–3275. [Google Scholar] [CrossRef]
Table 1. The weight distribution of C D 1 and C D 2 in Theorem 1.
Table 1. The weight distribution of C D 1 and C D 2 in Theorem 1.
The Weight ω of CodewordsThe Number of Codewords of Weight ω
01
t 2 k 1 ( t + 1 ) ( 2 k 1 )
( t + 1 ) 2 k 1 2 2 k ( t + 1 ) ( 2 k 1 ) 1
Table 2. The weight distribution of C D 1 and C D 2 in Theorem 5.
Table 2. The weight distribution of C D 1 and C D 2 in Theorem 5.
The Weight ω of CodewordsThe Number of Codewords of Weight ω
01
2 2 k 1 1 2 2 k 1
2 2 k 1 2 2 k 1 1
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, X.; Li, Z. Two Families of Optimal Binary Linear Complementary Pairs of Codes. Mathematics 2025, 13, 2791. https://doi.org/10.3390/math13172791

AMA Style

Li X, Li Z. Two Families of Optimal Binary Linear Complementary Pairs of Codes. Mathematics. 2025; 13(17):2791. https://doi.org/10.3390/math13172791

Chicago/Turabian Style

Li, Xia, and Zhaole Li. 2025. "Two Families of Optimal Binary Linear Complementary Pairs of Codes" Mathematics 13, no. 17: 2791. https://doi.org/10.3390/math13172791

APA Style

Li, X., & Li, Z. (2025). Two Families of Optimal Binary Linear Complementary Pairs of Codes. Mathematics, 13(17), 2791. https://doi.org/10.3390/math13172791

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop