Article Contents
Article Contents

# Some two-weight and three-weight linear codes

• * Corresponding author: Chengju Li
Chengju Li was supported by the National Natural Science Foundation of China under Grant 11701179, the Shanghai Sailing Program under Grant 17YF1404300, and the Foundation of Science and Technology on Information Assurance Laboratory under Grant KJ-17-007.
Shudi Yang was supported by the National Natural Science Foundation of China under Grants 11701317 and 11431015, China Postdoctoral Science Foundation Funded Project under Grant 2017M611801, and Jiangsu Planned Projects for Postdoctoral Research Funds under Grant 1701104C.
• Let $\Bbb F_q$ be the finite field with $q = p^m$ elements, where $p$ is an odd prime and $m$ is a positive integer. For a positive integer $t$, let $D \subset \Bbb F_q^t$ and let $\mbox{Tr}_m$ be the trace function from $\Bbb F_q$ onto $\Bbb F_p$. We define a $p$-ary linear code $\mathcal C_D$ by

$\mathcal C_D = \{\textbf{c}(a_1,a_2, ..., a_t): a_1, a_2, ..., a_t ∈ \Bbb F_{p^m}\},$

where

$\textbf{c}(a_1,a_2, ..., a_t) = \big(\mbox{Tr}_m(a_1x_1+a_2x_2+···+a_tx_t)\big)_{(x_1,x_2, ..., x_t)∈ D}.$

In this paper, we will present the weight enumerators of the linear codes $\mathcal C_D$ in the following two cases:

1. $D = \{(x_1,x_2, ..., x_t) ∈ \Bbb F_q^t \setminus \{(0,0, ..., 0)\}: \mbox{Tr}_m(x_1^2+x_2^2+···+x_t^2) = 0\}$;

2. $D = \{(x_1,x_2, ..., x_t) ∈ \Bbb F_q^t: \mbox{Tr}_m(x_1^2+x_2^2+···+x_t^2) = 1\}$.

It is shown that $\mathcal C_D$ is a two-weight code if $tm$ is even and three-weight code if $tm$ is odd in both cases. The weight enumerators of $\mathcal C_D$ in the first case generalize the results in [17] and [18]. The complete weight enumerators of $\mathcal C_D$ are also investigated.

Mathematics Subject Classification: Primary: 94B05, 11T71; Secondary: 11T23.

 Citation:

• Table 1.  Weight enumerators of Theorem 3.2 for odd $tm$

 Weight Frequency 0 1 $(p-1)p^{tm-2}$ $p^{tm-1}-1$ $(p-1)(p^{tm-2}-p^{\frac {tm-3} 2})$ $\frac {p-1} 2(p^{tm-1}+p^{\frac {tm-1} 2})$ $(p-1)(p^{tm-2}+p^{\frac {tm-3} 2})$ $\frac {p-1} 2(p^{tm-1}-p^{\frac {tm-1} 2})$

Table 2.  Weight enumerators of Theorem 3.2 for even $tm$

 Weight Frequency 0 1 $(p-1)p^{tm-2}$ $p^{tm-1}+(-1)^{(\frac {m(p-1)} 4+1)t}(p-1)p^{\frac {tm-2} 2}-1$ $(p-1)\big(p^{tm-2}+(-1)^{(\frac {m(p-1)} 4+1)t}p^{\frac {tm-2} 2}\big)$ $(p-1)\big(p^{tm-1}-(-1)^{(\frac {m(p-1)} 4+1)t}p^{\frac {tm-2} 2}\big)$

Table 3.  Weight enumerators of Theorem 4.1 for odd $tm$

 Weight Frequency 0 1 $(p-1)p^{tm-2}$ $p^{tm-1}-1$ $(p-1)p^{tm-2}+(-1)^{\frac {(p-1)(tm+3)} 4}p^{\frac {tm-1} 2}+p^{\frac {tm-3} 2}$ $\frac {p-1} 2(p^{tm-1}+p^{\frac {tm-1} 2})$ $(p-1)p^{tm-2}+(-1)^{\frac {(p-1)(tm+3)} 4}p^{\frac {tm-1} 2}-p^{\frac {tm-3} 2}$ $\frac {p-1} 2(p^{tm-1}-p^{\frac {tm-1} 2})$

Table 4.  Weight enumerators of Theorem 4.1 for even $tm$

 $2 \nmid \big(\frac {m(p-1)} 4+1\big)t$ Weight Frequency 0 1 $(p-1)p^{tm-2}$ $\frac {p+1} 2p^{tm-1}-\frac {p-1} 2 p^{\frac {tm-2} 2}-1$ $(p-1)p^{tm-2}+2p^{\frac {tm-2} 2}$ $\frac {p-1} 2\big(p^{tm-1}+p^{\frac {tm-2} 2}\big)$

