1.
Introduction
The linear diffusion layer is widely used in the design of symmetric-key cryptography. It takes a crucial part in providing resistance against differential and linear cryptanalysis. If all square submatrices of a linear diffusion matrix are non-singular, then it is called a Maximum Distance Separable (MDS) matrix, and in other words, a perfect diffusion matrix with optimal diffusion property is called an MDS matrix. A typical application is in the MixColumns operation of AES [8]. Furthermore, except for block ciphers, MDS matrices are also broadly used in many other ciphers, such as Maelstrom-0 [11], PHOTON [12], SHARK [23], and Grϕstl [10]. There are several approaches to constructing MDS matrices, which can be applied as diffusion layers for block ciphers and hash functions. The first method is based on the algebraic structures such as Cauchy, Vandermonde, and Hadamard matrices (cf.; [13,18,20]). The next efficient method to be used in constructing MDS matrices is based on recursive construction (see [18,24,27], for more details). Also, a brief survey of various theories in the construction of MDS matrices is provided in [15].
Circulant matrices have attracted significant attention for the efficient construction of MDS matrices. A circulant matrix is a unique type of matrix in which each row vector is a cyclic shift of the previous row vector, rotated one element to the right. In the diffusion layer, circulant matrices are utilized by the Advanced Encryption Standard (AES) [8]. The advantage of circulant matrices is that they can be fully described by just n elements, instead of requiring storage of all n2 elements. In the study of circulant MDS matrices over finite fields, significant contributions have been made, as referenced in [1,14,15,21]. Han et al. [16] introduced a special generalization called block circulant matrices with circulant blocks. The authors demonstrated that block circulant matrices can perform better than circulant matrices in the implementation of the InvMixColumn operations. In 2021, Cui et al. [4] demonstrated that a Galois field is a subclass of a commutative ring, suggesting the possibility of finding more cost-effective MDS matrices within commutative rings rather than Galois fields. Taking this into account, Ali et al. [2] provided key insights into circulant MDS matrices over finite commutative rings of characteristic 2 and proved several important results regarding the non-existence of certain circulant MDS matrices over rings.
Inspired by the work of Han et al. [16] and Cui et al. [4], in the present article, we first derive the expression for the determinant of block circulant matrices over a finite commutative ring of characteristic 2. It is known that block circulant matrices can produce more efficient MDS matrices compared to circulant matrices. Using this expression, we construct block circulant MDS matrices of order 4×4 and 8×8 over rings. Furthermore, we examine the work of Khoo et al. [9], where they proposed analyzing the number of XOR operations required to compute the multiplication of a fixed element. For more studies related to implementation and d-XOR count, see the references [7,19,25]. In 2015, Sim et al. [26] proved the following result about the XOR-count:
Theorem A. [26,Theorem 1] The total XOR-count for a field GF(2n) is
This theorem proved that the sum of XORs of the elements of the finite field is invariant under the change of an irreducible polynomial of the same degree. Further, Sarkar and Sim [25] studied the XOR-count distribution under different bases of a finite field and proved the following:
Theorem B. [25,Proposition 2] The total XOR-count of the elements in GF(2n) is
and it is invariant under the choice of basis.
In 2021, Kesarwani et al. [18] extended the study of XOR count over a local rings. Using this result, we explore the XOR count distributions for two rings associated with two distinct reducible polynomials of the same degree and compare their corresponding XOR distributions. We obtain distinct XOR count distributions, which increase the probability of finding lightweight MDS matrices.
The organization of the paper is as follows: In Section 2, we start by explaining important terms like MDS matrices, circulant matrices, and block circulant matrices. Then, we show some interesting results about circulant matrices over finite commutative rings. We even figure out how to find the determinant of a circulant matrix over a ring of characteristic 2. In Section 3, we prove one of the main results about block circulant matrices in which we calculate their determinants. We even show how to make special 4×4 and 8×8 block circulant MDS matrices over ring. Further, we find out the condition when a ring Z2[x]⟨(f(x))2l⟩ contains a copy of finite field of order 2m, where m is the degree of irreducible polynomial f(x), and by using this result, we prove some results on MDS matrices over the ring F2[x]⟨(1+x+x3+x4+x8)2t⟩. We start Section 4, from the definition of XOR count of a finite field, and then we calculate the XOR count distribution of two rings, R1=F2[x]⟨(1+x2+x6)⟩ and R2=F2[x]⟨(1+x4+x6)⟩. In the last section, we wrap our study with some examples of MDS matrices and their XOR counts.
2.
Preliminaries
Some notations used throughout the paper are presented as follows:
In this section, we discuss some useful definitions such as MDS code, MDS matrix, circulant matrix, block circulant matrix and some important results. Throughout our paper, m,n,l,k,d,s, and t are positive integers.
Definition 1. [6] A linear code C(n,k) of length n and dimension k over R with minimum Hamming distance d satisfying d=n−k+1 is said to be a maximal distance separable (MDS) code.
Definition 2. A matrix Mn×n is an MDS matrix if and only if all its square submatrices are non-singular.
In 1997, Dong et al. [5] gave a matrix characterization of MDS codes over modules, which we state as follows:
Lemma 1. [5,Theorem 2.1] Let C(n,k) be a linear code over R with a parity check matrix H of the form H=(B|In−k). Then, C(n,k) is an MDS code if and only if the determinants of every t×t submatrix, t∈{1,2,…,min{k,n−k}} of B is an element of U(R).
Note that MDS matrices are perfect diffusion matrices with maximum branch number. A permutation layer with a good diffusion matrix in block cipher can improve the avalanche characteristics of the block cipher, which increases the cipher's resistance to differential and linear cryptanalysis [17]. The MDS matrices are extensively used in designing block ciphers and hash functions that provide security against differential and linear cryptanalysis.
Definition 3. Let R be a ring and bi∈R for all i=0,1,…,d−1. Then, any d×d matrix of the form
is called a circulant matrix of order d, and it is denoted by circ(b0,b1,b2,…,bd−1).
Since a circulant matrix can also be written as a polynomial in some suitable permutation matrix, we have the following result:
Lemma 2. [22,page 290] Let d≥1 be a fixed integer. Then, any circulant matrix B=circ(b0,b1,…,bd−1) of order d can be written in the form
Lemma 3. [21,Theorem 3.1.1] Let A be a matrix of order d and T=circ(0,1,0,…,0) be a matrix of order d. Then, A is a circulant if and only if AT=TA, where it follows that all circulant matrices of the same order commute.
Lemma 4. [2,Lemma 7] Let B=circ(b0,b1,…,b2d−1) be a circulant matrix of order 2d where b0,b1,…,b2d−1∈R. Then,
Definition 4. An (s,t)-block circulant matrix of order st is a matrix of the form
where A1,A2,A3,…,As are square matrices of order t and bCirc(A1,…,As) represent a block circulant matrix.
It is clear that if s=1 or t=1, an (s,t)-block circulant degenerates to an ordinary circulant matrix. But a block circulant is not necessarily a circulant. For example, the matrix
is a block circulant matrix but fails to be a circulant if a≠d.
Definition 5. Let D=bCirc(A1,A2,…,As) be an (s,t)-block circulant, if each block Ai is a circulant, D is called an (s,t)-block circulant with circulant blocks. The class of such types of matrices is denoted by Bs,t(R).
For example, the matrix of type
is in B3,2(R).
In [2], first and third authors calculated the determinant of the circulant matrix over a finite commutative ring of characteristic 2.
Lemma 5. [2,Proposition 10] Let circ(b0,b1,…,b2d−1) be a circulant matrix over R. Then,
Corollary 6. [2,Corollary 11] For any positive integer d, we have
3.
The main results
The significance of MDS matrices of order 2d is paramount in the development of block ciphers and primarily owing to their ease of implementation. Our particular emphasis is directed towards matrices within Bs,t(R), with the underlying assumption that s=2d1 and t=2d2 throughout the subsequent sections, where d,d1, and d2 are positive integers.
Now, we state and prove the first main result of this paper:
Theorem 7. Let D=bCirc(A1,A2,…,As)∈Bs,t(R), where Ai=Circ(ai,1,ai,2,…,ai,t), 1≤i≤s, s=2d1, t=2d2. Then,
for some z,zi∈N(R).
Proof. Let D=bCirc(A1,A2,…,As) be a block circulant matrix of order st×st over the ring Bs,t(R). In view of Lemmas 3 and 5, we have
and Ati=t∑j=1ati,jIt.
Case (i): When s>t, i.e., d1>d2. Then, we have
From Corollary 6, we obtain, det(Ai)=zi+t∑j=1ati,j,for somezi∈N(R). This gives,
Using Eq (3.2) in Eq (3.1), we obtain
This yields that,
The last relation gives
Thus, we obtain
and
Case (ii): When s≤t, i.e., d1≤d2. Then, we have
This implies that,
The above relation yields
This implies,
That is,
This completes the proof. □
As an application of Theorem 7, we derive the following results. Precisely, if we take finite field of characteristic 2 in Theorem 7, then we obtain
Corollary 8. [16,Theorem 4.4] Let D=bCirc(A1,A2,…,As)∈Bs,t(F2n), where Ai=Circ(ai,1,ai,2,…,ai,t), 1≤i≤s, s=2d1, t=2d2. Then
and
In the following propositions, we construct 4×4 and 8×8 block circulant MDS matrices over the ring F28×F28, where h(x)=x8+x4+x3+x+1 is the generating polynomial of F28, α and β are the roots of this generating polynomial, and ¯γ=(α,β), ˉ1=(1,1)∈F28×F28.
Proposition 9. Let α and β be the roots of the polynomial h(x). Then, D=bCirc(circ(ˉ1,ˉγ),circ(ˉγ−1,ˉγ+ˉ1))∈B2,2(F28×F28) is an MDS matrix, and D−1=γ2D.
Proof. Application of [16,Proposition 5.3], makes it clear that D is an MDS matrix. By employing Theorem 7, we can write
where A1=circ(ˉ1,ˉγ),B=circ(ˉγ−1,ˉγ+ˉ1). By Corollary 2.6, we obtain det(A1)=ˉγ2+ˉ1 and det(A2)=ˉγ2+ˉ1+(ˉγ−1)2, and hence
□
Proposition 10. Let α and β be the roots of the polynomial h(x). Then, D=bCirc(circ(ˉ1,ˉ1,ˉγ−1+ˉγ,ˉγ),cir(ˉ1+ˉγ+ˉγ−1,ˉ1+ˉγ,ˉγ−1,ˉγ−1+ˉγ))∈B2,4(F28×F28) is an MDS matrix, and D−1=γ−4D×D2.
Proof. In view of [16,Proposition 5.4], we can easily see that D is an MDS matrix. With the help of Theorem 7, we can write
where A1=circ(ˉ1,ˉ1,ˉγ−1+ˉγ,ˉγ),A2=cir(ˉ1+ˉγ+ˉγ−1,ˉ1+ˉγ,ˉγ−1,ˉγ−1+ˉγ)). Application of Corollary 6 yields, det(A1)=(ˉγ−1)2 and detA2=(ˉγ−1)2+(ˉγ)2
This implies,
□
Proposition 11. Let α and β be the roots of the polynomial h(x). Then, D=bCirc(circ(ˉ1,ˉγ−1),circ(ˉγ−1+ˉ1,ˉγ2),circ(ˉγ,ˉγ−1+ˉ1),circ(ˉγ2+ˉ1,ˉ1+ˉγ+ˉγ−1))∈B4,2(F28×F28) is an MDS matrix.
Proposition 12. Let D=bCirc(circ(a1,a2),circ(a3,a4)) be an MDS matrix over R. Then, ai≠aj+η(1≤i,j≤4), for any η∈N(R).
Proof. Since D=bCirc(circ(a1,a2),circ(a3,a4)). So, we have
Let us suppose on the contrary, ai=aj+η, where 1≤i,j≤4. Since C=circ(ai,aj)=circ(ai,ai+η) is a submatrix of D, so det(C)=a2i+a2i+η2=η2. This implies that det(C)∈N(R). Hence, we obtained a contradiction as D is an MDS matrix. Therefore ai≠aj+η(1≤i,j≤4), for any η∈N(R). □
In the following lemma, we prove that the ring Rl=F2[x]⟨(f(x))2l⟩ contains a finite field of order 2m, where f(x) is any irreducible polynomial of degree m.
Lemma 13. Let f(x) be any irreducible polynomial of degree m over F2 and Rl=F2[x]⟨(f(x))2l⟩ be a ring. Then, Rl has a field of order 2m.
Proof. Let f(x) be an irreducible polynomial of degree m over F2. Now, we define a map ϕ:F2[x]⟨f(x)⟩⟶F2[x]⟨(f(x))2l⟩ as ϕ(h(x)+⟨f(x)⟩)=(h(x))2l+⟨(f(x))2l⟩for allh(x)∈F2[x]. First, we prove that ϕ is well defined. Let h1(x)+⟨f(x)⟩andh2(x)+⟨f(x)⟩∈F2[x]⟨f(x)⟩ such that h1(x)+⟨f(x)⟩=h2(x)+⟨f(x)⟩. This implies that h1(x)−h2(x)∈⟨f(x)⟩, that is, h1(x)−h2(x)=g(x)⋅f(x)for someg(x)∈F2[x]. Therefore, we write (h1(x)−h2(x))2l=(g(x)⋅f(x))2l, that is, (h1(x)−h2(x))2l=(g(x))2l(f(x))2l=0mod(f(x))2l. Hence, ϕ(h1(x)+⟨f(x)⟩)=ϕ(h2(x)+⟨f(x)⟩).
Next, we want to prove that ϕ is a ring homomorphism. For any h1(x)+⟨f(x)⟩,h2(x)+⟨f(x)⟩∈F2[x]⟨f(x)⟩, we have
Also, we have
Hence, ϕ is a ring homomorphism. To show that ϕ is an embedding, we prove that ϕ is injective. Let h(x)+⟨f(x)⟩∈Ker(ϕ). Therefore, we have ϕ(h(x)+⟨f(x)⟩)=⟨(f(x))2l⟩, which implies (h(x))2l+⟨(f(x))2l⟩=⟨(f(x))2l⟩. Thus, (h(x))2l∈⟨(f(x))2l⟩, f(x)∣h(x). That is, h(x)+⟨f(x)⟩=⟨f(x)⟩. Henceforth, we conclude that Ker(ϕ)={⟨f(x)⟩}.
Thus, ϕ is injective. Hence, F2[x]⟨(f(x))2l⟩ contains a field of order 2m which is isomorphic to F2[x]⟨f(x)⟩. □
Lemma 14. Let ψ:M(d,F2[x]⟨(f(x))2l⟩)⟶M(d,F2[x]⟨(f(x))2l⟩) be a map, for any A=(ai,j)∈ M(d,F2[x]⟨((f(x))2l⟩) define ψ as ψ((aij))=(aij+ηij)=A′, where ηij∈N(F2[x]⟨(f(x))2l⟩) for 1≤i,j≤d. Then, A is invertible if and only if A′ is invertible.
Proof. Let
be an invertible matrix. Since,
be a map defined by ψ((aij))=(aij+ηij)=A′. That is,
We now prove that A′ is invertible in M(d,F2[x]⟨(f(x))2l⟩). For this, we calculate the determinant of A′ as
where
Since A is invertible, det(A) is a unit in F2[x]⟨(f(x))2l⟩. Therefore, det(A′)=det(A)+t, where t∈N(F2[x]⟨(f(x))2l⟩), which implies that det(A′) is also a unit element in F2[x]⟨(f(x))2l⟩. Hence, A′ is invertible.
Similarly, we can prove the converse of this theorem. □
Theorem 15. Let A=(aij)∈GL(d,F2[x]⟨((f(x))2l⟩) be an MDS matrix, and ηij∈N(F2[x]⟨(f(x))2l⟩). Then, A′=(aij+ηij) is an MDS matrix.
Proof. The proof of this theorem directly follows from Lemma 14. □
Theorem 16. Let Rt=F2[x]⟨(1+x+x3+x4+x8)2t⟩ be a ring with a positive integer t and β be a root of the irreducible polynomial 1+x+x3+x4+x8, and α=β2t. Then, D=bCirc(circ(1+η1,α+η2),circ(α−1+η3,α+1+η4)) is an MDS matrix, where η1,η2,η3andη4∈N(Rt).
Proof. The proof of this theorem follows from Lemma 13 and Theorem 15. □
Corollary 17. In particular, if we take η1=η2=η3=η4=η in Theorem 16, then D2=1α2I4.
Proof. We have
□
Theorem 18. Let Rt=F2[x]⟨(1+x+x3+x4+x8)2t⟩ be a ring and β be a root of the irreducible polynomial 1+x+x3+x4+x8, and α=β2t. Then, D=bCirc(circ(1+η1,1+η2,α+α−1+η3,α+η4),circ(1+α+α−1+η′1,1+α+η′2,α−1+η′3,α+α−1+η′4)) is an MDS matrix, where η1,η2,η3,η4,η′1,η′2,η′3andη′4∈N(Rt).
Proof. The proof of this theorem is on similar lines as that of Lemma 13 and Theorem 15. □
Corollary 19. If we take η1=η2=η3=η4=η′1=η′2=η′3=η′4 in Theorem 72, then D4=(α4+z)I, for some z∈N(Rt).
4.
XOR count distribution of finite commutative rings of characteristic 2
In this section, we delve into the XOR count distribution for elements within two rings: R1=F2[x]⟨(1+x2+x6)⟩ and R2=F2[x]⟨(1+x4+x6)⟩. Employing a method delineated by Kesarwani et al. [18], which entails determining the XOR count of a local ring with characteristic 2. We apply the same method in finite fields to define the XOR count for elements within R1 and R2. For a more comprehensive understanding of XOR count, readers are encouraged to delve into the detailed discussions provided in [19]. Let us commence this section by outlining the definition of XOR count.
Definition 6. [25,Definition 1] The XOR count of an element θ in the field F2n is the number of XORs required to implement the multiplication of θ with an arbitrary element β. XOR counts of all elements of F2n referred to as the XOR count distribution.
We begin by outlining the procedure for computing the number of XOR operations needed to execute a multiplication by elements α3 within the finite rings R1 and R2.
For ring R1=F2[x]⟨(1+x2+x6)⟩={a0+a1α+a2α2+a3α3+a4α4+a5α5;whereα=x+⟨1+x2+x6⟩,ai∈F2}. Consider the multiplication of α3 with an arbitrary element β=b0+b1α+b2α2+b3α3+b4α4+b5α5, where bi∈F2, as
The product of α3 and β can be expressed as
where there are three XOR operations. Consequently, the XOR count of the element α3 in R1 is 3.
For the ring R2=F2[x]⟨(1+x4+x6)⟩={a0+a1α+a2α2+a3α3+a4α4+a5α5;whereα=x+⟨1+x4+x6⟩,ai∈F2}. Consider the multiplication of α3 with an arbitrary element β=b0+b1α+b2α2+b3α3+b4α4+b5α5, where bi∈F2 as
The product of α3 and β takes the form
which contains four XORs. Hence, the XOR count for the element α3 in R2 is 4.
Then, we can calculate the number of XORs required for the multiplication of each element in rings R1 and R2 by using the same approach. Table 1 shows the number of XOR gates for each elements of the finite rings of order 26 defined by two reducible polynomials (1+x2+x6) and (1+x4+x6). The Magma computation system [3] is used to complete all of the computations in Table 1.
In Table 1, we observe that the sum of all XOR distributions of the elements in R1 and R2 amounts to 776 and 764, respectively. Our investigation aligns with the findings of Sarkar and Sim [25] in the realm of finite fields, where they demonstrate that there is no advantage in varying the choice of irreducible polynomials over F2. They proved that the total XOR count of elements in F2n remains constant, i.e., nn∑i=2(ni)(i−1). However, our exploration reveals a contrasting scenario: When employing two reducible polynomials of equal degree, distinct XOR distributions emerge. Specifically, in our investigation, we observe the XOR sums for the respective rings R1 and R2 to be 776 and 764.
5.
Examples
In this section, we present two examples of block circulant MDS matrices over the rings R1 and R2. Moreover, in connection with Theorem 15, we provide some additional MDS matrices.
Example 1. Let R1=F2[x](⟨1+x2+x6⟩) be a finite commutative ring of characteristic 2. By Lemma 13, we can say that R1 contains a finite field of order 8. Let α be the root of the irreducible polynomial 1+x+x3 over F2, and the matrix A=bCirc(circ(1,α),circ(1+α,1+α2)). That is,
is an MDS matrix, and A2=(1+α4)I4. In Theorem 15, if we take ηij=α3+α+1 and η′ij=α5+α4+1, then we obtain two more MDS matrices A1 and A2, as follows:
Example 2. Let R2=F2[x](⟨1+x4+x6⟩) be a finite commutative ring of characteristic 2. In view of Lemma 13, we can say that R2 contains a finite field of order 8. Let α be a root of the irreducible polynomial 1+x+x3. Then, the matrix
is an MDS matrix, and A2=α4I4. Moreover, if we take ηij=α3+α2+1 and η′ij=α5+α+1, in Theorem 15, then we obtain two MDS matrices B1 and B2. That is, we obtain
and
5.1. XOR count of a matrix over finite commutative ring of characteristic 2
The XOR count of one row of a diffusion matrix can be computed using the following formula.
where γi is the XOR count of the i-th entry in the row of the matrix, k is the order of the diffusion matrix, l is the number of nonzero coefficients in the row, and n is the dimension of vector space (see, [25] for more details).
Remark 1. Using Eq (5.1) and Table 1, we calculate the XOR counts of matrices A, A1, and A2 in Example 1 to be 132, 212, and 264, respectively.
Remark 2. By employing Eq (5.1) and referring to Table 1, we compute the XOR counts for matrices B, B1, and B2 in Example 2 as 108, 256, and 256, respectively.
6.
Conclusions
In this paper, we studied the construction of block circulant MDS matrices over finite commutative rings with unity. Our investigation has delved into the determinant of such matrices, extending previous findings from finite fields to the ring R. Additionally, we explored conditions under which R contains a finite field of order 2m, taking advantage of this discovery, we constructed block circulant MDS matrices of orders 4 and 8. To enhance the practical implementation of MDS matrices, we analyzed the XOR distribution within specific rings, including R1=F2[x]⟨(1+x2+x6)⟩ and R2=F2[x]⟨(1+x4+x6)⟩, providing the XOR counts distribution of these two rings. Furthermore, we presented some examples of MDS matrices alongside their corresponding XOR counts within the framework of finite commutative rings.
However, unlike previous research, our investigation has found that different XOR patterns appear when we use two reducible polynomials of the same degree. We specifically noticed different XOR distributions of rings R1 and R2, which are 776 and 764, respectively. This finding emphasizes how the choice of polynomials influences the way XOR behaves in specific mathematical scenarios involving certain types of rings. Our investigation has aligned with previous findings in the realm of finite fields, where they (cf.; [25]) demonstrated that there is no advantage in varying the choice of irreducible polynomials within F2n, as they (cf.; [25]) proved that the total XOR count of elements in F2n remains constant.
The future work revolves around investigating the XOR count, particularly in relation to changes in the basis. We aim to determine whether altering the basis results in any modifications to the XOR distribution. Additionally, we seek to identify the conditions under which there is no variation in the XOR count distribution, particularly concerning reducible polynomials.
Author contributions
All authors have equally contributed. All authors have read and approved the final version of the manuscript for publication.
Acknowledgments
The authors thank to the anonymous reviewers for their valuable suggestions and comments which significantly improved both the quality and the presentation of this paper.
The authors extend their appreciation to Princess Nourah bint Abdulrahman University (PNU), Riyadh, Saudi Arabia, for funding this research under Researchers Supporting Project Number (PNURSP2024R231). A Substantial part of this work was done when the first and third authors were visiting Professor/Scientist at Department of Mathematics, Universitas Gadjah Mada (UGM), Indonesia (July, 2024) hosted by the Algebra Society of Indonesia and UGM. The first and third authors appreciate the gracious hospitality they received at UGM, Indonesia, during their visit. The research of the third author is financially supported by the University Grants Commission (UGC), Government of India (Ref. No.: 221610203798).
Conflicts of interest
The authors declare that they have no conflicts of interest.