Abstract

Linear codes with few weights have become an interesting research topic and important applications of cryptography and coding theory. In this paper, we apply some ternary near-bent and 2-plateaued functions or -ary functions to construct more 3-weight linear codes, where is a prime. Moreover, we determine the weight distributions of the resulted linear codes by means of some exponential sums.

1. Introduction

Let be a prime and . If is a k-dimensional subspace of , then is called an linear code over . A code is called an code if is the minimum nonzero weight in . Let be the number of code words of weight in . The weight enumerator of is defined by

The list for is called the weight distribution of . In general, it is difficult to determine the weight distribution of a given linear code . Information on the weight distribution of linear codes could be seen in [19]. If the number of nonzero in is equal to , then is called a -weight code. Linear codes with few weights have been studied due to their importance in communication and combinatorial theory [1015]. If the parameters of meet a bound on linear codes [16], then is called optimal.

For a subset of , we definewhere is the absolute trace function from to . The set is called the defining set of .

Many linear codes can be generated by choosing the suitable defining set [14, 1721]. In [22], a class of binary linear codes with 3 weights was obtained by using the exponential sum . Recently, by using some -ary bent functions, the authors obtained several classes of linear codes with 2 or 3 weights in [2326].

The Walsh transform of is defined bywhere is a primitive -th root of unity.

Walsh transform is a basic tool to study the properties of cryptography functions. A function from to is bent if for all . For an integer , is called -plateaued if for all . Plateaued function can be used as an ideal candidate function for the design of the cryptographic system because it has a variety of ideal cryptographic characteristics [27].

It should be noted that binary -plateaued functions exist only when and have the same parity. The case corresponds to bent functions by definition. 1-plateaued functions are also called near-bent (see [28]), and binary 1-plateaued and 2-plateaued functions are called semibent [29].

Based on the aforementioned work, this paper makes further endeavors to construct 3-weight linear codes. We use a class of quadratic ternary near-bent and 2-plateaued functions to construct two classes of ternary 3-weight linear codes. Moreover, the weight distributions of the resulted linear codes can be completely given. Numerical results indicate the proposed linear codes contain some linear codes with good parameters. By analyzing the values of some Weil sums, a class of -ary linear codes with 3 weights is presented.

The organization of this paper is as follows. Section 2 gives two classes of ternary linear codes with 3 weights. In Section 3, a class of -ary linear codes with 3 weights is provided by using some Weil sums. Conclusions are finally drawn in Section 4.

2. Ternary Linear Codes with 3 Weights from Some Ternary Functions

Throughout this section, let be an odd prime and a positive integer. Let denote the finite field with elements and . In [24, 26], some -ary linear codes with 2 or 3 weights have been obtained by exploiting -ary bent functions. We give two constructions of ternary linear codes with 3 weights by utilizing some ternary functions in this section.

Let be a function satisfying and . In this section, the defining set of is given bywhere . Denote . Clearly, is the length of . We compute

Note that of is , wherefor each . Note that . We have

Generally, it is difficult to give the Walsh coefficients of a ternary function. In the following, we shall select some proper ternary plateaued functions to obtain linear codes with 3 weights over , where is defined as in (4).

Lemma 1. (see [30], Theorem 2). Assume that , , and is the quadratic character of . Define(i)If , , and , then is near-bent. Moreover, for ,(ii)If , , and , then is a 2-plateaued function. Moreover, for ,

The following theorem gives two classes of linear codes with 3 weights over .

Theorem 1. Let be a positive integer with and . Let such that , , and . Let be defined as in (8) and be defined as in (4).(i)When is even, is a code with 3 weights and has weight distribution given in Table 1(ii)When is odd, is a code with 3 weights and has weight distribution given in Table 2, where if and if

Proof. Note that , , and . By Lemma 1 (i), we have as is even. It follows from (5) that . Hence, the length of is .For , to calculate , we need to calculate from (7).If , then . We evaluate by distinguishing the following three cases.When , it follows from (9) thatWhen or , it follows from (9) thatWhen ,It then follows from (7) with thatHence, the Hamming weight of satisfiesThis implies that the code has 3 weights in the above set.If , then . Similar to the proof above, we obtainfor each . Since if and , we have the minimum distance of is 2. It is easy to see that the number of code words with weight 2 in is . The first three Pless power moments give the desired weight distribution. Since , for any . Hence, the dimension of is .(ii)Conclusion (ii) can be proved by the similar proof as (i).

Example 1. Let , , , and . Define . Then, in Theorem 1 (i) is a ternary code, and its weight enumerator is .

Theorem 2. Let be a positive integer with and . Let such that , , and . Let be defined as in (4) and be defined as in (8).(i)When is even, is a 3-weight code and has weight distribution listed in Table 3, where if and if (ii)When is odd, is a 3-weight code and has weight distribution listed in Table 4

Proof. We just omit the proof here since it is similar to that of Theorem 1.

