1. Introduction
Let
q be a prime power and let
denote the finite field with
q elements. A pair of linear codes
of length
n over
is called a linear complementary pair (LCP) [
1] if their direct sum
produces a full space
.
is an LCP of codes, which means that the two codes
have complementary dimensions and a trivial intersection. If the dimension of
is
k, then
is called an
LCP of codes. In special cases, when
is an LCP of codes,
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
is used to measure protection against FIA, whereas the minimum distance
of the dual of the second code is used to measure protection against SCA. The joint security against the two attacks is provided by
, which is known as the security parameter of the LCP of codes. Note that in the case of an LCD code
, the security parameter is only
.
Carlet et al. [
15] proved that there is a monomial transformation (equivalence)
on
such that
is LCP, where
is a nonbinary
linear code on
. In this case, the security parameter is only
d, where
. Therefore, the best security parameter problem for the nonbinary LCP of codes is settled. In addition, the same article showed that an
binary code can produce a binary LCP of codes
with
. Therefore, the best security parameter for binary LCPs of codes is open for further study. We set
Let
represent the highest minimum distance among
binary LCD codes, and
represent the highest minimum distance among binary linear
codes; then,
If the minimum distance of an linear code is , then we say the linear code is optimal. If the security parameter of an LCP of codes is , then we say the LCP of codes is optimal.
The results in [
15] yielded that
. For
or
, the best security parameters of binary
LCPs of codes were determined in [
16]. Moreover, the authors described a sufficient condition for
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
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 , the Walsh transform of is defined as Lemma 1 ([
21])
. Let , then and if and only if , where , and . Lemma 2. For any k-dimensional subspace E of ,where . Lemma 3 ([
22])
. For any positive integer k and arbitrary , the Walsh spectrum of defined on can take any value divisible by 4 in the range . The following is the well-known Griesmer bound on the length of a linear code.
Lemma 4 (Griesmer bound)
. For any linear code over
, we have where denotes the smallest integer greater than or equal to x. For any
binary linear code, if
, 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
[
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
binary linear code, we say that this code is distance-optimal if there is no
linear code over
. 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
is distance-optimal provided that
3. Two Families of Optimal Binary LCPs of Codes
Let
be any integer and
denote the trace function from
onto
,
denote the trace function from
onto
, and
denote the trace function from
onto
. Following the approach in [
27], for any set
, we define a linear code of length
n over
by
and call
D the defining set of
.
In fact,
, where
and
in
, and the Euclidean inner product of
and
is defined by
Hence , where G is an matrix over constructed by the column vectors , i.e., .
In this paper, G is called a generalized generator matrix of a linear code of length n over .
Construction 1. Let α be a primitive element of , i.e., . Let be a one-to-one map from to , and . Let , , and be a t-subset of . For , . Define Using and as defining sets, we obtain binary linear codes and as Remark 1. Let and be the generator matrices of and . It is clear that and in construction 1 can be transformed into each other through column transformation (rearranging column vectors). Hence and are always equivalent in Construction 1.
Theorem 1. In Construction 1, the linear codes and are binary linear codes with parameters . Moreover, the weight distribution of and are given in Table 1. Proof. It is clear that the binary linear codes
and
have length
. The Hamming weight
of a nonzero codeword
of
can be calculated as follows:
where
can be viewed as a
k-dimensional vector space over
.
By Lemmas 1 and 2, we have
Since the Hamming weight of any nonzero codeword is not equal to 0, then we get that the dimension of is .
By similar arguments as , we can obtain the weight distribution of is same to . This completes the proof of this theorem. □
Theorem 2. If , then the linear codes and defined in Theorem 1 are distance-optimal with respect to the Griesmer bound.
Proof. By Lemma 4, we only need to prove that
Then we get that
for
. This completes the proof. □
Lemma 5. The linear codes and defined in Theorem 1. Then is LCP if and only if , where and , .
Proof. is an LCP of codes means that the two codes have complementary dimensions, and they have a trivial intersection. By Theorem 1, it is clear that the dimension of is equal to and the dimension of is equal to . Next, we just need to prove .
if and only if , s.t. , where .
Define where
Hence
if and only if
s.t.
is odd, so if
is odd, then
is LCP.
where
and
.
When , is odd, hence is LCP. This completes the proof. □
Theorem 3. The linear codes and are defined in Theorem 1. If and , where and , , then is an optimal binary LCP of codes.
Proof. By Theorem 6, . Combining Lemma 5, it is clear that is an optimal binary LCP of codes. □
3.1. A Family of Optimal Binary LCPs of Codes from
Theorem 4. The linear codes and defined in Theorem 1. Let be the inverse function of . When , is an optimal binary LCP of codes.
Proof. By Lemmas 3, 5 and Theorem 6, it is clear that is an optimal binary LCP of codes. □
Example 1. The linear codes and are defined in Theorem 4. Let be the inverse function of . Let . With the help of Magma, we obtain that and are linear codes with weight enumerator and is distance-optimal with respect to the Griesmer bound. Note that and are equivalent. Moreover, , and is an optimal binary LCP of codes.
Construction 2. Let α be a primitive element of , i.e., . Let be a one-to-one map from to , and . Let , , and be a -subset of . For , . Define Using and as defining sets, we obtain binary linear codes and as Remark 2. Let and be the generator matrices of and . It is clear that and in Construction 2 can be transformed into each other through column transformation (rearranging column vectors). Hence and are always equivalent in Construction 2.
Theorem 5. In Construction 2, the linear codes and are binary linear codes with parameters . Moreover, the weight distributions of and are given in Table 2. Proof. It is clear that the binary linear codes
and
have lengths
. The Hamming weight
of a nonzero codeword
of
can be calculated as follows:
where
can be viewed as a
k-dimensional vector space over
.
Since the Hamming weight of any nonzero codeword is not equal to 0, then we get that the dimension of is .
By similar arguments as for , we can obtain that the minimum distance of is same to . This completes the proof of this theorem. □
Theorem 6. The linear codes and defined in Theorem 5 are distance-optimal with respect to the Griesmer bound.
Proof. By Lemma 4, we only need to prove that
This completes the proof. □
Lemma 6. The linear codes and are defined in Theorem 5. Then is LCP if and only if the following conditions holds:
if ,
if ,
where and , .
Proof. By Theorem 5, it is clear that the dimension of is equal to and the dimension of is equal to . Next, we just need to prove .
Define where
Since
if and only if
s.t.
is odd, so if
is odd, then
is LCP.
where
and
,
.
Hence is LCP if and only if the following conditions holds:
if ,
if ,
where and , .
This completes the proof. □
Theorem 7. The linear codes and are defined in Theorem 5. If satisfies the conditions of Lemma 6, then is an optimal binary LCP of codes.
Proof. By Theorem 6, . Combining Lemma 6, it is clear that is an optimal binary LCP of codes. □
3.2. A Family of Optimal Binary LCPs of Codes from
Theorem 8. The linear codes and are defined in Theorem 5. If is the function of , then is an optimal binary LCP of codes.
Proof. By Lemmas 3, 6 and Theorem 7, it is clear that is an optimal binary LCP of codes. □
Example 2. The linear codes and defined in Theorem 8. Let be the function of . Let . With the help of Magma, we obtain that and are linear codes with weight enumerator and are distance-optimal with respect to the Griesmer bound. Note that and are equivalent. Moreover, , and is an optimal binary LCP of codes.