Linear Codes Constructed from Two Weakly Regular Plateaued Functions with Index (p − 1)/2

Linear codes are the most important family of codes in cryptography and coding theory. Some codes only have a few weights and are widely used in many areas, such as authentication codes, secret sharing schemes and strongly regular graphs. By setting p≡1(mod4), we constructed an infinite family of linear codes using two distinct weakly regular unbalanced (and balanced) plateaued functions with index (p−1)/2. Their weight distributions were completely determined by applying exponential sums and Walsh transform. As a result, most of our constructed codes have a few nonzero weights and are minimal.


Introduction
Throughout the paper, we always let p be an odd prime.We will use the symbol F p to denote the finite field with p elements.A linear code C over F p with length n, dimension k and minimum distance d is said to have parameters [n, k, d], which means that C is a k-dimensional linear subspace of F n p with Hamming distance d.The code C is called projective if its dual code has minimum distance larger than 2. The Hamming weight of a codeword c, denoted by wt(c), is defined as the number of nonzero entries in c.Let A w = #{c ∈ C : wt(c) = w} for 0 w n.Then the sequence (A 0 , A 1 , A 2 , . . ., A n ) stands for the weight distribution of C, where A 0 = 1.The code C is called t-weight if the number of nonzero A w for 1 w n equals t.The weight distribution is of vital importance since it contains the information of computing the error probability of error detection and correction.In recent decades, a large number of linear codes have been investigated, most of which have a few weights and good parameters [3,4,7,8,10,12,16,17,22,23,25,26].The construction of linear codes is usually based on different functions, such as, Boolean functions [3], bent functions [19,26], square functions [20] and weakly regular plateaued functions [4,16,17].
Let us introduce an efficient way to construct linear codes, which was proposed by Ding et al. [5].Let q = p m for an integer m, and D be a subset of F * q of size n.Define where Tr is the absolute trace function.It can be checked that C D is a linear code of length n.The set D is called the defining set of C D .This approach is soon generalized by Li et al. [11], who defined a class of codes by where the defining set D is a subset of F 2 q \{(0, 0)} of size n.Based on this method, Wu et al. [21] offered a new approach to linear codes using the defining set D = (x, y) ∈ F 2 q \{(0, 0)} : f (x) + g(y) = 0 , where f and g are weakly regular bent functions from F q to F p .Later, Cheng et al. in [4] introduced several linear codes C D of (1.1) with a few weights by considering f and g to be weakly regular unbalanced s-plateaued functions in the defining set (1.2), where 0 s m.In 2022, Sınak [18] went deeper by choosing weakly regular unbalanced and balanced s f -plateaued function f and s g -plateaued function g in the defining set (1.2), where 0 s f , s g m.All of them studied the indexes of functions f and g among the set {2, p − 1}, that is, Along the research line studied in [4,18,21], we further consider the index of p−1 2 , where p ≡ 1 (mod 4).Now the defining set is denoted by where f and g are weakly regular unbalanced and balanced s-plateaued and t-plateaued functions, respectively, for 0 s, t m.For clarity, we only concentrate on the case l g = p−1 2 and l f ∈ {2, p−1 2 , p − 1}, where p ≡ 1 (mod 4).In this paper, we consider the constructed codes C D f,g of (1.1) and (1.3).In details, we will determine their parameters and their weight distributions using Walsh transform.Their punctured codes are also determined.As we will show later, they are projective, and some of them are optimal since they meet the Griesmer bound.
The rest of this paper is arranged as follows.We firstly present in Section 2 an introduction to the mathematical foundations, including cyclotomic fields and weakly regular plateaued functions.Section 3 gives necessary results for our computation.Our main results are proposed in Section 4, where we study the weight distributions and the parameters of our constructed codes and their punctured ones.Section 5 shows the minimality and applications of these codes.
Finally, we conclude the whole paper in Section 6.

