THE WEIGHT DISTRIBUTION OF A CLASS OF p − ARY CYCLIC CODES AND THEIR APPLICATIONS

. Cyclic codes over ﬁnite ﬁeld have been studied for decades due to their wide applications in communication and storage systems. However their weight distributions are known only in a few cases. In this paper, we investigate a class of p − ary cyclic codes whose duals have three zeros, where p is an odd prime. The weight distributions of the class of cyclic codes for all distinct cases are determined explicitly. The results indicate that these codes contain ﬁve-weight codes, seven-weight codes and eleven-weight codes. Some of these codes are optimal. Moreover, the covering structures of the class of codes are considered and being used to construct secret sharing schemes.


Introduction
In this paper, we denote F p to be the finite field with characteristic and elements p, where p is an odd prime. An [n, k, d : p] linear code C over the finite field F p is a k−dimensional subspace of F n p with minimum Hamming distance d. Furthermore, the linear code C is called a cyclic code if any (c 0 , c 1 , ..., c n−1 ) ∈ C implies (c n−1 , c 0 , c 1 , ..., c n−2 ) ∈ C. Any cyclic code of length n over F p can be regarded as an ideal of the ring F p [x]/(x n − 1) and can be generated by a polynomial g(x). If g(x)|x n − 1 is monic and has the least degree, then we call g(x) the generator polynomial and call h(x) = (x n − 1)/g(x) the parity-check polynomial of C. A cyclic code with parity-check polynomial h(x) is called irreducible if h(x) is irreducible over F p , and is called reducible if h(x) is reducible over F p . Moreover, if h(x) has t irreducible factors over F p , we say that the duals of such a cyclic code to have t zeros, or such a cyclic code to have t nonzeros . The duals of any cyclic code C is defined by C ⊥ = {x ∈ F n p |x · y = 0, ∀ y ∈ C}, where x·y is the Euclidean inner product of x and y in F n p . The duals C ⊥ is a cyclic code with generator polynomial h(x) * , where h(x) * is the the reciprocal polynomial of h(x).
The number of codewords with Hamming weight i in C denoted by A i . The sequence {A 0 , A 1 , ..., A n } is said to be the weight distribution of the code C. The weight enumerator of code C is defined as follows: Moreover, a code C is called a t−weight code if the number of nonzero A i is equal to t.
Let m, k be two integers with 1 ≤ k ≤ m − 1 and s = m/d, where d = gcd(k, m) is the greatest common divisor of k and m. We denote h 1 (x) and h 2 (x) to be the minimal polynomials of α −1 and α −(p k +1) respectively, where α is the primitive element of F p m . It is known that the cyclic code C 1 with parity-check polynomial h 1 (x)h 2 (x) was first defined by Carlet et al. in [1] and then they determined the weight distribution of such cyclic code C 1 for odd s in [32]. Moreover, Li et al. gave the weight distributions of the code C 1 for odd s and the code C = {(f a,b,c (γ 0 )), (f a,b,c (γ 1 )), ..., (f a,b,c (γ m p−1 ))|a, b, c ∈ F p m } for odd s in theorem 1 and 2 of [15] respectively, where f a,b,c (x) = Tr(aΠ(x) + bx + c) is a function from F q m to F q with a perfect nonlinear function Π(x) over F q m . In 2015, Schmidt investigated the code C 1 with d = gcd(k, m) = 1 in [24]. Recently, Yang et al. explicitly established the weight distribution of the cyclic code C 1 for even s and the weight distribution of the cyclic code with parity-check polynomial (x − 1)h 2 (x) in [29]. However, the weight distribution of the cyclic code with parity-check polynomial (x − 1)h 1 (x)h 2 (x) for either odd or even s is not known before. In fact, Yang et al. proposed to study the question for future work in [29].
From now on, let C denote the cyclic code with parity-check polynomial (x − 1)h 1 (x)h 2 (x). In this paper, we give the weight distributions of C for both odd s and even s. The remainder of this paper is organized as follows. In Section 2, some basic concepts and results are introduced. Section 3 determined the weight distributions of the cyclic code C not only for odd s but also for even s. In Section 4, the covering structures of the cyclic code C are considered and being used to construct secret sharing schemes. Section 5 summarizes this paper.