Remark 1. It should be noted that if is a nonsquare in , the first conclusion in Theorem 2 is also true when .

Example 2. Assume and is the generator of , where is a root of . Let , , and . Define . Then, the code in Theorem 2 (i) is code and has weight enumerator .
Since , the set defined by (4) can be expressed aswhere for and . Selecting as the defining set can give more ternary 3-weight codes.

Corollary 1. Assume that and . Let such that , , and . Let be given as in (17) and be given as in (8).(i)When is even, is a 3-weight code and has weight distribution given in Table 5(ii)When is odd, is a 3-weight code and has weight distribution given in Table 6, where if and if

Example 3. Let . Let , , and . Define . The code in Corollary 1 (i) is a code and has weight enumerator .

Example 4. Let . Let , , and . Define . Then, in Corollary 1 (ii) is a code and has weight enumerator . By using the Griesmer bound, we know this code is optimal.

Corollary 2. Assume that and . Let such that , , and . Let be defined as in (17) and be defined as in (8).(i)When is even, is a 3-weight code, and its weight distribution is listed in Table 7, where if and if (ii)When is odd, is a 3-weight code and has weight distribution listed in Table 8

Example 5. Assume is a generator of , where is a root of . Let , , and . Define . Then, the code in Corollary 2 (i) is a code and has weight enumerator .

3. A Class of -Ary Linear Codes with 3 Weights

Denote , where and are positive integers. For , let .

Based on the fact that a quadratic -ary bent function has full rank, Zhou et al. ([26], Section III.B) obtained a class of linear codes with 2 or 3 weights by using Gold functions. Following the work of Zhou et al. [26], we shall employ Gold class of plateaued functions whose rank is less than to construct -ary linear codes with 3 weights.

For , we denote by the Weil sum given by

Lemma 2. (see [31], Theorem 4.1). For , the equation has solutions in if and only if is even and .
In [31, 32], the following two lemmas studied explicit evaluations of the exponential sum (18).

Lemma 3. (see [31]). Let be even with . Then, , and

Lemma 4. (see [32]). Let be even with . Assume that is not a permutation polynomial over . Then, for , we have unless the equation is solvable. If this equation is solvable, thenwhere is such that .

Let be even with and such that . It follows from Lemmas 3 and 4 and the definition of the plateaued function that is a -plateaued function if .

Lemma 5. Let be even with and such that . Then,

Proof. Since is even, . Hence, for each . The desired result follows from Lemma 3.

Lemma 6. Let be even with and such that . For , we have

Proof. Since is even and , the equation is solvable for by Lemma 2. For , we claim that the equation is solvable if and only if the equation is solvable for each . Suppose is a solution of . Clearly, is also a root of . Then, . We can rewrite this as since . It then follows that . That is to say, the equation has a solution . Conversely, assume is a solution of ; then, . Note that . Hence, we have . This implies that has a solution .
If has no solutions in , then by Lemma 4 and the discussions above, we haveIf has a solution in , then we know that has a solution from the discussions above. It follows from (20) thatHence, for any ,Let be a positive integer, , where is an even integer. Definewhere .

Theorem 3. Let be a positive integer, , where is an even integer. Let be defined as in (26), where . Define . Assume that is even and .(i)If is odd, then is a 3-weight code and has weight distribution given in Table 9(ii)If is even, then is a 3-weight code with the weight distribution given in Table 10

Proof. We only present the proof of (i) since the others can be proven by a similar proof. Denote . We haveNote that is odd and . By Lemma 5, we haveFor each , letThen, the Hamming weight is . We can computeIt follows from Lemmas 5 and 6 thatFor each , we haveThen, has three nonzero weights above. When , for each , , and thus, the dimension of the code is .
Note that . The minimum distance of cannot be one. Since for all , if , the minimum Hamming weight of is 2. Moreover, we can prove that is equal to . In fact, for each distinct element , we can get code words with weight 2 in . Define , , and .
Solving the following linear equations gives the desired weight distribution:

Example 6. Let and . Let . Then, the code is a code and has weight enumerator .

Example 7. Let and . Let be the generator of , where is a root of . Let . Clearly, . Let . Then, the code is a code and has weight enumerator .

4. Conclusion

We succeed in constructing some linear codes with 3 weights from some -ary functions with few Walsh transform values in the odd characteristic. The weight distributions of linear codes in this paper are determined by analyzing Walsh coefficients of -ary functions. Compared with other linear codes with 3 weights, the parameters of the linear codes with 3 weights of this paper are different from those obtained from bent functions in [19, 23, 24, 26]. As applications, some of the 3-weight codes can be used to obtain secret sharing schemes [15] and association schemes introduced in [11].

Data Availability

All datasets generated for this study are included within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported by the Dongguan Science and Technology Development Foundation (Grant no. 2019507151569), the NNSF of China (Grant no. 11601177), and the Natural Science Foundation for the Higher Education Institutions of Anhui Province of China (Grant no. KJ2018A0470).