Mathematical background
In this section, we give a brief exposition of exponential sums, cyclotomic fields, cyclotomic classes and weakly regular plateaued functions.First of all, we set up notation and terminology.Let q = p m for an integer m 2. The set of square (resp.non-square) elements in F * p is denoted by S q (resp.N sq ).Let η be the quadratic character of F p , that is,

Cyclotomic classes and cyclotomic fields
Let θ be a fixed primitive element of F q and N 2 be a divisor of q − 1.
The cyclotomic classes of order N in F q are defined by C (N,q) i = θ i θ N for i = 0, 1, . . ., N − 1, where θ N stands for the subgroup of F * q generated by θ N .Obviously, we have and every cyclotomic class has the same number of elements, that is #C The following lemma enunciates useful properties of this field.

Lemma 1. ([9]) The following assertions hold for
(2) The field extension K/Q is Galois of degree p − 1, and the Galois group p for all a ∈ F p .

Exponential sums
In this subsection, we briefly sketch the concept of exponential sums.Let η m denote the quadratic character of F q , where q = p m .The quadratic Gauss sum over F q is defined by where is the canonical additive character of F q , and Tr is the absolute trace function.From Theorem 5.15 in [13], For n ∈ N and a ∈ F * q , the Jacobsthal sum is defined by Define It is a companion sum related to Jacobsthal sums because I 2n (a) = I n (a) + H n (a), which is due to Theorem 5.50 in [13].We can evaluate easily that I 1 (a) = 0 and I 2 (a) = −1 for all a ∈ F * q .In general, the sums I n (a) can be described in terms of Jacobi sums.
Lemma 2 (Theorem 5.51, [13]).For all a ∈ F * q and n ∈ N, we have where λ is a multiplicative character of F q of order d = gcd(n, q − 1), and Lemma 3 (Theorem 5.33, [13]).Let q = p m be odd and

