1. Introduction
Linear codes with a few weights are extensively utilized in applications such as authentication codes [
1], secret sharing schemes [
2], association schemes [
3], and constant composition codes [
4]. Furthermore, these codes are closely linked to various mathematical constructs including strongly regular graphs, partial geometries, and projective point sets. Consequently, the development of linear codes with a few weights has become a vibrant area of interest within coding theory.
MacDonald codes fall into the category of linear codes distinguished by having two non-zero weights. The binary MacDonald codes were first introduced by MacDonald [
5], while MacDonald codes over finite fields were explored in ref. [
6]. Colbourn et al. in ref. [
7] studied the MacDonald codes over
. Furthermore, Dertli et al. in [
8] delved into the research of MacDonald codes over
with
, contributing to the comprehensive exploration of MacDonald codes across various mathematical structures. Afterwards, the research on the secret sharing scheme founded on the torsion codes of MacDonald codes over finite rings has drawn considerable attention [
9,
10,
11,
12]. Recently, secret sharing schemes using linear codes with a few weights were given in refs. [
13,
14,
15,
16]. Melakhessou et al. in ref. [
17] investigated the DNA multi-secret sharing schemes.
As we know, the complete weight enumerator has significant applications in authentication codes and constant composition codes. Over the years, the exploration of weight distributions of linear codes over finite fields and finite rings has received a great deal of attention [
18,
19,
20,
21,
22,
23,
24,
25]. Recently, the enumerator of weight for the torsion codes of MacDonald codes over
[
11] and
[
26] were studied. Moreover, the ring
outperforms
and
in terms of flexibility, computational efficiency, error correction capabilities, and applicability. Inspired by the above work, we take into account studying MacDonald codes and their torsion codes over
and the complete weight enumerator of two types of torsion codes, where
. As applications, the secret sharing schemes and systematic authentication codes were constructed.
The paper is outlined as below. In
Section 2, the algebraic structure of the torsion codes of the MacDonald codes of types
and
over
R is given. In
Section 3, we obtain the complete weight enumerator of
, and
. In
Section 4, as applications, we construct the secret sharing schemes and systematic authentication codes.
Section 5 makes a summary of the paper.
2. MacDonald Codes over
Set as a finite commutative non-chain ring with characteristic 2, where , , . Based on the Chinese Remainder Theorem, R can be expressed as . Furthermore, .
If
and
is an
R-submodule of
, then
is a linear code of length
n over
R. Set
as a linear code and
So
,
and
are all linear codes of length
n over
. The torsion codes of
are taken as
,
and
.
Set
as a type
simplex code over
R. The generator matrix
of
is built inductively. Set
as a
matrix and
. Then,
is built inductively as below
Set
, columns composed of all non-zero 2-ary
k-tuples, as the generator matrix of
simplex code
. The extended simplex code
is produced by
where
and
Proposition 1. The torsion code (or , ) of is equivalent under permutation to replicas of .
Proof. We demonstrate the
case by generalization on
k. The generator matrix of
is derived by using 1 to replace
in the matrix rows
. For
, it can be easily verified. If
is equivalent under permutation to
replicas of
, then we have
where
and
According to the hypothesis, we obtain that the size of
is
. Rearranging the columns, we achieve the result. □
The generator matrix
of simplex code
is able to be used to construct the MacDonald codes of type
over
R. For
, define
as the matrix derived from
by removing columns corresponding to the columns of
, i.e.,
where
represents the matrix derived by removing matrix
F from matrix
E, and
is an
matrix.
Definition 1. The code produced by is named as a type α MacDonald code.
Obviously, the code is a linear code of length over R. Denote as the torsion code of . The generator matrix of is derived using 1 to replace in the matrix . Likewise, we can obtain other torsion codes of by using 1 to replace or in or . By Proposition 1, we are aware that the three torsion codes are mutually equivalent. Therefore, we concentrate on .
The length of the simplex code of type is substantial and grows rapidly. We can eliminate certain columns from . A type simplex code is obtained from by removing some columns.
Set
as an
matrix. Make
and
then
is built inductively in the following manner
Set
as an
matrix. Make
and
then
is built inductively in the following manner
Set
as an
matrix. Make
and
then
is built inductively in the following manner
Set
as an
matrix. Make
and
then
is built inductively in the following manner
Set
as an
matrix. Make
and
then
is built inductively in the following manner
Set
as an
matrix. Make
and
then
is built inductively in the following manner
Set
as an
generator matrix of
. Make
then
is built inductively in the following manner
Proposition 2. The torsion codes , , and of are mutually equivalent.
Proof. The proof process parallels that of Proposition 1. □
Resembling the construction method of type
MacDonald codes, type
MacDonald codes can be constructed. For
, define
as the matrix derived from
by removing the columns corresponding to the columns of
, i.e.,
where
represents the matrix derived by removing matrix
F from matrix
E, and
is an
matrix.
Definition 2. The code produced by is named as a type β MacDonald code.
Denote as the torsion code of and is a linear code of length over R. The generator matrix of is derived using 1 to replace in the matrix . Likewise, we can obtain other torsion codes of by using 1 to replace or in and . According to Proposition 2, we are aware that the three torsion codes are mutually equivalent. Therefore, we concentrate on .
3. Complete Weight Enumerator of and
In this section, we are committed to exploring the complete weight enumerator of torsion codes and . First, we give the meaning of the complete weight enumerator of codes.
Denote
as 2 indeterminates. Suppose
is a code of length
n over
. For any
, the weight of
e at
is regarded as
The composition of
e is regarded as
. The complete weight enumerator of
is regarded as
In the interest of brevity, we employ to stand for the column count of the matrix G. Specifically, let , , , , , , . We employ to stand for the r-th row of the matrix G. Let denote the matrix derived from by substituting 1 for , and similarly, let represent the matrix obtained from by substituting 1 for , where serves as the generator matrix for the torsion code . Subsequently, we aim to establish the compositions of the r-th rows, denoted as and , across all indices r from 1 to k.
Lemma 1. For , the following is true: Proof. Through the process of constructing
, it follows that
. Hence,
. Due to
, we have
Moreover,
. Consequently,
□
The following conclusion can be derived directly from Lemma 1.
Proposition 3. - 1.
Provided that , , we have - 2.
Provided that , , we have
Proposition 4. For , we have Proof. Let
and
where the number of
in
and
is
. Let
Moving forward, we will explore the constructions of
and
in three different scenarios.
Case I:
,
. Let
where the number of
in
is
. Let
Then, we have
where the number of
A is
.
Case II:
,
and
. Let
where the number of
in
is
. Let
Then, we have
where the number of
A is
.
Case III:
,
. We have
where the number of
A is
.
Based on the constructions of and , we can ascertain the composition of for any .
Since 0 and 1 appear at the same time in
, then we have
and
. Consequently,
Concerning
, it is the case that
It follows that
For Case I, we obtain
The reasoning for the other two instances parallels that of Case I. Consequently, for
, we have
□
As a direct consequence of Proposition 4, the following corollary emerges.
Corollary 1. For , we have By leveraging Proposition 4 and Corollary 1, we can ascertain the complete weight enumerator of .
Theorem 1. The complete weight enumerator of iswhere . Proof. Given that the torsion code
constitutes a linear code of length
over
, and is generated by
, it follows that, for any codeword
, one can find
such that
. In accordance with Corollary 1, we infer that
, where
r indicates the greatest index for which
. Evidently, the quantity of codewords having a composition that matches
is
. Therefore, the complete weight enumerator of
is
□
Denote by , , , , , , the matrices derived from substituting 1 for in the original matrices , , , , , , , respectively. Similarly, let represent the matrix obtained from by substituting 1 for , where serves as the generator matrix for the torsion code . Subsequently, we aim to establish the compositions of the r-th rows, denoted as and , across all indices r from 1 to k.
Proof. For
,
, we have
Therefore,
For
,
, we have
Therefore,
For
,
, we have
Therefore,
For
,
, we have
Therefore,
For
,
, we have
Therefore,
For
,
, we have
Therefore,
For
,
, we have
Therefore,
□
From the constructions of , , , , , , and Lemma 2, we can obtain the compositions of , , , , , , for , .
Proof. Obviously, these results hold when
. Subsequently, we will demonstrate that the aforementioned results are applicable for any
. Based on the construction of
, the composition of
, for
, is
The verification procedures for the compositions of
and
parallel those for
.
Additionally, the compositions of
, for
, is
The verification procedures for the compositions of
and
parallel those for
.
The compositions of
, for
, is
□
Using Lemmas 2 and 3, we can deduce the composition of . For convenience, let , , , .
Proposition 5. For any , with , the composition of can be addressed under the three following scenarios.
Case II: When , we havewhere Case III: When , we havewhere Lemma 4. For , , we have Proof. Clearly, these results are valid for
. Suppose that
is valid for any
. When
, it is easy to verify that
When
, we have that
Therefore, for any
, we have
The verification procedures for the compositions of
and
parallel those for
.
Suppose that
is valid for any
. When
, it is easy to verify that
When
, we have that
Therefore, for any
, we have
The verification procedures for the compositions of
and
parallel those for
.
Suppose that
is valid for any
. When
, it is easy to verify that
When
, we have that
Therefore, for any
, we have
□
According to Lemma 4, the following results can be obtained.
Proposition 6. For any , , we have Proof. Case I: When
, we have
Case II: When
,
, we have
Case III: When
, we have
□
Directly from Proposition 6, the following corollary can be obtained.
Corollary 2. For , we have Theorem 2. The complete weight enumerator of is Proof. Given that
constitutes a linear code over
, and is generated by
, it follows that, for any codeword
, one can find
such that
. Let
r represent the highest index for which
. In accordance with Corollary 2, we infer that
Evidently, the quantity of codewords with a composition that matches
is
. Therefore, the complete weight enumerator of
is
□
Example 1. Let , . Using Proposition 5, we haveFrom Theorem 2, we derive the complete weight enumerator of as below Example 2. Let , . Using Theorem 2, we derive the complete weight enumerator of as below 4. Applications
This section delves into the applications of the complete weight enumerators of and in the secret sharing schemes and systematic authentication codes.
Massey in [
27] outlined the situation of constructing secret sharing schemes employing linear codes over finite field
. Consider
as an
linear code. Assume that
is the generator matrix of
. In the secret sharing scheme relying on
, the secret
. There are
participants, namely
,
, and a dealer involved.
For the purpose of calculating the shares related to e, the dealer randomly picks a vector such that . After that, the dealer takes as an information vector and calculates the relevant codeword and presents to participant as share for . Notice that . Plainly, a set of shares , and , decides the secret if and only if can be linearly represented by .
Lemma 5 ([
27])
. Assume that G is the generator matrix of an linear code . In the secret sharing scheme relying on , a set of shares , and , decides the secret if and only if there exists a codeword , where for no less than one t. Let D represent a set of participants. A subset can restore the secret by putting together their shares, any must also be able to restore the secret. is regarded as a minimal access set if can restore the secret while none of the subsets of can. In view of these facts, our focus is solely on the set of all minimal access sets. To identify this set, we should bring in the concept of minimal codewords.
Given a vector
, the support of
is specified as the set
. A codeword
covers codeword
if the support of
includes that of
. A non-zero codeword
is considered minimal if it covers only its scalar multiples and none other. From Lemma 5, the set of minimal access sets and the set of minimal codewords of the dual code
with the first component being 1 are in one-to-one correspondence. The covering problem of a linear code
aims to find all its minimal codewords, which is generally a difficult task. Despite this, it can be worked out for some special linear codes. Ding et al. in [
28] outlines the characteristics of the minimal access sets of the secret sharing scheme relying on
.
Lemma 6 ([
28])
. Suppose is an linear code and is its generator matrix. For any , if c is minimal, then the secret sharing scheme utilizing will have exactly minimal access sets. Additionally, the following holds true:- 1.
Provided that is a multiple of , participant must be included in every minimal access set, .
- 2.
Provided that is not a multiple of , participant must be included in among the minimal access sets, .
Moving forward, we will delve into the development of secret sharing schemes depending on the dual codes of torsion codes. Firstly, we must establish that every codeword in the torsion codes and is minimal.
Lemma 7 ([
29])
. Suppose is an linear code. Denote and as the minimum and maximum non-zero weights, respectively. If , then any is minimal. Consider and as the generator matrices for and , respectively. The following results are obtained.
Theorem 3. For the secret sharing scheme that is generated from , there exist participants and minimal access sets. In case the l-th column of is a multiple of the 0-th column, participant is contained in every minimal access set. In the contrary situation, participant is included in among minimal access sets.
Proof. We use
to represent the minimum weight and
to represent the maximum weight. According to Theorem 1,
and
. Then, we have
where
. From Lemma 7, we deduce that every codeword in
is minimal. This conclusion is further supported by Lemma 6. □
Theorem 4. For the secret sharing scheme that is generated from , there exist participants and minimal access sets. In case the l-th column of is a multiple of the 0-th column, participant is contained in every minimal access set. In the contrary situation, participant is included in among minimal access sets.
Proof. We use
to represent the minimum weight and
to represent the maximum weight. According to Theorem 2, we obtain
and
. Then
where
. From Lemma 7, we deduce that that every codeword in
is minimal. This conclusion is further supported by Lemma 6. □
Remark 1. As we know, constructing secret sharing schemes based on minimal codes presents the following two issues: security limitations and lack of scalability and flexibility. Although minimal codes have limitations in constructing secret sharing schemes, their theoretical significance, simplicity, and potential for optimization continue to make them valuable for research.
Example 3. We consider the torsion code .wherewhere Let be the matrix replacing by 1 in and be the matrix replacing by 1 in . Moreover, let , , , , , and be the matrices replacing by 1 in , , , , and , respectively. Then, we have
Hence, the generator matrix of is By using Magma [30], we are aware that is an linear code over . The result is consistent with Example 2. Next, we will establish secret sharing schemes with the basis of . In this case, there exist 315 participants and 4 minimal access sets. The four minimal access sets are given in the following manner.From Theorem 4, we obtain participants , is contained in every minimal access set. Meanwhile, the remaining participants, labeled as , must be in two among four minimal access sets. Next, we demonstrate how to construct the symmetric authentication codes using the complete weight distribution. A systematic authentication code is a quadruple
. Here,
represents the source state space which is associated with a probability distribution,
represents the tag space,
represents the key space, and
is regarded as an encoding rule. For additional insights, consult [
31]. We analyze two attack methods, impersonation and substitution attacks. Let
represent the maximum success probability for impersonation attack, and
for substitution attack. The design of authentication codes should be robust against the most challenging scenarios, requiring that
and
be minimized. There are two lower bounds provided to guide this optimization process [
32]:
If
, then the systematic authentication code is called optimal.
Utilizing the technique described in [
31], we make use of linear codes to design systematic authentication codes. Denote
as an
linear code over
with
p a prime, and
,
. A systematic authentication code is given in the following manner:
where
,
,
. From [
31], we know that
and
, where
represents the number of times that
y occurs in the codeword
b.
Since torsion codes and are linear codes over , then by the above method and Theorems 1 and 2, systematic authentication codes can be built.
Theorem 5. Denote as a linear code of length over , where , . Then It is clear that . Therefore, as k increases significantly, the authentication codes in Theorem 5 are asymptotically optimal.
Theorem 6. Denote as a linear code of length over , where , . Then Since
then as
k increases significantly, the authentication codes in Theorem 6 are asymptotically optimal.
5. Conclusions
In this paper, we explored the algebraic structure of the torsion codes of MacDonald codes of types and over , where , and , . We obtain the complete weight enumerator of and and their applications. Furthermore, if , then . Studying the torsion codes of MacDonald codes of types and and their applications over might be a job full of interest. Applying complete weight enumerator to the study of quantum codes and nonlinear codes will also be an interesting job.