A class of three-weight and five-weight linear codes

Report 1 Downloads 55 Views
manuscript No. (will be inserted by the editor)

A class of three-weight and five-weight linear codes

arXiv:1509.06242v1 [cs.IT] 21 Sep 2015

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

Received: date / Accepted: date

Abstract Recently, linear codes with few weights have been widely studied, since they have applications in data storage systems, communication systems and consumer electronics. In this paper, we present a class of three-weight and five-weight linear codes over Fp , where p is an odd prime and Fp denotes a finite field with p elements. The weight distributions of the linear codes constructed in this paper are also settled. Moreover, the linear codes illustrated in the paper may have applications in secret sharing schemes. Keywords Linear code · Weight distribution · Gaussian sums · Weight enumerator · Secret sharing. Mathematics Subject Classification (2010) 94B05, 94B60

This research is supported by a National Key Basic Research Project of China (2011CB302400), National Science Foundation of China (61379139) and the “Strategic Priority Research Program” of the Chinese Academy of Sciences, Grant No. XDA06010701 and Foundation of NSSFC(No.13CTJ006). F. Li 1. School of Statistics and Applied Mathematics, Anhui University of Finance and Economics, Bengbu City, Anhui Province, 233030, China E-mail: [email protected] Q. Wang, 2. State Key Laboratory of Information Security, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, 100195, China 3. University of Chinese Academy of Sciences, Beijing 100049, China E-mail: [email protected] D. Lin 2. State Key Laboratory of Information Security, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, 100195, China E-mail: [email protected]

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

2

1 Introduction and main results Let q = pm for an odd prime p and a positive integer m > 2. Denote Fq = Fpm the finite field with pm elements and F∗q = Fq \{0} the multiplicative group of Fq . An (n, M ) code C over Fp is a subset of Fnp of size M . Among all kinds of codes, linear codes are studied the most, since they are easier to describe, encode and decode than nonlinear codes. A [n, k, d] code C is called linear code over Fp if it is a k-dimensional subspace of Fnp with minimum (Hamming) distance d. Usually, the vectors in C are called codewords. The (Hamming) weight wt(c) of a codeword c ∈ C is the number of nonzero coordinates in c. The weight enumerator of C is a polynomial defined by 1 + A1 x + A2 x2 + · · · + An xn , where Ai denotes the number of codewords of weight i in C. The weight distribution (A0 , A1 , . . . , An ) of C is of interest in coding theory and a lot of researchers are devoted to determining the weight distribution of specific codes. A code C is called a t-weight code if |{i : Ai 6= 0, 1 ≤ i ≤ n}| = t. For the past decade years, a lot of codes with few weights are constructed [3,7,9,10]. Furthermore, there is much literature on the weight distribution of some special linear codes[1,3,5,7,13,14,21,22]. Let D = {d1 , d2 , . . . , dn } ⊆ Fq . A linear code CD of length n over Fp is defined by CD = {(Tr(xd1 ), Tr(xd2 ), . . . , Tr(xdn )) : x ∈ Fq }, where Tr denotes the absolute trace function over Fq . The set D is called the defining set of this code CD . This construction was proposed by Ding et al. (see [4,9]) and is used to obtain linear codes with few weights [10,16,17,20]. In this paper, we set D = {x ∈ F∗q : Tr(x2 + x) = 0} = {d1 , d2 , . . . , dn },

CD = {cx = (Tr(xd1 ), Tr(xd2 ), . . . , Tr(xdn )) : x ∈ Fq }

(1.1)

and determine the weight distribution of the proposed linear codes CD of (1.1). The parameters of the introduced linear codes CD of (1.1) are described in the following theorems. The proofs of the parameters will be presented later. Table 1: The weight distribution of the codes of Theorem 1 Weight w 0 (p − 1)pm−2 (p − 1)pm−2 + p−1 (p − 1)G (p − 1)pm−2 + p−1 (p − 2)G

Multiplicity A 1 pm−2 − 1 + p−1 (p − 1)G 2(p − 1)pm−2 − p−1 (p − 1)G (p − 1)2 pm−2

A class of three-weight and five-weight linear codes

3

Theorem 1 Let m > 2 be even with p | m. Then the code CD of (1.1) is a [pm−1 − 1 + p−1 (p − 1)G, m] linear code with weight distribution in Table 1, m(p−1) m where G = −(−1) 4 p 2 . Example 2 Let (p, m) = (3, 6). Then the corresponding code CD has parameters [260, 6, 162] and weight enumerator 1 + 98x162 + 324x171 + 306x180 . Theorem 3 Let m be even with p ∤ m. Then the code CD of (1.1) is a [pm−1 − p−1 G − 1, m] linear code with weight distribution in Table 2, where m(p−1) m G = −(−1) 4 p 2 . Example 4 Let (p, m) = (3, 4). Then the corresponding code CD has parameters [29, 4, 18] and weight enumerator 1 + 44x18 + 30x21 + 6x24 . This code is optimal according to the codetables in [11].

Table 2: The weight distribution of the codes of Theorem 3. Weight w 0 (p − 1)pm−2 − p−1 G (p − 1)pm−2 (p − 1)pm−2 − 2p−1 G

Multiplicity A 1 (p − 1)(2pm−2 + p−1 G) 1 (p − 1)(pm−1 − G) + pm−2 − 1 2 1 2 (p − 3p + 2)(pm−2 + p−1 G) 2

Table 3: The weight distribution of the codes of Theorem 5. Weight w 0 (p − 1)pm−2