Preliminaries
In this section, we present some basic notations and some important results which will be needed in the sequel.
x i a i for any x ∈ F q , where {a 1 , a 2 , ..., a m } is a basis of F q over F p and x i ∈ F p . A function Q(x) from F q to F p is called a quadratic form over F p if it has the following representation: where a i,j ∈ F p . The rank of the quadratic form Q(x) is defined as the codimension of the F p −vector space Any quadratic form over F p is equivalent to a diagonal quadratic form. So, by making a nonsingular linear substitution, we can obtain that where r is the rank of Q(x) and b i ∈ F * p . The following results about quadratic form are important and will be frequently used in the sequel, which have been given by Lidl and Niederreiter in [16].
Lemma 2.2. Let f be a nondegenerated quadratic form over F p , in l variables. Define a function υ(·) over F p by υ(0) = p − 1 and υ(ρ) = −1 for ρ ∈ F * p . Then for b ∈ F p the number of solutions of the equation f (x 1 , ..., where η is the quadratic character of F p and det(f ) is the determinant of the coefficient matrix of f .
The following lemma could be obtained by the reference [29]. For any non-zero integer e, the 2−adic order of e is the highest exponent υ such that 2 υ divides e, and is denoted by υ 2 (e). Let Q(x) = Tr(bx p k +1 ) be a quadratic form and b i be the nonzero element of the diagonal matrix of Q(x), where Tr is the absolute trace from F p m to F p . Then one of the following conclusions holds (1) If υ 2 (m) ≤ υ 2 (k), then rank(Q(x)) = m and denotes the largest integer that is less than or equal to m 2 . (2) If υ 2 (m) = υ 2 (k) + 1, then a) rank(Q(x)) = m and (3) If υ 2 (m) > υ 2 (k) + 1, then a) rank(Q(x)) = m and Proof. Combining Lemmas 3 and 4 of [29], we could obtain the lemma directly.
Then the number of solutions of Tr(ax + bx p k +1 ) + t = 0 for any t ∈ F * p , denoted by N t (a,b) , can be given as follows: (2) if the rank of the quadratic form Q(x) = Tr(bx p k +1 ) is even m, then a) when Proof.
(1) If rank(Q(x)) = m, then by making a nonsingularr linear substitution to Tr(ax + bx (1+p k ) ) + t = 0 , we have that From Lemma 2.2, we know that the number of solutions of the equation (1) is . Combining the discussion above, we First, let T ∈ F * p be a square (denoted as SQ), then, for any t ∈ F * p , the number of , and, when η (−1) Second, if T ∈ F * p is a nonsquare(denoted as NSQ), then with the similar method, we have T ∈N SQ t∈F * p N (T,t) given as follows: Therefore, combining the discussion above and Lemma 2.
(2) By simply modifying the proof above, if m is even, we get that Therefore, we can obtain that and s = m/gcd(m, k) be even. Then the number of solutions of Tr(ax + bx p k +1 ) + t = 0 for any t ∈ F * p , denoted by N t (a,b) , can be given as follows: Proof. In here, we just discuss the second case υ 2 (m) > υ 2 (k) + 1. The first case υ 2 (m) = υ 2 (k) + 1 can be investigated similarly.
times. Furthermore, by using the similar way with Lemma 2.4, we can obtain the results in a).
and it occurs p m −1 p d +1 times. In this case, the equation (1) can be reduced as So, by Lemma 2.2, we have Let N t and N (T,t) be defined as Lemma 2.4. When ). Therefore, in this subcase, we have N t (a,b) = From (3), we know that the dimension of C is 3m 2 + 1 if k = m 2 , otherwise, the dimension of C is 2m + 1. Moreover, by using the well-known Delsarte's Theorem [2], we have that where Tr denotes the absolute trace from F p m to F p . Therefore, for any codeword c(a, b, c) ∈ C, the Hamming weight of the codeword can be given by W(c(a, b, c)) = |{i : Tr(aα i + bα (p k +1)i + c) where ω is a p−th primitive root of unity. Furthermore, the equation above can be reduced as Let d = gcd(m, k) and s = m/d be odd. Note that s is odd if and only if υ 2 (m) ≤ υ 2 (k). So, by Lemma 2.3, we know that the rank of the quadratic form Q(x) is m. Next we give the parameters and the weight distribution of the cyclic code C for odd s in the following theorem. 2 ) − 1 : p], and its weight distribution is given by Table II.

TABLE I
Weight distribution of the cyclic code C for odd m in Theorem 3.1 Proof. The dimension of the cyclic code C follows from the discussion above. Now, we only need to determine the weight distribution of C for odd s. For any codeword c(a, b, c) ∈ C, the weight of the codeword c(a, b, c) is given by (4). First, we assume that m is odd. Next, we will consider the following two cases.
In this case, it can be easily seen that all the codewords c(a, b, c) formed a cyclic code C with parity-check polynomial h 1 (x)h 2 (x) for odd s. Therefore, from Theorem 1 of [31], we have Case B. when Tr(c) = t ∈ F * p : According to y∈F * p (ω t ) y = −1 and (4), we have where N t Therefore, the weight distribution of C can be obtained by the above discussion and given by Table I.
Second, we assume that m is even. Similarly, when Tr(c) = 0, we have which is the weight distribution of code C with even m. Next, we give the discussion on the case with Tr(c) = 0. According to 1) and 2) of the Case B above, in this case, we have W (c(a, b, c) This completes the proof.
Now, we will give some examples for the code C with odd s, whose weight distribution is not known before.  Table I. This is a known optimal cyclic code according to the Database.
Let d = gcd(m, k) and s = m/d be even. Notice that s is even if and only if υ 2 (m) ≥ υ 2 (k) + 1. So, by Lemma 2.3, we know that the rank of the quadratic form Q(x) is m or m − 2d. In the following, we determine the weight distribution of the cyclic code C as defined in Section 1 for even s. (1) If υ 2 (m) = υ 2 (k) + 1, then the cyclic code C has parameters [p m − 1, 2m + ) − 1 : p], and its weight distribution is given by Table III.
− 1 : p], and its weight distribution is given by Table IV.