Table 5.  Weight enumerators of Theorem 4.1 for even $tm$

 $2 \mid \big(\frac {m(p-1)} 4+1\big)t$ Weight Frequency 0 1 $(p-1)p^{tm-2}$ $\frac {p+1} 2p^{tm-1}+\frac {p-1} 2 p^{\frac {tm-2} 2}-1$ $(p-1)p^{tm-2}-2p^{\frac {tm-2} 2}$ $\frac {p-1} 2\big(p^{tm-1}-p^{\frac {tm-2} 2}\big)$

Table 6.  Complete weight enumerators of Theorem 5.1 for odd $tm$

 $N_0=n-\sum_{\rho \in \Bbb F_p^*}N_\rho$ $N_\rho (\rho \in \Bbb F_p^*)$ Frequency 0 1 $p^{tm-2}$ $p^{tm-1}-1$ $p^{tm-2}-p^{\frac {tm-3} 2}$ $\frac {p-1} 2(p^{tm-1}+p^{\frac {tm-1} 2})$ $p^{tm-2}+p^{\frac {tm-3} 2}$ $\frac {p-1} 2(p^{tm-1}-p^{\frac {tm-1} 2})$

Table 7.  Complete weight enumerators of Theorem 5.1 for even $tm$

 $N_0=n-\sum_{\rho \in \Bbb F_p^*}N_\rho$ $N_\rho (\rho \in \Bbb F_p^*)$ Frequency 0 1 $p^{tm-2}$ $p^{tm-1}+(-1)^{(\frac {m(p-1)} 4+1)t}(p-1)p^{\frac {tm-2} 2}-1$ $p^{tm-2}+(-1)^{(\frac {m(p-1)} 4+1)t}p^{\frac {tm-2} 2}$ $(p-1)\big(p^{tm-1}-(-1)^{(\frac {m(p-1)} 4+1)t}p^{\frac {tm-2} 2}\big)$
