Two Classes of Linear Codes From Weil Sums

In this article, we consider two classes of $p$ -ary linear codes. This article is a generalization of the recent construction methods given by Jian, Lin and Feng (2019). By choosing different defining sets, two classes of two-weight or three-weight linear codes over finite fields are constructed and their weight distributions are determined based on Weil sums. We also give some examples and some of the linear codes are almost optimal with respect to the Griesmer bound which can be directly employed to obtain democratic secret sharing schemes. Additionally, all nonzero codewords are minimal and they are crucial to apply in association schemes, strongly regular graphs, weakly regular plateaued functions and authentication codes.


I. INTRODUCTION
Throughout this article, let F p be the finite field with p elements, where p is an odd prime. An [n, k, d H ] linear code C over F p is a k-dimensional subspace of F n p with minimum Hamming distance d H . Let A i denote the number of codewords with Hamming weight i in a code C. The weight enumerator of C is defined by the polynomial 1 + A 1 z + A 2 z 2 +· · ·+A n z n . The sequence (1, A 1 , A 2 , · · · , A n ) is called the weight distribution of the code C. A code 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.
The weight distribution of a linear code is of vital use in coding theory. It provides significant information on the error correcting capability and the error probability of its error detection and correction [27]. That is why it has attracted a lot of interests for many years. In addition, much attention has been paid to two-weight and three-weight linear codes [9], [13], [14], [17]- [20], [22] due to their applications in secret sharing schemes [11], [25], [35], association schemes [1], [26], strongly regular graphs [2], weakly regular plateaued functions [24] and authentication codes [6]. We refer the reader to [12], [28]- [34] and references therein for an overview of the related data distributions of linear codes.
Let m be a positive integer and q = p m . The trace function from F q to F p is denoted by Tr. For a set D = {d 1 , d 2 , · · · , d n } ⊆ F q , we define a p-ary linear code The associate editor coordinating the review of this manuscript and approving it for publication was Josue Antonio Nescolarde Selva . by C D = {c(a) = (Tr(ad 1 ), Tr(ad 2 ), · · · , Tr(ad n )) : a ∈ F q }.
The set D is called the defining set of C D . Ding et al. in [7] first proposed this construction and many classes of known codes could be produced by appropriately selecting different defining sets.
In [16], Jian, Lin and Feng defined p-ary linear codes by which can be viewed as a generalization of cyclic codes whose dual codes have two zeros. Let u be a positive integer. They chose the linear codes with the defining sets given by D Motivated by the generic construction and the work of [16], we generalize the results by choosing the defining sets given by and In this way, the linear code C D with the defining sets given by D For this two classes of linear codes, we will study their parameters and weight distributions using Weil sums.  As proved later, they are linear codes with two or three nonzero weights. In particular, some of the linear codes obtained are almost optimal with respect to the Griesmer bound [10]. All of linear codes obtained are minimal, which indicates that the linear codes can be of use in secret sharing schemes.
The remainder of this article is organized as follows. In section II we present the parameters of two classes of two-weight or three-weight linear codes and also give some examples. In section III we recall some basic notations and results on group characters, exponential sums and the Pless power moments, which will be employed later. Section IV is devoted to giving the proofs of the main results. Section V shows that every nonzero codeword of the codes is minimal. Section VI concludes this article.

II. MAIN RESULTS
We introduce a few auxiliary parameters. Let m, u be positive integers m 2 and p be an odd prime, denote q = p m and s = m 2 if 2 | m. Let d = gcd(m, u) be the greatest common divisor of m and u. In this section, we describe the codes, introduce their parameters and give some examples. The proofs of their parameters will be given in Section IV.
Theorem 1: The code C D 1 is defined by (1) and (2). If m is odd, then 2 ] threeweight linear code with weight distribution given in Table 1, where A w = 0 for all other weights w not listed in the if p ≡ 3 (mod 4) and s is odd,    (1) and (2).
2 ] three-weight linear code with weight distribution given in Table 3, where A w = 0 for all other weights w not listed in the table.  (1) and (2).
] three-weight linear code with weight distribution 180472 VOLUME 8, 2020  given in Table 4, where A w = 0 for all other weights w not listed in the table.  (1) and (3). If m d is odd or m d ≡ 2 (mod 4), then C D 2 is an [n, 2m, d H ] twoweight linear code with weight distribution given in Table 5, where  [30,4,18] and weight enumerator 1 + 50 z 18 + 30 z 24 , which is almost optimal as the best linear code of length 30 and dimension 4 over F 3 has minimum weight 19 according to the Griesmer bound.  (1) and (3).
three-weight linear code with weight distribution given in Table 6, where A w = 0 for all other weights w not listed in the table.

