Abstract
Linear codes with few weights have applications in data storage systems, secret sharing schemes, and authentication codes. In this paper, a class of p-ary two-weight linear codes is constructed using a generic construction developed by Ding et al. recently, where p is a prime. Their length and weight distribution are closed-form expressions of Kloosterman sums over prime finite fields, and are completely determined when p = 2 and p = 3. The dual of this class of linear codes is also studied and is shown to be optimal or almost optimal in the binary case.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Let q = p m and \(\phantom {\dot {i}\!}{\mathbb F}_{q}\) denote the finite field with q elements, where p is a prime and m is a positive integer. An n, k, d] linear code \(\phantom {\dot {i}\!}{\mathcal C}\) over \(\phantom {\dot {i}\!}{\mathbb F}_{p}\) is a k-dimensional subspace of \(\phantom {\dot {i}\!}{{\mathbb F}_{p}^{n}}\) with minimum (Hamming) distance d. Let A i denote the number of codewords with Hamming weight i in a code \(\phantom {\dot {i}\!}{\mathcal C}\) of length n. The weight enumerator of \(\phantom {\dot {i}\!}{\mathcal C}\) is defined by
Accordingly, the sequence (1,A 1,⋯ ,A n ) is called the weight distribution of \(\phantom {\dot {i}\!}{\mathcal C}\). Clearly, the weight distribution gives the minimum distance of the code, and thus the error correcting capability. Moreover, the weight distribution of a code allows the computation of the error probability of error detection and correction with respect to some error detection and error correction algorithms (see [14] for details). Thus the study of the weight distribution of a linear code is important in both theory and applications.
A code \(\phantom {\dot {i}\!}{\mathcal C}\) is said to be a t-weight code if the number of nonzero A i in the sequence (A 1,A 2,⋯ ,A n ) is equal to t. Linear codes with few weights have applications in secret sharing schemes [1, 3, 18], authentication codes [5, 6], and association schemes [2], in addition to their applications in consumer electronics, communication and data storage systems. They are also closely related with strongly regular graphs and combinatorial design. An n, k, d] linear code \(\phantom {\dot {i}\!}{\mathcal C}\) is called optimal if its parameters n, k and d meet a bound on linear codes [13]. An n, k, d] linear code \(\phantom {\dot {i}\!}{\mathcal C}\) is called almost optimal if n, k, d + 1] meets a bound on linear codes [13].
Design of (almost) optimal linear codes with few weights has been an interesting research topic in coding theory. Much progress has been made in recent years. One of known approaches for obtaining such linear codes is based on subsets of a finite field and the trace function over this field. Specifically, let D = {d 1,d 2,⋯,d n } be a subset of \(\phantom {\dot {i}\!}{\mathbb F}_{q}^{*}\), a linear code of length n over \(\phantom {\dot {i}\!}{\mathbb F}_{p}\) can be obtained as
where \(\phantom {\dot {i}\!}{\text {Tr}_{1}^{m}}\) is the absolute trace function from \(\phantom {\dot {i}\!}{\mathbb F}_{q}\) to \(\phantom {\dot {i}\!}{\mathbb F}_{p}\) and D is called the defining set of this code. It turns out in [7, 8] that this approach is very promising in the sense that it can generate many (almost) optimal linear codes with a few weights if the subset D is appropriately chosen. This is further confirmed by a number of recent papers [11, 12, 17].
An objective of this paper is to construct a class of two-weight linear codes over \(\phantom {\dot {i}\!}{\mathbb F}_{p}\) with new parameters using the approach mentioned above. They are optimal or almost optimal linear codes in many cases. Another objective of this paper is to study the weight distribution and the dual of this class of linear codes. Thanks to some known results on Kloosterman sums over finite fields, the length and weight distribution of this class of linear codes have a closed-form expression, and are completely determined when p = 2 and p = 3. The parameters of its dual are also determined which are optimal or almost optimal in the binary case.
2 Preliminaries
Throughout this paper, we adopt the following notations unless otherwise stated:
-
p is a prime and m = 2k, where k is a positive integer with k > 2.
-
q = p m and r = p k.
-
\(\phantom {\dot {i}\!}\text {Tr}_{\ell _{1}}^{\ell _{2}}(x)\) is the trace function from the finite field \(\phantom {\dot {i}\!}{\mathbb F}_{p^{\ell _{2}}}\) to \(\phantom {\dot {i}\!}{\mathbb F}_{p^{\ell _{1}}}\) for any positive integers ℓ 1|ℓ 2.
-
χ is the canonical additive character on \(\phantom {\dot {i}\!}{\mathbb F}_{q}\), i.e., \(\phantom {\dot {i}\!}\chi (x)=e^{2\pi \sqrt {-1} {\text {Tr}_{1}^{m}}(x)/ p}\) for any \(\phantom {\dot {i}\!}x\in {\mathbb F}_{q}\).
-
For any positive integer ℓ|m, χ ℓ is the canonical additive character on \(\phantom {\dot {i}\!}{\mathbb F}_{p^{\ell }}\), i.e., \(\phantom {\dot {i}\!}\chi _{\ell }(x)=e^{2\pi \sqrt {-1} \text {Tr}_{1}^{\ell }(x)/ p}\) for any \(\phantom {\dot {i}\!}x\in {\mathbb F}_{p^{\ell }}\).
Let α be a generator of \(\phantom {\dot {i}\!}{\mathbb F}_{q}^{*}\) and β = α r−1. Let Δ be the cyclic group generated by β and Γ = {α j : 0 ≤ j ≤ r}. The following results will be useful to prove our main results.
Fact 1
With notations defined above, we have
-
1.
{v r−1 : v ∈ Γ} = Δ; and
-
2.
for each \(\phantom {\dot {i}\!}x \in {\mathbb F}_{q}^{*}\) , it has a unique decomposition as x = uv, where \(\phantom {\dot {i}\!}u \in {\mathbb F}_{r}^{*}\) and v ∈ Γ.
Lemma 1
For any given \(\phantom {\dot {i}\!}a\in {\mathbb F}_{q}^{*}\) , there is one and only one v a ∈ Γ such that
Proof
By Fact 1, x has a unique decomposition as x = u v, where \(\phantom {\dot {i}\!}u \in {\mathbb F}_{r}^{*}\) and v ∈ Γ. Therefore \(\phantom {\dot {i}\!}{\text {Tr}_{k}^{m}}(x)={\text {Tr}_{k}^{m}}(uv)=u{\text {Tr}_{k}^{m}}(v)\) which implies that the number of solutions \(\phantom {\dot {i}\!}x\in {\mathbb F}_{q}^{*}\) to \(\phantom {\dot {i}\!}{\text {Tr}_{k}^{m}}(x)=0\) is r − 1 times as the number of solutions v ∈ Γ to \(\phantom {\dot {i}\!}{\text {Tr}_{k}^{m}}(v)=0\). The conclusion then follows from the fact that the equation \(\phantom {\dot {i}\!}{\text {Tr}_{k}^{m}}(x)=0\) has q m−k − 1 = r − 1 solutions in \(\phantom {\dot {i}\!}{\mathbb F}_{q}^{*}\). □
The length and weights of the linear code proposed in this paper will be expressed by means of the Kloosterman sums over finite field. For any \(\phantom {\dot {i}\!}a \in {\mathbb F}_{p^{\ell }}\), the Kloosterman sum over \(\phantom {\dot {i}\!}{\mathbb F}_{p^{\ell }}\) at the point a is defined by
where ℓ is a positive integer with ℓ|m. The following bound on |K ℓ (a)| will be needed in the sequel.
Lemma 2
[ 16 ] With notations as above, we have
for any nonzero \(\phantom {\dot {i}\!}a\in {\mathbb F}_{p^{\ell }}\).
The following result on an incomplete exponential sum was firstly proven in [15] in the binary case and was extended to the nonbinary case by the last author in [10].
Lemma 3
For any \(\phantom {\dot {i}\!}a\in {\mathbb F}^{*}_{q}\) , we have
The following lemma is due to Carlitz [4] and will be needed in the sequel.
Lemma 4
For any \(\phantom {\dot {i}\!}a \in {\mathbb F}_{q}^{*}\) ,
3 A Class of Two-Weight Linear Codes
In this section, we shall study a class of linear codes with two weights. Following the notations in Section 2, let D be a subset of \(\phantom {\dot {i}\!}{\mathbb F}_{q}^{*}\) given by
According to (1), we naturally obtain a class of linear codes by using such D as the defining set. The following are the main results of this paper.
Theorem 1
Let \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) be the linear code with defining set D in ( 2 ). Then \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) is a two-weight linear code with parameters n,m] and weight distribution in Table 1 , where
and
Proof
Define
By definition, the length of the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) is equal to n which can be expressed in terms of character sums as
Using Fact 1 and the fact that u r−1 = 1 for each \(\phantom {\dot {i}\!}u\in {\mathbb F}_{r}^{*}\), we have
where the last identity followed from the orthogonal property of the additive character χ. Applying Lemmas 3 and 4, we immediately get the formula in (3) for the length n of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\).
We now calculate the Hamming weight of the codewords in \(\phantom {\dot {i}\!}{\mathcal C}_{D}\). Note that the codewords in \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) are
By definition, the Hamming weight of a codeword c a is equal to n − N a , where
Clearly, N a = n if a = 0, and otherwise N a can be expressed in terms of character sums as
By Fact 1 again, we have
Note that for any \(\phantom {\dot {i}\!}z \in {\mathbb F}_{p}, u \in {\mathbb F}_{r}^{*}, v \in {\Gamma }\) and \(\phantom {\dot {i}\!}a\in {\mathbb F}_{q}^{*}\),
We then arrive at N a = N a,1 − N a,2, where
and
Using the orthogonal property of the nontrivial additive characters and Fact 1, we have
where v a is the only one element in Γ such that \(\phantom {\dot {i}\!}{\text {Tr}_{k}^{m}}(av_{a})=0\) due to Lemma 1. It then follows from (5) and (6) that
where the second identity followed from Lemmas 3 and 4, and S is given by (4). Note that the weight of the codeword c a is equal to n − N a . By (7), the weight of c a takes the value
if \(\phantom {\dot {i}\!}{\text {Tr}_{1}^{m}}\left (v_{a}^{r-1}\right ) = 0\), and otherwise takes the value
Note that w 2 > w 1 and S is an integer due to (3). In order to prove that the dimension of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) is equal to m, it is only necessary to prove that w 1 > 0 which is equivalent to proving that p k + 1 + S − p > 0. According to Lemma 3,
It then follows from Lemma 2 that
This together with the fact that S is an integer means that
When k = 3, it is easily verified that p k + 1 + S − p > 0. When k > 3, we have
Therefore, w 1 > 0 for any k ≥ 3. The discussion above shows that the dimension of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) is equal to m. It will be proved in Theorem 2 that the minimum weight of the dual code of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) is at least 2. By the Pless Power Moments (see [13], p. 259), we have
where \(\phantom {\dot {i}\!}A_{w_{1}}\) and \(\phantom {\dot {i}\!}A_{w_{2}}\) denote the number of codewords with weight w 1 and w 2 in \(\phantom {\dot {i}\!}{\mathcal C}_{D}\), respectively. Solving this simple equation system gives the weight distribution of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) in Table 1. This completes the proof. □
Remark 1
In Theorem 1, we get closed-form expressions of the length and weight distribution of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) using Kloosterman sums. One point that should be mentioned is that the defining set of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) has been used in [12]. In this sense, the linear code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) is not new. However, thanks to some known results on Kloosterman sums, we can determine the weight distribution of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) in the binary and ternary cases as shown below.
Remark 2
According to Theorem 1, in order to completely establish the weight distribution of \(\phantom {\dot {i}\!}{\mathcal C}_{D}\), it is sufficient to determine the value of the inner exponential sum in (4). It may be very hard in general. However, this can be done when p is small. In particular, when p = 2 and p = 3, we can get a more elegant expression for S. Note that K 1(1) = 1 when p = 2 and K 1(1) = −1 when p = 3. By (4), we immediately have
when p = 2, and
when p = 3. Plugging these values of S into Table 1, we then completely determine the weight distribution of the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) in the binary and ternary cases.
The numerical experiments by Magma in the following examples agree with the weight distribution in Table 1.
Example 1
Let p = 2 and k = 4. Then the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) has parameters 135,8,64] and weight enumerator 1 + 135y 64 + 120y 72. It is almost optimal due to [9].
Example 2
Let p = 3 and k = 3. Then m = 6 and q = 36, the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) has parameters 104,6,54] and weight enumerator 1 + 104y 54 + 624y 72. According to [9], the minimum distance of the best known linear codes with length 104 and dimension 6 is 56.
Example 3
Let p = 3 and k = 4. Then the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) has parameters 2560,8,1674] and weight enumerator 1 + 2560y 1674 + 4000y 1728.
4 The Dual of \({\mathcal C}_{D}\)
In this section, we shall discuss the dual code of the two-weight code in Theorem 1. The following theorem is the main result of this section.
Theorem 2
Let \(\phantom {\dot {i}\!}{\mathcal C}^{\bot }_{D}\) be the dual of the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}\) . Then \(\phantom {\dot {i}\!}{\mathcal C}^{\bot }_{D}\) is a linear code with parameters n,n − m,d ⊥ ], where d ⊥ = 3 if p = 2 and d ⊥ = 2 if p is an odd prime.
Proof
The dimension of the code \(\phantom {\dot {i}\!}{\mathcal C}_{D}^{\bot }\) follows from Theorem 1. By definition, D does not contain the zero element of \(\phantom {\dot {i}\!}{\mathbb F}_{q}\), thus the minimum distance of \(\phantom {\dot {i}\!}{\mathcal C}_{D}^{\bot }\) cannot be one.
When p = 2, any two distinct elements d i and d j in D satisfy d i + d j ≠0, where 1 ≤ i≠j ≤ n. This means that the minimum distance of \(\phantom {\dot {i}\!}{\mathcal C}_{D}^{\bot }\) cannot be 2. Note that \(\phantom {\dot {i}\!}{\text {Tr}_{1}^{m}}(1) = 0\) as m is even. Therefore, \(\phantom {\dot {i}\!}{\text {Tr}_{1}^{m}}(x^{r-1})={\text {Tr}_{1}^{m}}(1)=0\) for any \(\phantom {\dot {i}\!}x\in {\mathbb F}_{r}^{*}\) which further implies that \(\phantom {\dot {i}\!}{\mathbb F}_{r}^{*}\subset D\). According to the basic properties of finite fields, there exist two distinct elements \(\phantom {\dot {i}\!}x_{1}, x_{2} \in {\mathbb F}_{r}^{*}\) such that \(\phantom {\dot {i}\!}x_{1} + x_{2} \in {\mathbb F}_{r}^{*}\). Hence, {x 1,x 2,x 1 + x 2}⊂ D which means that the minimum distance of \(\phantom {\dot {i}\!}{\mathcal C}_{D}^{\bot }\) is 3.
When p is an odd prime, it is clear that − x ∈ D for any x ∈ D since r − 1 is even. Choose some x 1 ∈ D and set x 2 = −x 1, then x 1≠x 2 and {x 1,x 2}⊂ D. This implies that the minimum distance of \(\phantom {\dot {i}\!}{\mathcal C}_{D}^{\bot }\) is 2. □
We remark that the linear code \(\phantom {\dot {i}\!}{\mathcal C}^{\bot }_{D}\) is bad when p > 2 since its minimum distance is only 2. However, it is at least almost optimal when p = 2 since any binary linear code with length n in (3) and dimension m has minimum distance at most 4 due to the sphere packing bound [13].
Example 4
Let p = 2 and k = 3. Then the binary code \(\phantom {\dot {i}\!}{\mathcal C}^{\bot }_{D}\) has parameters 49,43,3]. It is optimal due to [9].
Example 5
Let p = 2 and k = 4. Then the binary code \(\phantom {\dot {i}\!}{\mathcal C}^{\bot }_{D}\) has parameters 135,127,3]. It is optimal due to [9].
5 Concluding Remarks
In this paper, we studied a class of two-weight linear codes, and gave closed-form expressions of their length and weight distributions thanks to some known results on Kloosterman sums. The dual of the linear codes was proved to be optimal or almost optimal in the binary case. Finally, we mentioned that our linear code can be employed to construct secrete sharing schemes with nice access structures under the framework developed in [3].
References
Anderson, R. J., Ding, C., Helleseth, T., Kløve, T.: How to build robust shared control systems. Des. Codes Cryptography 15(2), 111–124 (1998)
Calderbank, A., Goethals, J.: Three-weight codes and association schemes. Philips J. Res. 39(4-5), 143–152 (1984)
Carlet, C., Ding, C., Yuan, J.: Linear codes from perfect nonlinear mappings and their secret sharing schemes. IEEE Trans. Inf. Theory 51(6), 2089–2102 (2005)
Carlitz, L.: Kloosterman sums and finite field extensions. Acta Arithmetica 16 (2), 179–194 (1969)
Ding, C., Helleseth, T., Kløve, T., Wang, X.: A generic construction of cartesian authentication codes. IEEE Trans. Inf. Theory 53(6), 2229–2235 (2007)
Ding, C., Wang, X.: A coding theory construction of new systematic authentication codes. Theor. Comput. Sci. 330(1), 81–99 (2005)
Ding, K., Ding, C.: Binary linear codes with three weights. IEEE Commun. Lett. 18(11), 1879–1882 (2014)
Ding, K., Ding, C.: A class of two-weight and three-weight codes and their applications in secret sharing. IEEE Trans. Inf. Theory 61(11), 5835–5842 (2015)
Grassl, M.: Bounds on the minimum distance of linear codes. Online available at http://www.codetables.de, Accessed on pp. 08–20 (2008)
Helleseth, T., Kholosha, A.: Monomial and quadratic bent functions over the finite fields of odd characteristic. IEEE Trans. Inf. Theory 52(5), 2018–2032 (2006)
Heng, Z., Yue, Q.: A class of binary linear codes with at most three weights. IEEE Commun. Lett. 19(9), 1488–1491 (2015)
Heng, Z., Yue, Q.: Two classes of two-weight linear codes. Finite Fields Appl. 38, 72–92 (2016)
Huffman, W. C., Pless, V.: Fundamentals of error-correcting codes. Cambridge University Press (2003)
Kløve, T.: Codes for Error Detection World Scientific (2007)
Leander, N. G.: Monomial bent functions. IEEE Trans. Inf. Theory 52(2), 738–743 (2006)
Lidl, R., Niederreiter, H.: Finite fields, vol. 20. Cambridge University Press (1997)
Qi, Y., Tang, C., Huang, D.: Binary linear codes with few weights. IEEE Commun. Lett. 20(2), 208–211 (2016)
Yuan, J., Ding, C.: Secret sharing schemes from three classes of linear codes. IEEE Trans. Inf. Theory 52(1), 206–212 (2006)
Acknowledgments
The authors are very grateful to the reviewers and the Editor for their valuable comments that improved the presentation of this paper. Special thanks go to one of the reviewers for pointing out [12] and one family of two-weight linear codes. This work was supported by the National Natural Science Foundation of China (Grant Nos. 61672028, 61602394) and the Fundamental Research Funds for the Central Universities of China (Grant No. 2682016CX113).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Tan, P., Zhou, Z., Tang, D. et al. The weight distribution of a class of two-weight linear codes derived from Kloosterman sums. Cryptogr. Commun. 10, 291–299 (2018). https://doi.org/10.1007/s12095-017-0221-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12095-017-0221-1