Multiplicity A 1 pm−1 − 1

(p − 1)pm−2 + p (p −

1)pm−2



m−3 2

m−3 p 2

(p − 1)pm−2 − (p − (p −

1)pm−2

+ (p −

m−3 1)p 2 m−3 1)p 2

1 (p 2 1 (p 2 1 (p 2 1 (p 2

− 1)2 pm−2 − 1)2 pm−2 m−1 2

)

m−1 p 2

)

− 1)(pm−2 + p −

1)(pm−2



Theorem 5 If m is odd and p | m, then the linear code CD of (1.1) has parameters [pm−1 − 1, m] and weight distribution in Table 3. Example 6 Let (p, m) = (3, 3). Then the corresponding code CD has parameters [8, 3, 4] and weight enumerator 1+6x4 +6x5 +8x6 +6x7 . This code is almost optimal, since the optimal linear code has parameters [8, 3, 5]. By Table 3, CD in Theorem 5 is a four weight linear code if and only if p = m = 3. Example 7 Let (p, m) = (5, 5). Then the corresponding code CD has parameters [624, 5, 480] and weight enumerator 1 + 300x480 + 1000x495 + 624x500 + 1000x505 + 200x520 .

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

4

Table 4: The weight distribution of the codes of Theorem 8. Weight w 0 (p − 1)pm−2 + (p − 1)pm−2

1 −m ( p )GG p

Multiplicity A 1 (p − 1)(pm−2 − p−2 ( −m )GG) p pm−2 + p−2 ( −m −1 )(p − 1)GG p

(p − 1)pm−2 + ( −m )p−2 (p − 1)GG p −m −2 m−2 (p − 1)p + ( p )p (p + 1)GG

1 (p 2 1 (p 2

(p − 1)pm−2 + p−2 ( −m )GG p

(p − 1)pm−2 + p−2 ( −m )(p − 1)2 GG p

− 1)(pm−1 − ( −m )p−1 GG) p m−2 − 1)(p − 2)(p − ( −m )p−2 GG) p

Theorem 8 If m is odd  and p ∤ m, then the linear code CD of (1.1) has m−1 −1 −m GG − 1, m] and weight distribution in Table 4, parameters [p +p p  (m+1)(p−1) m+1 · 4 p 2 . where · is the Legendre symbol and GG = (−1)

Example 9 Let (p, m) = (3, 5). Then the corresponding code CD has parameters [71, 5, 42] and weight enumerator 1+30x42 +60x45 +90x48 +42x51 +20x54 . We remark that this linear code is near optimal, since the corresponding optimal linear codes has parameters [71, 5, 42]. Remark: In Theorem 8, if m = 3 and p ≡ 2 mod 3, the frequency of weight (p − 1)pm−2 turns to be zero. Hence, in this case CD is a four-weight linear code with weight distribution in Table 5.

Example 10 Let (p, m) = (5, 3). Then the corresponding code CD has parameters [19, 3, 14] and weight enumerator 1 + 36x14 + 24x15 + 60x16 + 4x19 . This code is optimal according to the datatables in [11].

Table 5: The weight distribution of CD , when m = 3 and p ≡ 2 (mod 3). Weight w 0 p2 − 2p p2 − 2p + 1 p2 − 2p − 1 p2 − p − 1

Multiplicity A 1 p2 − 1 1 p(p2 − 1) 2 1 (p − 2)(p2 − 1) 2 p−1

2 Preliminaries In this section, we review some basic notations and results of group characters and present some lemma which are needed for the proof of the main results. An additive character χ of Fq is a mapping from Fq into the multiplicative group of complex numbers of absolute value 1 with χ(g1 g2 ) = χ(g1 )χ(g2 ) for all g1 , g2 ∈ Fq [15].

A class of three-weight and five-weight linear codes

5

By Theorem 5.7 in [15], for b ∈ Fq , χb (x) = e



√ −1Tr(bx) p

,

for all x ∈ Fq

(2.1)

defines an additive character of Fq , and all additive characters can be obtained in this way. Among the additive characters, we have the trivial character χ0 defined by χ0 (x) = 1 for all x ∈ Fq ; all other characters are called nontrivial. The character χ1 in (2.1) will be called the canonical additive character of Fq [15]. The orthogonal property of additive characters can be found in [15] and is given as below  X q, if χ is trivial, χ(x) = 0, if χ is nontrivial. x∈Fq

Characters of the multiplicative group F∗q of Fq are called multiplicative character of Fq . By Theorem 5.8 in [15], for each j = 0, 1, . . . , q − 2, the function ψj with ψj (g k ) = e2π

√ −1jk/(q−1)

for k = 0, 1, . . . , q − 2

defines a multiplicative character of Fq , where g is a generator of F∗q . For j = (q − 1)/2, we have the quadratic character η = ψ(q−1)/2 defined by  −1, if 2 ∤ k, k η(g ) = 1, if 2 | k. In the sequel, we assume that η(0) = 0. We define the quadratic Gauss sum G = G(η, χ1 ) over Fq by X G(η, χ1 ) = η(x)χ1 (x), x∈F∗ q

and the quadratic Gauss sum G = G(η, χ1 ) over Fp by X G(η, χ1 ) = η(x)χ1 (x), x∈F∗ p

where η and χ1 denote the quadratic and canonical character of Fp , respectively. The explicit values of quadratic Gauss sums are given as follows. Lemma 11 ([15], Theorem 5.15) Let the symbols be the same as before. Then √ (p−1)2 m √ √ (p−1)2 √ G(η, χ1 ) = (−1)(m−1) −1 4 q, G(η, χ1 ) = −1 4 p. Lemma 12 ([9], Lemma 7) Let the symbols be the same as before. Then 1. if m ≥ 2 is even, then η(y) = 1 for each y ∈ F∗p ; 2. if m is odd, then η(y) = η(y) for each y ∈ F∗p .

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

6

Lemma 13 ([15], Theorem 5.33) Let χ be a nontrivial additive character of Fq , and let f (x) = a2 x2 + a1 x + a0 ∈ Fq [x] with a2 6= 0. Then X  χ(f (x)) = χ a0 − a21 (4a2 )−1 η(a2 )G(η, χ). x∈Fq

Lemma 14 Let the symbols be the same as before. For y ∈ Fp∗ , we have  (p − 1)G, if 2 | m and p | m,    X X 2 −G, if 2 | m and p ∤ m, ζpyTr(x +x) = 0, if 2 ∤ m and p | m,   y∈F∗  p x∈Fq η(−m)GG, if 2 | m and p ∤ m.

Proof It follows from Lemma 13 that X X X X 2 ζpyTr(x +x) = χ1 (yx2 + yx) y∈F∗ p x∈Fq

y∈F∗ p x∈Fq

 y χ1 − η(y) 4 ∗

X

=G

y∈Fp

=G

X



η(y)ζp

yTr(1) 4

.

y∈F∗ p

It is obviously that Tr(1) = m =



0, if p | m, 6= 0, otherwise.

Consequently,

X X

y∈F∗ p x∈Fq

ζpyTr(x

2

+x)

 P G y∈F∗ η(y),    P p − ym  4 G , ∗ ζp Py∈Fp = η(y), G  y∈F∗  p   − ym   η(−m)G P ym ζp 4 , y∈F∗ η − 4 p

if 2 | m and p | m, if 2 | m and p ∤ m, if 2 ∤ m and p | m, if 2 ∤ m and p ∤ m.

Using Lemma 12, we get this lemma.

Lemma 15 Let the symbols be the same as before. For b ∈ Fq∗ , let X X X B= χ1 (yx2 + yx + bzx). ∗ y∈F∗ p z∈Fp x∈Fq

Then 1. if Tr(b2 ) 6= 0 and Tr(b) = 0, we have  −(p − 1)G,    2  η mTr(b2 ) GG + G, B= 2  η −Tr(b ) (p   − 1)GG,  −η −Tr(b2 ) + η(−m))GG,