•  [1] L. D. Baumert and R. J. McEliece, Weights of irreducible cyclic codes, Inf. Control, 20 (1972), 158-175.  doi: 10.1016/S0019-9958(72)90354-3. [2] B. Berndt,  R. Evans and  K. Williams,  Gauss and Jacobi Sums, John Wiley & Sons company, New York, 1998. [3] A. R. Calderbank and J. M. Goethals, Three-weight codes and association schemes, Philips J. Res., 39 (1984), 143-152. [4] A. R. Calderbank and W. M. Kantor, The geometry of two-weight codes, Bull. London Math. Soc., 18 (1986), 97-122.  doi: 10.1112/blms/18.2.97. [5] C. Carlet, C. Ding and J. Yuan, Linear codes from perfect nonlinear mappings and their secret sharing schemes, IEEE Trans. Inf. Theory, 51 (2005), 2089-2102.  doi: 10.1109/TIT.2005.847722. [6] C. Ding, Codes from Difference Sets, World Scientific, Singapore, 2015. [7] C. Ding, Linear codes from some 2-designs, IEEE Trans. Inf. Theory, 61 (2015), 3265-3275.  doi: 10.1109/TIT.2015.2420118. [8] C. Ding, T. Helleseth, T. Klove and X. Wang, A general construction of authentication codes, IEEE Trans. Inf. Theory, 53 (2007), 2229-2235.  doi: 10.1109/TIT.2007.896872. [9] C. Ding, C. Li, N. Li and Z. Zhou, Three-weight cyclic codes and their weight distributions, Discr. Math., 339 (2016), 415-427.  doi: 10.1016/j.disc.2015.09.001. [10] C. Ding, Y. Liu, C. Ma and L. Zeng, The weight distributions of the duals of cyclic codes with two zeros, IEEE Trans. Inf. Theory, 57 (2011), 8000-8006.  doi: 10.1109/TIT.2011.2165314. [11] C. Ding, J. Luo and H. Niederreiter, Two-weight codes punctured from irreducible cyclic codes, in Proceedings of the First Worshop on Coding and Cryptography (eds. Y. Li, et al. ), World Scientific, Singapore, 4 (2008), 119-124. doi: 10.1142/9789812832245_0009. [12] C. Ding and H. Niederreiter, Cyclotomic linear codes of order 3, IEEE Trans. Inf. Theory, 53 (2007), 2274-2277.  doi: 10.1109/TIT.2007.896886. [13] C. Ding and X. Wang, A coding theory construction of new systematic authentication codes, Theor. Comp. Sci., 330 (2005), 81-99.  doi: 10.1016/j.tcs.2004.09.011. [14] C. Ding and J. Yang, Hamming weights in irreducible cyclic codes, Discr. Math., 313 (2013), 434-446.  doi: 10.1016/j.disc.2012.11.009. [15] C. Ding and J. Yin, Algebraic constructions of constant composition codes, IEEE Trans. Inf. Theory, 51 (2005), 1585-1589.  doi: 10.1109/TIT.2005.844087. [16] K. Ding and C. Ding, Binary linear codes with three weights, IEEE Comm. Letters, 18 (2014), 1879-1882. [17] K. Ding and C. Ding, A class of two-weight and three-weight codes and their applications in secret sharing, IEEE Trans. Inf. Theory, 61 (2015), 5835-5842.  doi: 10.1109/TIT.2015.2473861. [18] C. Li, Q. Yue and F. W. Fu, A construction of several classes of two-weight and three-weight linear codes, Appl. Alg. Eng. Comm. Comp., 28 (2017), 11-30.  doi: 10.1007/s00200-016-0297-4. [19] S. Li, T. Feng and G. Ge, On the weight distribution of cyclic codes with Niho exponents, IEEE Trans. Inf. Theory, 60 (2014), 3903-3912.  doi: 10.1109/TIT.2014.2318297. [20] R. Lidl and  H. Niederreiter,  Finite Fields, Addison-Wesley Publishing Inc., 1983. [21] J. Luo and T. Helleseth, Constant composition codes as subcodes of cyclic codes, IEEE Trans. Inf. Theory, 57 (2011), 7482-7488.  doi: 10.1109/TIT.2011.2161631. [22] C. Ma, L. Zeng, Y. Liu, D. Feng and C. Ding, The weight enumerator of a class of cyclic codes, IEEE Trans. Inf. Theory, 57 (2011), 397-402.  doi: 10.1109/TIT.2010.2090272. [23] F. J. MacWilliams, C. L. Mallows and N. J. A. Sloane, Generalizations of Gleason's theorem on weight enumerators of self-dual codes, IEEE Trans. Inf. Theory, 18 (1972), 794-805.  doi: 10.1109/tit.1972.1054898. [24] F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, North-Holland, Amsterdam, 1977. [25] C. Tang, N. Li, Y. Qi, Z. Zhou and T. Helleseth, Linear codes with two or three weights from weakly regular bent functions, IEEE Trans. Inf. Theory, 62 (2016), 1166-1176.  doi: 10.1109/TIT.2016.2518678. [26] G. Vega, The weight distribution of an extended class of reducible cyclic codes, IEEE Trans. Inf. Theory, 58 (2012), 4862-4869.  doi: 10.1109/TIT.2012.2193376. [27] M. Xiong, The weight distributions of a class of cyclic codes, Finite Fields Appl., 18 (2012), 933-945.  doi: 10.1016/j.ffa.2012.06.001. [28] J. Yang, M. Xiong, C. Ding and J. Luo, Weight distribution of a class of cyclic codes with arbitrary number of zeros, IEEE Trans. Inf. Theory, 59 (2013), 5985-5993.  doi: 10.1109/TIT.2013.2266731. [29] S. Yang and Z. Yao, Complete weight enumerators of a class of linear codes, Discr. Math., 340 (2017), 729-739.  doi: 10.1016/j.disc.2016.11.029. [30] S. Yang, X. Kong and C. Tang, A construction of linear codes and their complete weight enumerators, Finite Fields Appl., 48 (2017), 196-226.  doi: 10.1016/j.ffa.2017.08.001. [31] J. Yuan and C. Ding, Secret sharing schemes from three classes of linear codes, IEEE Trans. Inf. Theory, 52 (2006), 206-212.  doi: 10.1109/TIT.2005.860412. [32] X. Zeng, L. Hu, W. Jiang, Q. Yue and X. Cao, The weight distribution of a class of p-ary cyclic codes, Finite Fields Appl., 16 (2010), 56-73.  doi: 10.1016/j.ffa.2009.12.001. [33] Z. Zhou, N. Li, C. Fan and T. Helleseth, Linear codes with two or three weights from quadratic Bent functions, Des. Codes Cryptogr., 81 (2016), 283-295.  doi: 10.1007/s10623-015-0144-9.

Tables(7)