III. PRELIMINARIES A. GROUP CHARACTERS AND GAUSS SUMS
Let Tr denote the trace function from F q to F p and ζ p = e 2π √ −1 p be the primitive p-th root of unity. A character χ of F q is a homomorphism from F q into the multiplicative group U of complex numbers of absolute value 1 -that is, a mapping from F q into U with χ(g 1 g 2 ) = χ (g 1 )χ(g 2 ) for all g 1 , g 2 ∈ F q . For each b in F q , the function Tr(bx) for all x ∈ F q defines an additive character of F q . The character χ := χ 1 is called the canonical additive character of F q . It is clear that With each character χ of F q there is associated the conjugate character χ defined by χ (g) = χ(g) for all g ∈ F q . The orthogonal property of additive characters is given by Let F * q = F q \ {0} and ψ be a multiplicative character of F q , we define the Gauss sum over F q by For certain special characters, the associated Gauss sums can be evaluated explicitly. Let η and η p denote the quadratic multiplicative characters of F q and F p respectively. Then for x ∈ F * p , η(x) = 1 if m is even and η(x) = η p (x) if m is odd. The quadratic Gauss sums are known and given in the following lemma.
Coulter evaluated some Weil sums in [3], [4] given by (i) If m d is odd, then

C. THE PLESS POWER MOMENTS
Let C be a linear code of length n and dimension k. The first two Pless power moments are given as follows [15, p.259]: where (1, A 1 , A 2 , · · · , A n ) is the weight distribution of C and A ⊥ 1 is the number of codewords with Hamming weight 1 in its dual code C ⊥ . For the code C D defined by (1),

IV. THE PROOFS OF THE MAIN RESULTS
We present a few auxiliary results before proving the main results of this article. Lemma 8: Let Proof: By the orthogonal property of additive characters Then if m d is odd or m d ≡ 2 (mod 4),

mod 4) and d is odd,
If m d ≡ 0 (mod 4), Proof: By the orthogonal property of additive characters 0). Then we evaluate 1 through the following three cases.
From Lemmas 2 and 7 By above all we complete the proof.

Lemma 11:
If m is odd, then if p ≡ 3 (mod 4) and m + 1 2 is odd, Proof: By Lemma 1 Through Lemma 2 and (5) By Lemma 8 the code C D 1 has length n 1 = p 2m−1 . For a codeword c(a, b) = (Tr(ax + by)) (x,y)∈D 1 , (a, b) ∈ F 2 q \ {(0, 0)}, we will show that the Hamming weight of the codeword c(a, b) satisfies W H (c(a, b)) > 0, so the dimension of C D 1 is 2m. We start with the following equation: By Lemmas 4 and 12, if m d ≡ 0 (mod 4), either the equation is not solvable over F q or it is solvable and has a unique solution. Let γ a,b be some solution of (6) if it exists. Note that for a, z 2 ∈ F * p , the equation (−z 2 a)x p 2u +(−z 2 a)x = −(z 2 b) p u is equivalent to (6). For (a, b) It is clear that the Hamming weight of the codeword c(a, b) is If m is odd, by Lemma 5 By (5), (7), (8) and (9) we know that the three nonzero weights of C D 1 are From Lemma 11, if p ≡ 3 (mod 4) and m + 1 2 is odd, And by the first two Pless power moments we can obtain the multiplicities of the three nonzero weights of C D 1 . Through the above, we complete the proof of Theorem 1.
If m d is odd and d is even, by Lemma 5 From Lemma 1,

mod 4) and s is odd,
−p s , otherwise. And by (7), (8) and (10) we know that the three nonzero weights of C D 1 are Note that A w 2 + A w 3 = |{(a, b) ∈ F 2 q : a ∈ F * p }| = (p − 1)p m . We get the multiplicities of the three nonzero weights of C D 1 from the first two Pless power moments. Through the above, we complete the proof of Theorem 2. If By lemma 1, (18) and (19) we get the following results.
(i) If m d is odd, p ≡ 3 (mod 4) and d is odd, And from Lemma 10, we know that the two nonzero weights of C D 2 are w 1 = (p − 1)p 2m−2 , By the first two Pless power moments we have the multiplicities of the two nonzero weights of C D 2 .
(ii) If m d is odd and p, d satisfy the condition except that in (i), 3 Through Lemma 10, we have that the two nonzero weights of C D 2 are w 1 = (p − 1)p 2m−2 , based on the dual code C ⊥ corresponding to the minimal