Weakly regular plateaued functions
We now introduce weakly regular plateaued functions and review some basic facts about them.Let f : F q → F p be a p-ary function.For β ∈ F q , the Walsh transform of f is defined as a complex-valued function A p-ary function f is called to be balanced if it satisfies χ f (0) = 0; otherwise, it is called unbalanced over F q .
As a natural extension of bent functions, Zheng et al. firstly set up the concept of plateaued functions in characteristic 2 in [24], and later Mesnager [14] gave a general version of any characteristic p. Several years ago, Mesnager et al. presented the notion of (non)-weakly regular plateaued functions in their work [15].We follow the notation used in [15].For each β ∈ F q , a function Applying the Parseval identity, one gets the absolute Walsh distribution of plateaued functions.
Lemma 4. (Lemma 1, [14]) Let f be an s-plateaued function.Then for β ∈ F q , | χ f (β)| 2 takes the value p m+s for p m−s times and the value 0 for p m − p m−s times.
From Lemma 4, the cardinality of S f is given by #S f = p m−s .
Definition 1. ( [15]) Let f be an s-plateaued function, where 0 s m.Then, f is called weakly regular s-plateaued if there exists a complex number u having unit magnitude such that p } for all β ∈ F q , where g is a p-ary function over F q satisfying g(β) = 0 for all β ∈ F q \ S f .Otherwise, if u depends on β with |u| = 1, then f is called nonweakly regular s-plateaued.Particularly, a weakly regular plateaued function f is said to be regular plateaued if u = 1.
Lemma 5. (Lemma 5, [15]) Let β ∈ F q and f be a weakly regular s-plateaued function.For every β ∈ S f we have where ε f ∈ {±1} is the sign of χ f and f ⋆ is a p-ary function over F q with f ⋆ (β) = 0 for all β ∈ F q \ S f .We call f ⋆ the dual function of f .
We now introduce two non-trivial subclasses of weakly regular plateaued functions.Let f be a weakly regular unbalanced (resp.balanced) s-plateaued function with 0 s m.We denote by WRP (resp.WRPB) the subclass of the unbalanced (resp.balanced) functions f that meet the following homogeneous conditions simultaneously: 1. f (0) = 0; 2. There exists a positive integer h, such that 2 | h, gcd(h − 1, p − 1) = 1 and Remark 1.For every f ∈ WRP (resp.f ∈ WRPB), we have 0 ∈ S f (resp. The following lemmas, due to [16] and [18], play a significant role in calculating the parameters of our constructed codes.Lemma 6. (Lemma 6, [16]) for every β ∈ S f .Then, for every z ∈ F * p , zβ ∈ S f if β ∈ S f , and otherwise, zβ ∈ F q \S f .Lemma 7. (Propositions 2 and 3, [16] , where l f is an even positive integer with gcd(l f − 1, p − 1) = 1.We call l f the index of f .Lemma 8. (Lemma 10, [16] When m − s is even, we have Otherwise, Lemma 9. (Lemma 3.12, [18]) Let f, g ∈ WRP or f, g ∈ WRPB, with for α ∈ S f and β ∈ S g , respectively.Define Then we have Lemma 10. (Lemma 3.7, [18]) Let n = #D f,g , where D f,g is defined by (1.3) with f and g be as in Lemma

Auxiliary results
To get the frequencies of codewords in the constructed codes, we will need several lemmas which are depicted and proved in the sequel.
Lemma 11.Let p ≡ 1 (mod 2).For the quadratic character η over F p , we have Proof.Notation that −1 ∈ S q when p ≡ 1 (mod 4), and −1 ∈ N sq when p ≡ 3 (mod 4).It follows that The first assertion then follows from the fact that I 2 (1) = −1.The second one is analogously proved and is omitted here.
Lemma 12. Let p ≡ 1 (mod 4) and f, g ∈ WRP or f, g ∈ WRPB, with for every α ∈ S f and every β ∈ S g , respectively.Suppose that s + t is odd.Write Proof.We only calculate B Sq and omit the other.Now suppose that 2 ∤ m − s where N f and N g are computed in Lemma 8.It follows that where Observe that u−v 2 = 0 in (3.1).If we write c = u−v 2 = 0, then from Lemma 8, The desired assertion then follows from Lemmas 8 and 11.

The calculation of N 0
To compute the weights of codewords in our codes, it suffices to determine the values of N 0 in (4.1), which are stated in Lemmas 13, 14 and 15.
and for (a, b) ∈ S f × S g , we have the following assertions.When l f = p−1 2 , we have When l f = p − 1, we have When l f = 2 and p ≡ 1 (mod 8), we have When l f = 2 and p ≡ 5 (mod 8), we have , otherwise, where I 4 is a companion sum determined in Lemma 2.
Proof.Let 2 ∤ s + t.By definition in (4.1) and the orthogonal property of group characters, x,y∈Fq z∈Fp x,y∈Fq where we write x,y∈Fq z∈F * p h∈F * p ζ p z(f (x)+g(y))+hTr(ax+by) .
It follows that So we always have We observe from its definition that Obviously, when (a, b) / ∈ S f × S g , then from Lemma 6 (ha, hb) / ∈ S f × S g for every h ∈ F * p .Hence χ f (ha) = 0 or χ g (hb) = 0, and consequently by (4.3) When (a, b) ∈ S f × S g , then (ha, hb) ∈ S f × S g for every h ∈ F * p .By (4.3), Lemmas 1, 5 and 7, we obtain In the following, we will apply Lemmas 1 and 3 to determine ∆ 2 in (4.4) by considering the cases of l f = 2, l f = p−1 2 and l f = p − 1, separately.
(1) The first case we consider is = 1 if h ∈ S q , and −1 otherwise.So we have from (4.4) that (2) The second case is that l f = p − 1.
In this case, h p−1 = 1 for every h ∈ F * p .By (4.4), we have (3) The last case is that l f = 2 and it is distinguished between two subcases.

Subcase (a):
. So from (4.4), Replacing −z by z in the last double sum above, we obtain . So from (4.4), , then the equation h 2 f ⋆ (a) + g ⋆ (b) = 0 has exactly two solutions h 1 , h 2 in S q , where h , then the inequality h 2 f ⋆ (a) + g ⋆ (b) = 0 holds for all h in S q .
Consequently, if f ⋆ (a)g ⋆ (b) = 0, then Proof.The proof is completed in a manner analogous to the previous lemma by noting that 2 | s + t.From (4.2) and (4.3), where We always have Then the value of ∆ 2 in (4.4) is determined by distinguishing the cases of l f = 2, (2) The second case is that l f = p − 1.
Again from (4.4), we have (3) The last case is that l f = 2 and we need only consider two different subcases.
Theorem 1. Suppose that f, g ∈ WRP or f, g ∈ WRPB with l g = p−1 2 .Let s + t be odd.If linear code with its weight distribution listed in Table 3.If l f = 2 and p ≡ 5 ] linear code with its weight distribution listed in Table 4.
Proof.From Lemma 10, the length is where N 0 is given by Lemma 13.To be more precise, for each (1) When l f = p−1 2 , we have where T (i) and T (j) are computed in Lemma 9 for i ∈ S q and j ∈ N sq .This leads to the weight distribution in Table 1. ( where the numbers B Sq and B Nsq are computed in Lemma 12, and for i ∈ S q , j ∈ N sq , and N f and N g are given in Lemma 8.The weight distribution in Table 2 is then established. (3) When l f = 2 and p ≡ 1 (mod 8), we have where for i ∈ S q and j ∈ N sq .Thus we get the weight distribution listed in Table 3.
(4) When l f = 2 and p ≡ 5 (mod 8), we have The weight distribution of this case is summarized in Table 4.
] linear code with its weight weight frequency weight frequency Table 3: The weight distribution of C D f,g in Theorem 1 when l f = 2 and p ≡ 1 (mod 8).
weight frequency Table 4: The weight distribution of C D f,g in Theorem 1 when l f = 2 and p ≡ 5 (mod 8).
weight frequency distribution listed in Table 5.If linear code with its weight distribution listed in Table 6.Otherwise if ] linear code with its weight distribution listed in Table 7 when p ≡ 1 (mod 8), and in Table 8 when p ≡ 5 (mod 8).Here we Proof.The length of the code C D f,g comes from Lemma 10.For (a, b) ∈ By Lemma 4, the frequency of such codewords equals p 2m −p γ since f, g ∈ WRP.
(1) When l f = p−1 2 , we have where T (0) and T (c) are given in Lemma 9 for c = 0.This gives the weight distribution in Table 5.
(2) When l f = p − 1, we have where we define Thus we obtain the weight distribution in Table 6.
(3) When l f = 2 and p ≡ 1 (mod 8), we have where for i ∈ S q and j ∈ N sq .This implies the weight distribution listed in Table 7.
(4) When l f = 2 and p ≡ 5 (mod 8), we get where we write for i ∈ S q and j ∈ N sq .Thus the result in Table 8 is derived.weight frequency weight frequency Table 7: The weight distribution of C D f,g in Theorem 2 when l f = 2 and p ≡ 1 (mod 8).
weight frequency weight frequency weight frequency weight frequency When f, g ∈ WRPB, the weight distributions in Tables 9 and 11 coincide with the results of Tables 6 and 7 in [18], respectively.

The punctured code
In the following, we study the punctured code from C D f,g by deleting some coordinates of each codeword.As we can see from Tables 1, 3, 5 and 9, the length and each nonzero Hamming weight have p − 1 as a common divisor.
This suggests that they can be punctured into shorter ones.Let f ∈ WRP or f ∈ WRPB.For any x ∈ F q , we obtain f (x) = 0 if and only if f (zx) = 0 for all z ∈ F * p , since f (zx) = z h f (x) for an even integer h with gcd(h − 1, p − 1) = 1.Thus we can select a subset D f,g = {(x, y) : (x, y) ∈ D f,g } from D f,g in (1.3), such that z∈F * p zD f,g = D f,g forms a partition of D f,g .Hence, we get the punctured code C Df,g from C D f,g .Moreover, the code C Df,g is projective since the minimum distance of its dual C ⊥ D f,g is at least 3 as checked in [4].We can also find some optimal codes when they meet certain specific conditions.
The following results related to the weight distributions of C D f,g follow directly from Tables 1, 3, 5 and 9, respectively.Remember that τ = 2m + s + t and γ = 2m − s − t.
Corollary 1. Suppose that f, g ∈ WRP or f, g ∈ WRPB with l g = p−1 2 .Let s + t be odd and d⊥ be the minimum distance of C ⊥ D f,g .Then d⊥ 3.

Moreover, if l
, 2m] linear code with its weight distribution listed in Table 13, and if l f = 2 and p ≡ 1 (mod 8), , 2m] linear code with its weight distribution listed in Table 14, where E 3 and E 4 are computed in Theorem 1.
Corollary 2. Suppose that f, g ∈ WRP with l f = l g = p−1 2 and s + t is even.Let d⊥ be the minimum distance of C ⊥ and the weight enumerator 1 + 520z 80 + 104z 100 .Its punctured code C Df,g has parameters [26,4,20] and the weight enumerator 1 + 520z 20 + 104z 25 .The punctured code is optimal with respect to the Griesmer bound.