TABLE III
Weight distribution of the cyclic code C for even m in Theorem 3.2 Proof. In here, we just consider the case υ 2 (m) > υ 2 (k) + 1. Clearly, the dimension of the cyclic code C is 2m + 1 as m = 2k. So, we only need to determine the weight distribution of C for even s as the following two cases. Case A. when Tr(c) = 0: In this case, we can find that the all codewords c(a, b, c) formed a cyclic code C with parity-check polynomial h 1 (x)h 2 (x) for even s. Therefore, from Theorem 1 of [29], we have Case B. when Tr(c) = t ∈ F * p : By using the same way with Theorem 3.1, we can obtain the other weights and their distributions according to Lemma 2.5. Corollary 1. Let s be even and m = 2k. Then the cyclic code C has parameters ) − 1 : p], and its weight distribution is given by Table V.

TABLE V
Weight distribution of the cyclic code C for even m in Corollary 1 Hamming Weight i So, the cyclic code C is degenerate for b. Moreover, in this case, it is clear that υ 2 (m) = υ 2 (k) + 1. So, we need substituting d = m/2 to Table III and dividing the number of b in N (a, b, t) by p m 2 . Then, in this case, we can get the weight distribution of C in Table V.
Corollary 2. Let s be even and m = 2. Then the cyclic code C has parameters [p 2 − 1, 4, (p − 1)p − 2 : p] and its weight distribution is given by Table VI.
Proof. Substituting m = 2 and d = 1 to Table V, we can obtain Table VI immediately.
We give some examples for the cyclic code C with even s, whose weight distributions are not known before.

Covering structures of code C and their applications
For any c = (c 0 , c 1 , ..., c n−1 ) ∈ F n p , the support of c is defined by the set {i|c i = 0, 0 ≤ i ≤ n − 1}. For any two vectors c , c ∈ F n p , it is called c covers c if the support of c contains the support of c . Furthermore, a nonzero codeword is said to be a minimal codeword if it covers only its multiples in a linear code. The set of all the minimal codewords in a linear code is called the covering structure of the code, which is closely related to the construction of secret sharing schemes(see [1], [7], [15], [31], [32]).
In this section, we first determine all the minimal codewords of the cyclic code C (i.e., the covering structures of C), and then consider the access structures of the secret sharing schemes based on the duals of C.
In order to determine the covering structures of the cyclic code C for either odd or even s, the following lemma is needed and has been given in [15]. Lemma 4.1. Let C be an [n, k, d : p] code. Then, the weight w of every minimal codeword must satisfy w ≤ n−k+1, and every codeword with weight w ≤ pd − p + 1 p − 1 must be a minimal codeword.
According to the weight distributions of C for both odd s and even s as determined in Section 3, the following two results about the minimal codewords of C can be obtained. Proof. Obviously, all the nonzero codewords with weight p m − 1 are not minimal, as the length of C is p m − 1. Next, we will give all the minimal codewords of the cyclic code C as the following two cases.
One way to construct secret sharing schemes by using linear codes have been proposed by Massey in [22] [23]. The detailed description about the construction is omitted here and can be found in [22] [23]. Moreover, the relationship between the minimal access sets of the secret sharing schemes based on C and the minimal codewords of the duals C ⊥ have been given by Massey [22] as follows.  (c) if m ≥ 5,the set of minimal access sets is equal to the set of access supports of the nonzero codewords in C with first coordinate 1 and not with weight p m − 1.
Theorem 4.6. Let p be an odd prime, m, k be two integers with 1 ≤ k ≤ m − 1 and s = m gcd(k,m) be even. Then the access structure of the secret sharing scheme based on C ⊥ is given as follows: (a) if m = 2 and p = 3, the set of minimal access sets is equal to the set of access supports of the nonzero codewords in C with first coordinate 1 and with weights 4 and 5; (b) if m = 2 and p > 3, the set of minimal access sets is equal to the set of access supports of the nonzero codewords in C with first coordinate 1 and not with weights p 2 − 1 and p 2 − 2; (c) if m = 2k, the set of minimal access sets is equal to the set of access supports of the nonzero codewords in C with first coordinate 1 and not with weight p m − 1; (d) if m = 4 and υ 2 (m) = υ 2 (k)+1 or m ≥ 6, the set of minimal access sets is equal to the set of access supports of the nonzero codewords in C with first coordinate 1 and not with weight p m − 1.

Conclusions
In this paper, we completely determined the weight distributions of a class of pary cyclic codes whose duals have three zeros for both odd s and even s, where p is an odd prime. The results show that these codes contain five-weight codes, seven-weight codes and eleven-weight codes. Some of these codes are optimal and new according to the Database. Moreover, the covering structures of the class of codes are considered and being used to construct secret sharing schemes.