if if if if

2|m 2|m 2∤m 2∤m

and and and and

p | m, p ∤ m, p | m, p ∤ m;

A class of three-weight and five-weight linear codes

7

2. if Tr(b2 ) 6= 0 and Tr(b) 6= 0, we have  2  η(−1)GG − (p − 1)G,     G,    2 2 2 B = η(mTr(b )2− (Tr(b)) )GG + G,  −η(−Tr(b ))GG,    2  ))(p − 1) − η(−m))GG, (η(−Tr(b    −(η(−Tr(b2 )) + η(−m))GG,

if if if if if if

2 | m and p | m, 2 | m, p ∤ m and 2 | m, p ∤ m and 2 ∤ m and p | m, 2 ∤ m, p ∤ m and 2 ∤ m, p ∤ m and

(Tr(b))2 = mTr(b2 ), (Tr(b))2 6= mTr(b2 ), (Tr(b))2 = mTr(b2 ), (Tr(b))2 6= mTr(b2 );

3. if Tr(b2 ) = 0 and Tr(b) 6= 0, we have  −(p − 1)G,    G, B=  0,   −η(−m)GG,

if if if if

2|m 2|m 2∤m 2∤m

and and and and

p | m, p ∤ m, p | m, p ∤ m;

4. if Tr(b2 ) = 0 and Tr(b) = 0, we have

 (p − 1)2 G,    −(p − 1)G, B= 0,    η(−m)(p − 1)GG,

if if if if

2|m 2|m 2∤m 2∤m

and and and and

p | m, p ∤ m, p | m, p ∤ m.

Proof We only give the proof of the first part since the remaining parts are similar. By Lemma 13, we have

  (y + bz)2 B=G η(y)χ1 − 4y ∗ y∈F∗ p z∈Fp   2 2  y X X bz b z − =G χ1 − η(y)χ1 − 4 4y 2 ∗ ∗ X X

y∈Fp

=G

z∈Fp

 y  X − Tr(b2 )z2 − Tr(b)z 2 . η(y)χ1 − ζp 4y 4 ∗ ∗

X

y∈Fp

z∈Fp

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

8

Note that in the first part, Tr(b2 ) 6= 0 and Tr(b) = 0. Therefore,    y X Tr(b2 )z 2 χ1 − B=G η(y)χ1 − 4 4y z∈F∗ y∈F∗ p p    y X  y X X Tr(b2 )z 2 =G η(y)χ1 − χ1 − −G η(y)χ1 − 4 4y 4 y∈F∗ y∈F∗ z∈Fp p p  y  y X X χ1 (0)η(−Tr(b2 )y)G − G η(y)χ1 − =G η(y)χ1 − 4 4 y∈F∗ y∈F∗ p p  y  y X X = η(−Tr(b2 ))GG η(y) − G η(y)χ1 − η(y)χ1 − 4 4 y∈F∗ y∈F∗ p p P P  η(−Tr(b2 ))GG y∈F∗p η(y) − G y∈F∗p 1, if   my      η(mTr(b2 ))GG P ∗ χ1 − my η − my − G P ∗ ζp− 4 , if y∈Fp 4 4 P P y∈Fp = if  η(−Tr(b2 ))GG y∈F∗p 1 − G y∈F∗p η(y),   my my   P P − −  ζp 4 , if η(−Tr(b2 ))GG y∈F∗ ζp 4 − Gη(−m) y∈F∗ η − my 4 X

p

Combining Lemma 12 and the equation the first part.

p

P

ζpy y∈F∗ p

2 | m and p | m, 2 | m and p ∤ m, 2 ∤ m and p | m, 2 ∤ m and p ∤ m.

= −1, we get the result of

Lemma 16 For a ∈ Fp , let N (0, a) = {x ∈ Fq : Tr(x2 ) = 0, Tr(x) = a}. Then 1. if a 6= 0, we have  m−2 , if p | m, p if 2 | m and p ∤ m, |N (0, a)| = pm−2 + p−1 G,  m−2 p − p−2 η(−m)GG, if 2 ∤ m and p ∤ m; 2. if a = 0, we have  m−2 −1   pm−2 + p (p − 1)G,  p , |N (0, 0)| = m−2 p ,    m−2 p + p−2 η(−m)(p − 1)GG,

if if if if

2|m 2|m 2∤m 2∤m

and and and and

p | m, p ∤ m, p | m, p ∤ m.

Proof We only prove the first statement of this lemma, since the other statements can be similarly proved.

A class of three-weight and five-weight linear codes

9

For a ∈ F∗p , we have    X X X 2  |N (0, a)| = p−2 ζpyTr(x )   ζpz(Tr(x)−a)  y∈Fp

x∈Fq

= p−2

X

x∈Fq



1 +

= pm−2 + p−2

z∈Fp

X

y∈Fp∗

+p

ζpyTr(x )  1 +

X X

y∈Fp∗ −2

2



X

z∈Fp∗

2

ζpyTr(x ) + p−2

x∈Fq

X X X



ζpz(Tr(x)−a) 

X X

z∈Fp∗

ζpz(Tr(x)−a)

x∈Fq

2 ζpTr(yx +zx)−za

y∈Fp∗ z∈Fp∗ x∈Fq

= pm−2 + p−2

X X

y∈Fp∗

χ1 (yx2 ) + p−2

x∈Fq

X X

y∈Fp∗

ζp−za

z∈Fp∗

X

χ1 (yx2 + zx).

x∈Fq

By Lemma 13, we obtain X X X X X |N (0, a)| = pm−2 + p−2 χ1 (yx2 ) + p−2 χ1 (yx2 + zx) ζp−za y∈Fp∗ x∈Fq

= pm−2 + p−2

X

y∈Fp∗

χ1 (0)η(y)G + p−2

y∈Fp∗ z∈Fp∗

X X

x∈Fq

ζp−za χ1 (−

y∈Fp∗ z∈Fp∗

z2 )η(y)G 4y

 P P P if p | m  pm−2 + p−2 G y∈Fp∗ η(y) + p−2 G y∈Fp∗ z∈Fp∗ ζp−za η(y), mz 2 = P P P − −2  pm−2 + p−2 G G y∈F ∗ z∈F ∗ ζp−za η(y)ζp 4y , if p ∤ m y∈Fp∗ η(y) + p p p  m−2 p , if p | m    mz 2  P P − 4y m−2 + p−2 (p − 1)G + p−2 G y∈F ∗ z∈F ∗ ζp−za ζp , if 2 | m and p ∤ m = p p  p  − mz2  m−2 P P 2  p + p−2 η(−m)G y∈F ∗ z∈F ∗ ζp−za η − mz ζp 4y , if 2 ∤ m and p ∤ m 4y p p  m−2 , if p | m, p m−2 −1 p + p G, if 2 | m and p ∤ m, =  m−2 −2 p − p η(−m)GG, if 2 ∤ m and p ∤ m.

Lemma 17 Let

N (0, 0) = {x ∈ Fq : Tr(x2 ) = 0 and Tr(x) 6= 0}, N (0, 0) = {x ∈ Fq : Tr(x2 ) 6= 0 and Tr(x) 6= 0},

Then we get

N (0, 0) = {x ∈ Fq : Tr(x2 ) 6= 0 and Tr(x) = 0}.

1.  if p | m,  (p − 1)pm−2 ,  if 2 | m and p ∤ m, |N (0, 0)| = (p − 1) pm−2 + p−1 G ,   (p − 1) pm−2 − p−2 η(−m)GG , if 2 ∤ m and p ∤ m;

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

10

2.

3.

 if p | m,  (p − 1)2 pm−2 , if 2 | m and p ∤ m, |N (0, 0)| = (p − 1)2 pm−2 − (p − 1)p−1 G,  (p − 1)2 pm−2 + (p − 1)p−2 η(−m)GG, if 2 ∤ m and p ∤ m;  (p − 1)pm−2 − p−1 (p − 1)G,    (p − 1)pm−2 , |N (0, 0)| =  (p − 1)pm−2 ,   (p − 1)pm−2 − p−2 η(−m)(p − 1)GG,

if if if if

2|m 2|m 2∤m 2∤m

and and and and

p | m, p ∤ m, p | m, p ∤ m.

Proof By the definitions, we have

|N (0, 0)| + |N (0, 0)| = pm−1 , X |N (0, a)|, |N (0, 0)| = a∈Fp∗

|N (0, 0)| + |N (0, 0)| = pm − pm−1 . Then the desired results follow from Lemma 16. Lemma 18 Suppose p ∤ m and let V = {x ∈ Fq : Tr(x) 6= 0 and (Tr(x))2 = mTr(x2 )}. Then |V | =



(p − 1)pm−2 , if 2 | m, (p − 1)pm−2 + p−2 η(−m)(p − 1)2 GG, if 2 ∤ m.

Proof For c ∈ F∗p , set Sc = {x ∈ Fp : Tr(x) = c and Tr(x2 ) = c2 /m}. Then |V | =

X

c∈Fp∗

|Sc |.

By definition, we have    X X y(Tr(x2 )− c2 ) X m   |Sc | = p−2 ζp ζpz(Tr(x)−c)  x∈Fq

= p−2

X

x∈Fq

y∈Fp



1 +

= pm−2 + p−2

z∈Fp

X

y∈Fp∗

2



y(Tr(x2 )− cm )  1 ζp

X X

y∈Fp∗ x∈Fq

+

z∈Fp∗

2

y(Tr(x2 )− cm )

ζp

X

+ p−2



ζpz(Tr(x)−c) 

X X X

y∈Fp∗ z∈Fp∗ x∈Fq

2

Tr(yx2 +zx)− yc m −zc

ζp

.

A class of three-weight and five-weight linear codes

Let

  2 y Tr(x2 )− cm , ζp

X X

sc =

11

y∈Fp∗ x∈Fq

X X X

sc =

2

Tr(yx2 +zx)− yc m −zc

ζp

.

y∈Fp∗ z∈Fp∗ x∈Fq

It is straightforward to have that sc =

X

2

− yc m

ζp

X

χ1 (yx2 ).

x∈Fq

y∈Fp∗

By Lemma 13, we obtain sc =

X

2

− yc m

ζp

χ1 (0)η(y)G

y∈Fp∗

=

  GP

2

− yc m

if 2 | m   yc2 2 − yc ζp m , if 2 ∤ m y∈F ∗ η − m

ζp P

y∈Fp∗

,

  η(−m)G p  −G, if 2 | m, = η(−m)GG, if 2 ∤ m.

(2.2)

Meanwhile, sc =

X X

y∈Fp∗

=

2

− yc m −zc

ζp

z∈Fp∗

X X

y∈Fp∗ z∈Fp∗

X

χ1 (yx2 + zx)

x∈Fq 2 − yc m

ζp

−zc

 2 z η(y)G. χ1 − 4y

Hence, X

c∈Fp∗

 2 X − yc2 −zc z χ1 − η(y) ζp m 4y y∈Fp∗ z∈Fp∗ c∈Fp∗     2  2 X X X X X z z yc2 η(y) η(y) =G − zc − G χ1 − χ1 − χ1 − 4y m 4y c∈Fp y∈Fp∗ z∈Fp∗ y∈Fp∗ z∈Fp∗   2   2 X X X X z mz 2 z η(y)χ1 η(y) =G χ1 − η(−my)G − G χ1 − 4y 4y 4y ∗ ∗ ∗ ∗

sc = G

X X

y∈Fp z∈Fp

= η(−m)GG

y∈Fp z∈Fp

X X

y∈Fp∗ z∈Fp∗

=



η(y)η(y) − G

X X

2 − mz 4y

ζp

η(y)

y∈Fp∗ z∈Fp∗

(p − 1)G, if 2 | m, η(−m)(p − 1)2 GG − η(−m)(p − 1)GG, if 2 ∤ m.

(2.3)

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

12

We get |V | =

X

|Sc | =

X

pm−2 + p−2

c∈Fp∗

=

X

(pm−2 + p−2 sc + p−2 sc )

c∈Fp∗

c∈Fp∗

X

sc + p−2

c∈Fp∗

X

sc .

c∈Fp∗

By (2.2) and (2.3), we get this lemma. 3 Proof of main results In this section, we will present a class of linear codes with three weights and five weights over Fp . Recall that the defining set considered in this paper is defined by D = {x ∈ F∗q : Tr(x2 + x) = 0}. Let n0 = |D| + 1. Then   X X 2 1  n0 = ζpyTr(x +x)  p x∈Fq

= pm−1 +

y∈Fp

1 X X yTr(x2 +x) ζp . p ∗ x∈Fq y∈Fp

Define Nb = {x ∈ Fq : Tr(x2 + x) = 0 and Tr(bx) = 0}. Let wt(cb ) denote the Hamming weight of the codeword cb of the code CD . It can be easily checked that wt(cb ) = n0 − |Nb |. (3.1) For b ∈ F∗q , we have    X X X 2  |Nb | = p−2 ζpyTr(x +x)   ζpzTr(bx)  y∈Fp

x∈Fq

= p−2

X

x∈Fq



1 +

= pm−2 + p−2

z∈Fp

X

y∈Fp∗

X X

y∈Fp∗

+ p−2 =p

+p

z∈Fp∗

−2

2

+x)  

1+

ζpyTr(x

2

+x)

X

z∈Fp∗

+ p−2

x∈Fq

X X X

y∈Fp∗ m−2

ζpyTr(x



ζpzTr(bx) 

X X

z∈Fp∗

ζpTr(yx

2



ζpzTr(bx)

x∈Fq

+yx+bzx)

x∈Fq

X X

y∈Fp∗ x∈Fq

ζpyTr(x

2

+x)

+ p−2

X X X

ζpTr(yx

2

+yx+bzx)

.

y∈Fp∗ z∈Fp∗ x∈Fq

(3.2)

A class of three-weight and five-weight linear codes

13

Our task in this section is to calculate n0 , |Nb | and give the proof of the main results.

3.1 The first case of three-weight linear codes In this subsection, suppose 2 | m and p | m. To determine the weight distribution of CD of (1.1), the following lemma is needed. Lemma 19 Let b ∈ F∗q . Then  m−2 p ,   

if Tr(b2 ) = 0 and Tr(b) 6= 0 or Tr(b2 ) 6= 0 and Tr(b) = 0, m(p−1) m−2 |Nb | = m−2 p − (−1) 4 (p − 1)p 2 , if Tr(b2 ) = 0 and Tr(b) = 0,    m−2 m(p−1) m−2 p − (−1) 4 p 2 , if Tr(b2 ) 6= 0 and Tr(b) 6= 0. Proof The desired result follows directly from (3.2), Lemmas 11, 14 and 15. We omit the details. After the preparations above, we proceed to prove Theorem 1. By Lemma 14, if 2 | m and p | m, we have n0 = pm−1 + p−1 (p − 1)G. Combining (3.1), (3.2) and Lemma 19, we get wt(cb ) = n0 − |Nb |  ∈ (p − 1)pm−2 + p−1 (p − 1)G, (p − 1)pm−2 , (p − 1)pm−2 + p−1 (p − 2)G . Set ω1 = (p − 1)pm−2 + p−1 (p − 1)G, ω2 = (p − 1)pm−2 ,

ω3 = (p − 1)pm−2 + p−1 (p − 2)G. By Lemma 19, we obtain Aω1 = |N (0, 0)| + |N (0, 0)|, Aω2 = |N (0, 0)| − 1, Aω3 = |N (0, 0)|.

Then the results in Theorem 1 follow from Lemmas 11 and 17.

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

14

3.2 The second case of three-weight linear codes In this subsection, assume 2 | m and p ∤ m. By (3.2), Lemmas 14 and 15, it is easy to get the following lemma. Lemma 20 Let b ∈ F∗q and the symbols be the same as before. Then we have  m−2 p ,      m−2 − p−1 G, |Nb | = p 2  m−2 p + p−2 η(mTr(b2 ) − (Tr(b))2 )GG ,    m−2 2 p + p−2 η(mTr(b2 ))GG ,

if Tr(b2 ) = 0 and Tr(b) 6= 0 or Tr(b2 ) 6= 0 and (Tr(b))2 = mTr(b2 ), if Tr(b2 ) = 0 and Tr(b) = 0, if Tr(b2 ) 6= 0 and (Tr(b))2 6= mTr(b2 ), if Tr(b2 ) 6= 0 and Tr(b) = 0.

We are now turning to the proof of Theorem 3. If 2 | m and p ∤ m, by Lemma 14, we have n0 = pm−1 − p−1 G. It follows from (3.1) and Lemma 20 that  wt(cb ) ∈ (p − 1)pm−2 − p−1 G, (p − 1)pm−2 , (p − 1)pm−2 − 2p−1 G . Suppose ω1 = (p − 1)pm−2 − p−1 G,

ω2 = (p − 1)pm−2 ,

ω3 = (p − 1)pm−2 − 2p−1 G. By Lemmas 17, 18 and 20, we have Aω1 = |N (0, 0)| + |V | = (p − 1)(2pm−2 + p−1 G). ⊥ It is easy to check that the minimum distance of the dual code CD of CD is equal to 2. By the first two Pless Power Moments([12], p. 260) the frequency Awi of wi satisfies the following equations:



Aw1 + Aw2 + Aw3 = pm − 1, w1 Aw1 + w2 Aw2 + w3 Aw3 = pm−1 (p − 1)n,

(3.3)

where n = pm−1 − p−1 G − 1. A simple calculation leads to the weight distribution of Table 2. The proof of Theorem 3 is completed.

A class of three-weight and five-weight linear codes

15

3.3 The first case of 5-weight linear codes In this subsection, set 2 ∤ m and p | m. By (3.2), Lemmas 14 and 15, we get the following lemma. Lemma 21 Let b ∈ F∗q , then  m−2 p ,    m−2  p − p−2 η(−1)GG,  m−2 + p−2 η(−1)GG, |Nb | = p  m−2  + p−2 η(−1)(p − 1)GG, p   m−2 p − p−2 η(−1)(p − 1)GG,

if if if if if

Tr(b2 ) = 0, Tr(b2 ) 6= 0, Tr(b2 ) 6= 0, Tr(b2 ) 6= 0, Tr(b2 ) 6= 0,

Tr(b) 6= 0, Tr(b) 6= 0, Tr(b) = 0, Tr(b) = 0,

η(Tr(b2 )) = 1, η(Tr(b2 )) = −1, η(Tr(b2 )) = 1, η(Tr(b2 )) = −1.

In order to determine the weight distribution of CD of (1.1) in Theorem 5, we need the next two lemmas. Lemma 22 (see [9], Lemma 9) For each c ∈ Fp , set uc = |{x ∈ Fq : Tr(x2 ) = c}|.

If m is odd, then uc = pm−1 + p−1 η(−1)η(c)GG. Lemma 23 Let m be odd with p | m. For each c ∈ F∗p , set vc = |{x ∈ Fq : Tr(x2 ) = c, Tr(x) = 0}|. Then vc = pm−2 + p−1 η(−1)η(c)GG. Proof The proof of this lemma is similar to that of Lemma 16 and we omit the details. Now we are ready to prove Theorem 5. Note that 2 ∤ m and p | m. By Lemma 14, we have n0 = pm−1 . It follows from (3.1) and Lemma 21 that wt(cb ) = n0 − |Nb |   1 1 m−2 m−2 m−2 ± 2 η(−1)(p − 1)GG . ∈ (p − 1)p , (p − 1)p ± 2 η(−1)GG, (p − 1)p p p Suppose ω1 = (p − 1)pm−2 ,

1 η(−1)GG, p2 1 ω3 = (p − 1)pm−2 − 2 η(−1)GG, p 1 ω4 = (p − 1)pm−2 − 2 η(−1)(p − 1)GG, p 1 ω5 = (p − 1)pm−2 + 2 η(−1)(p − 1)GG. p

ω2 = (p − 1)pm−2 +

16

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

By Lemmas 21, 22 and 23, we have Aω1 = pm−1 − 1 and the following system of equations:  1 m−1 −1   Aw2 + Aw4 = 12 (p − 1)(pm−1 + p−1 η(−1)GG),  Aw3 + Aw5 = 2 (p − 1)(p − p η(−1)GG), (3.4) 1 m−2 −1 (p − 1)(p + p η(−1)GG), = A  w 4  2  Aw5 = 21 (p − 1)(pm−2 − p−1 η(−1)GG).

Solving the system of equations of (3.4) proves the weight distribution of Table 3.

3.4 The second case of five-weight linear codes In this subsection, put 2 ∤ m and p ∤ m. The last auxiliary result we need is the following. Lemma 24 Let b ∈ F∗q and the symbols be the same as before. Then  m−2 p , if Tr(b2 ) = 0 and Tr(b) 6= 0,    m−2 −1  if Tr(b2 ) = 0 and Tr(b) = 0 + p η(−m)GG, p m−2 −2 2 |Nb | = p − p η(−Tr(b ))GG, if Tr(b2 ) 6= 0, Tr(b) 6= 0 and (Tr(b))2 6= mTr(b2 )   or Tr(b2 ) 6= 0 and Tr(b) = 0,    m−2 p + p−2 η(−m)(p − 1)GG, if Tr(b2 ) 6= 0, Tr(b) 6= 0 and (Tr(b))2 = mTr(b2 ).

Proof This lemma follows from (3.2), Lemmas 14 and Lemma 15,

With the help of preceding lemmas we can now prove Theorem 8. If 2 ∤ m and p ∤ m, by Lemma 14, we have n0 = pm−1 + p−1 η(−m)GG. By Lemma 24, we know wt(cb ) has five possible values. Let 1 w1 = (p − 1)pm−2 + η(−m)GG, w2 = (p − 1)pm−2 , p 1 w3 = (p − 1)pm−2 + 2 (pη(−m) + 1)GG, p 1 m−2 w4 = (p − 1)p + 2 (pη(−m) − 1)GG, p w5 = (p − 1)pm−2 + p−2 η(−m)GG. It follows from Lemmas 17, 18 and 24 that Aω1 = (p − 1)(pm−2 − p−2 η(−m)GG),

Aω2 = pm−2 + p−2 η(−m)(p − 1)GG − 1,

Aω5 = (p − 1)pm−2 + p−2 η(−m)(p − 1)2 GG,

A class of three-weight and five-weight linear codes

17

where Awi denotes the frequency of wi . It can be easily checked that the ⊥ minimum distance of the dual code CD of CD is equal to 2. By the first two Pless Power Moments ([12], p. 260) the frequency Awi of wi satisfies the following equations:  Aw1 + Aw2 + Aw3 + Aw4 + Aw5 = pm − 1, (3.5) w1 Aw1 + w2 Aw2 + w3 Aw3 + w4 Aw4 + w5 Aw5 = pm−1 (p − 1)n, where n = pm−1 + p−1 η(−m)GG − 1. A simple manipulation leads to the weight distribution of Table 4.

4 Concluding Remarks In this paper, we present a class of three-weight and five-weight linear codes. There is a survey on three-weight codes in [6]. A number of three-weight and five-weight codes were discussed in [2,3,8,9,10,17,19,20,21]. Let wmin and wmax denote the minimum and maximum nonzero weight of a linear code C. The linear code C with wmin /wmax > (p − 1)/p can be used to construct a secret sharing scheme with interesting access structures (see [18]). Let m ≥ 4. Then for the linear code CD of Theorem 1, we have (p − 1)pm−2 − (p − 2)p wmin = wmax (p − 1)pm−2

m−2 2

or

(p − 1)pm−2

(p − 1)pm−2 + (p − 2)p

m−2 2

.

It can be easily checked that

(p −

(p − 1)pm−2

1)pm−2

+ (p − 2)p

m−2 2

>

(p − 1)pm−2 − (p − 2)p (p − 1)pm−2

m−2 2

>

p−1 . p

Hence, p−1 wmin > . wmax p Let m ≥ 6. Then for the linear code CD of Theorem 3, we have (p − 1)pm−2 − 2p wmin = wmax (p − 1)pm−2

m−2 2

or

(p − 1)pm−2

(p − 1)pm−2 + 2p

m−2 2

.

Simple computation shows that

(p −

(p − 1)pm−2 1)pm−2

+ 2p

m−2 2

(p − 1)pm−2 − 2p > (p − 1)pm−2

Therefore, p−1 wmin > . wmax p

m−2 2

>

p−1 . p

Fei Li1 , Qiuyan Wang∗,2,3 , Dongdai Lin2

18

Let m ≥ 5. Then for the linear code CD of Theorem 5, we have m−3

p−1 (p − 1)pm−2 − (p − 1)p 2 wmin = . m−3 > m−2 wmax p (p − 1)p + (p − 1)p 2 Let m ≥ 5. Then for the linear code CD of Theorem 8, we have (p − 1)pm−2 − (p + 1)p wmin = wmax (p − 1)pm−2

m−3 2

or

(p − 1)pm−2

(p − 1)pm−2 + (p + 1)p

m−3 2

.

It is easy to show that

(p −

(p − 1)pm−2

1)pm−2

+ (p + 1)p

m−3 2

>

(p − 1)pm−2 − (p + 1)p (p − 1)pm−2

m−3 2

>

p−1 . p

Then we get wmin p−1 > . wmax p To sum up, the linear codes CD with m ≥ 5 can be employed to get secret sharing schemes. Acknowledgements. This research is supported by a National Key Basic Research Project of China (2011CB302400), National Natural Science Foundation of China (61379139), the “Strategic Priority Research Program” of the Chinese Academy of Sciences, Grant No. XDA06010701 and Foundation of NSSFC(No.13CTJ006).

References 1. S.-T. Choi, J.-Y. Kim, J.-S. No, and H. Chung, “Weight distribution of some cyclic codes,” in Proc. Int. Symp. Inf. Theory, pp. 2911–2913, 2012. 2. B. Courteau, J. Wolfmann, “On triple–sum–sets and two or three weights codes,” Discrete Mathematics, vol. 50, pp.179-191, 1984. 3. C. Ding, “A class of three-weight and four-weight codes,” in: C. Xing, et al. (Eds.), Proc. of the Second International Workshop on Coding Theory and Cryptography, in: Lecture Notes in Computer Science, vol. 5557, Springer Verlag, pp. 34-42, 2009. 4. C. Ding, “Linear codes from some 2-designs,” IEEE Trans. Inf. Theory, vol. 61, no. 6, pp. 3265-3275, 2015. 5. C. Ding, J. Luo, H. Niederreiter, “Two-weight codes punctured from irreducible cyclic codes,” in: Y. Li, et al. (Eds.), Proceedings of the First Worshop on Coding and Cryptography, World Scientific, Singapore, pp. 119-124, 2008. 6. C. Ding, C. Li, N. Li, and Z. Zhou, “Three-weight cyclic codes and their weight distributions,” submitted for publication. 7. C. Ding, J. Yang, “Hamming weights in irreducible cyclic codes,” Discrete Math., vol. 313, no. 4, pp. 434–446, 2013. 8. C. Ding, Y. Gao, Z. Zhou, “Five Families of Three-Weight Ternary Cyclic Codes and Their Duals,” IEEE Trans. Inf. Theory, vol. 59, no. 12, pp. 7940–7946, 2013. 9. K. Ding, C. Ding, “Bianry linear codes with three weights,” IEEE Communication Letters, vol. 18, no. 11, pp. 1879–1882, 2014. 10. K. Ding, C. Ding, “A class of two-weight and three-weight codes and their applications in secret sharing,” arxiv:1503,06512v1.

A class of three-weight and five-weight linear codes

19

11. M. Grassl, Bounds on the minumum distance of linear codes, avaiable online at http://www.codetables.de. 12. W. C. Huffman and V. Pless, Fundamentals of error-correcting codes, Cambridge: Cambridge University Press, 2003. 13. C. Li, Q. Yue, and F. Li, Hamming weights of the duals of cyclic codes with two zeros, IEEE Trans. Inf. Theory, vol. 60, no. 7, pp. 3895–3902, Jul. 2014. 14. C. Li, Q. Yue, and F. W. Fu, “Complete weight enumerators of some cyclic codes,” Des. Codes Cryptogr., DOI 10.1007/s10623-015-0091-5, 2015. 15. R. Lidl, H. Niederreiter, Finite fields. Cambridge University Press, New York (1997) 16. Q. Wang, K. Ding, R. Xue, “Binary linear codes with two weights” IEEE Communication Letters, vol. 19, no. 7, Jul. 2015. 17. C. Xiang, “A family of three-weight binary linear codes,” arxiv: 1505,07726 18. J. Yuan and C. Ding, “Secret sharing schemes from three classes of linear codes,” IEEE Trans. Inf. Theory, vol. 52, no. 1, pp. 206–212, 2006. 19. Z. Zhou, C. Ding, “A class of three–weight cyclic codes,” Finite Fields and Their Applications, vol. 25, pp. 79–93, 2014. 20. Z. Zhou, N. Li, C. Fan, T. Helleseth, “Linear codes with two or three weights from quadratic bent functions,” arxiv: 1505.06830 21. Z. Zhou, C. Ding, J. Luo, A. Zhang, “A family of five-weight cyclic codes and their weight enumerators,” IEEE Trans Inf. Theory, vol. 59, no. 10, pp. 6674–6682, 2013. 22. Z. Zhou, A. Zhang, C. Ding, M. Xiong, “The weight enumerator of three families of cyclic codes,” IEEE Trans. Inf. Theory, vol. 59, no. 9, pp. 6002–6009, 2013.