Minimality of the codes and their applications
Any linear code can be applied to design secret sharing schemes by considering the access structure.However, the access structure based on a linear code is usually very complicated, and only can be determined exactly in several specific cases.One such case is when the code is minimal.
A linear code C over F p is called minimal if every nonzero codeword c of C solely covers its scalar multiples zc for z ∈ F * p .In 1998, Ashikhmin and Barg [1] provided a well-known criteria for minimal linear codes.Theorem 4. We have the following bounds on parameters of the code C D f,g .
(3) The linear codes described in Tables 9, 10, 11 and 12 are minimal provided when ε f ε g ∈ {±1} and 2m − s − t 4. It should be noticed that the minimum distance of C ⊥ D f,g equals 2 since there are two linearly dependent entries in each codeword in C D f,g .So under the framework stated in [6], the minimal codes described in Theorems 1, 2 and 3 can be employed to construct high democratic secret sharing schemes with new parameters.The punctured codes are projective and minimal, as we have discussed previously.So they are also suitable for secret sharing schemes.The projective three-weight codes in Tables 13, 15 and 16 can be applied to design association schemes [2].

Conclusion
The paper studied the construction of linear codes using defining set from two weakly regular plateaued functions with index p−1 2 for p ≡ 1 (mod 4), and hence, this is an extension of the results in [4], [18] and [21].The punctured codes were also investigated and we found optimal codes among them.Moreover, our codes are suitable for designing association schemes and secret sharing schemes.

Lemma 16 .
(Ashikhmin-Barg  Bound[1]) Let C be a linear code over F p .Then all nonzero codewords of C are minimal, provided thatw min w max > p − 1 p ,where w min and w max stand for the minimum and maximum nonzero weights in C, respectively.Now we will show under what circumstances the constructed linear codes are minimal according to Lemma 16.

Remark 3 .
Our punctured codes C D f,g are minimal for almost all cases.

Table 1 :
The weight distribution of C D f,g in Theorem 1 when

Table 5 :
The weight distribution of C D f,g in Theorem 2 when l f = p−1 2 .

Table 11 :
The weight distribution of C D f,g in Theorem 3 when l f = 2 and p ≡ 1 (mod 8).

Table 12 :
The weight distribution of C D f,g in Theorem 3 when l f = 2 and p ≡ 5 (mod 8).