Ee Duan and Wenling Wu, “Invariant subspace of the p-spn structure with a class of linear layer matrix,” Chinese Journal of Electronics, vol. x, no. x, pp. 1–14, xxxx. DOI: 10.23919/cje.2024.00.239
Citation:
Ee Duan and Wenling Wu, “Invariant subspace of the p-spn structure with a class of linear layer matrix,” Chinese Journal of Electronics, vol. x, no. x, pp. 1–14, xxxx. DOI: 10.23919/cje.2024.00.239
Ee Duan and Wenling Wu, “Invariant subspace of the p-spn structure with a class of linear layer matrix,” Chinese Journal of Electronics, vol. x, no. x, pp. 1–14, xxxx. DOI: 10.23919/cje.2024.00.239
Citation:
Ee Duan and Wenling Wu, “Invariant subspace of the p-spn structure with a class of linear layer matrix,” Chinese Journal of Electronics, vol. x, no. x, pp. 1–14, xxxx. DOI: 10.23919/cje.2024.00.239
Duan Ee: Ee Duan was born in 1996. She is a PhD candidate in the Institute of Software, Chinese Academy of Sciences. Her main research interests are analysis and design of symmetric cryptography. (Email: duanee22@mails.ucas.ac.cn)
Wu Wenling: Wenling Wu was born in 1966. She is a researcher and PhD supervisor in the Institute of Software, Chinese Academy of Sciences. Her main research interests include design and cryptanalysis of block ciphers and Hash functions, and Cryptography. (Email: wenling@iscas.ac.cn)
Emerging applications in cloud computing, big data, and the Internet of Things have driven the advancement and implementation of security protocols, including secure multi-party computation, fully homomorphic encryption, and zero-knowledge proofs, to meet heightened security demands. Designing cryptographic permutations and block ciphers using a partial substitution permutation network (P-SPN) approach where the nonlinear part does not cover the entire state has recently gained attention due to favorable implementation characteristics in various scenarios. For the word-oriented P-SPN schemes with a fixed linear layer, the choice of the MDS matrix significantly affects the security level provided by P-SPN designs. If the MDS matrix is chosen weak, it will allow for extremely maximum invariant subspace that pass the entire rounds without activating any non-linear operation. Firstly, we investigate the properties of a special block matrix with circulant block, specifically utilized within the linear layer matrix of P-SPN structure schemes. Subsequently, our investigation extends to present the annihilating polynomial of low degree for these specific type of matrices, as well as to put forward the range of determining their minimal polynomial degree. Finally, this study articulates a lower bound estimated for the dimension of the maximum invariant subspace within the P-SPN structure schemes when integrated with the aforementioned matrix type. In scenarios where the S-box number s=1 in the P-SPN structure schemes, we achieve a precise determination of the dimension of maximum invariant subspace. Conversely, for cases with s>1, with some certain specific conditions, our research establishes more compact lower bound for the dimension of the maximum invariant subspace. The research results of this paper offer valuable design guidance for the development of matrices within the linear layer of P-SPN architecture schemes.
Modern cryptography developed many techniques that go well beyond solving traditional confidentiality and authenticity problems in two-party communications. This includes practical applications of secure multi-party computation (MPC), fully homomorphic encryption (FHE), and zero-knowledge (ZK) proofs using symmetric primitives. Designs of primitives in symmetric cryptography for these applications are usually led by heuristics such as simplifying their arithmetic representations or linear operations being more efficient than nonlinear ones in these scenarios. The latter example is also used in the context of masking, a widespread countermeasure against side-channel attacks in which all the computations are performed on shared secrets.
Motivated by advancements in various application domains, there has been a recent surge in the proposal of novel symmetric cryptographic primitives. There is an increasing number of MPC-/FHE-/ZK-friendly proposals, including LowMC [1], FLIP [2], Kreyvium [3], Rasta [4], Dasta [5], MiMC [6], [7], GMiMC [8], HadesMiMC [9], Ciminion [10], Jarvis and Friday [11], Vision and Rescue [12], Starkad [13], Rubato [14], HERA [15], Poseidon [16], and Poseidon2 [17].
Some of the recalled designs reach the goal of minimizing the total number of multiplications by making use of iterative round functions with a partial S-box layer. These designs are called partial substitution-permutation network (P-SPN) schemes in [18]. They are a variant of SPN schemes, in which an input block is transformed into an output block by applying several alternating rounds of substitution boxes and affine permutations to provide confusion and diffusion. At Eurocrypt 2020, Grassi et al. proposed the HADES design strategy that combines the classical SPN construction with the P-SPN construction [9]. In many cases, the permutation layer is a linear operation defined by the multiplication of the state with a t×t matrix. In the case of a partial substitution-permutation network, however, part of the substitution layer is replaced by an identity mapping, leading to practical advantages for applications in which nonlinear operations are more expensive than linear operations. In the P-SPN structure schemes, because only part of the S-box of the nonlinear layer has a real nonlinear transformation, when considering the propagation of the subspace path, the value of a considerable part remains unchanged before and after the nonlinear layer, so the linear layer plays a more critical role in the iteration of the scheme.
Design of schemes using the P-SPN structure has obvious performance advantages in various scenarios, was used in the block ciphers Zorro [18] and LowMC [1]. A drawback of this approach is that ‘clean’ security arguments (like the wide trail strategy) are not applicable for P-SPNs, and thus, the security of these designs was argued by more ad-hoc approaches. These turned out to be insufficient,as Zorro was practically broken in literature [19] and the security of the initial versions of LowMC was shown in [20] and [21] to be significantly lower that claimed by the designers.
Bar-On et al. delve into the strategic selection of parameters within the P-SPN structure, specifically addressing the quantity of S-boxes per round [22]. They ultimately validate that the P-SPN structural paradigm is devoid of inherent flaws, advocating its applicability in the design of forthcoming cryptographic algorithms. The fact that the resistance against invariant subspace attacks is related to the degree of the minimal polynomial of the linear layer has already been brought out by Beierle et al. in [23]. They also reported that if the linear layer’s minimal polynomial has a high degree, round constants which guarantee the resistance to all types of invariant attacks, including invariant subspace attack and nonlinear invariant attack, can be easily found. Grassi et al. contribute to the discourse by conducting an exhaustive analysis of the security aspects of the P-SPN and HADES structures under conditions of infinitely long invariant subspace traces and infinite long iterative subspace traces. They explore the ramifications of selecting the linear layer on the overall security posture. Furthermore, they introduce three algorithms that serve as a safety assessment toolkit for designers when making choices regarding the linear layer components. In a culminating revelation, they articulate a sufficient condition that ascertains the absence of infinite long invariant or iterative subspace traces in the algorithm, predicated on the minimal polynomial of the linear layer matrix meeting certain specific criteria [24].
At Eurocrypt 2021, Keller et al. conducted an in-depth examination of the security within the P-SPN component of the Starkad scheme, uncovering a space attack against it. Additionally, they introduced the Keller-Rosemarin conjecture, which pertains to the degree of the minimal polynomial associated with the linear matrix of the scheme [25]. Building upon this foundation, Wang et al. offered a more detailed analysis of the characteristics of the special block matrix [26]. They addressed the conjecture by providing a detailed proof, subsequently unveiling a higher-dimensional subspace for the Starkad scheme. Their research advanced the understanding of special block matrices with unique structural forms, furnishing an upper bound for the degree of the minimal polynomial across various matrix types, including those with special block matrix with circulant blocks. However, the aforementioned studies have limitations, as they only delineate the precise dimension of the invariant subspace for the specific case where s=1. This indicates that while significant strides have been made, further investigation is required to generalize these findings to broader scenarios within the field of cryptographic algorithm design.
In the realm of cryptographic analysis, the identification of a subspace trail inherently serves as a distinguisher for the P-SPN scheme under scrutiny. The mere presence of such a trail not only sets it apart from a pseudo-random permutation but also paves the way for potential attacks. A case in point is the preimage attack on the Poseidon hash function, which capitalizes on the existence of these trails, as recently demonstrated in [[27], Sect. 6.2]. Thus, in the case of a “weak” MDS matrix, an attacker can potentially choose an input space of texts for which no S-box is activated [28] in the rounds with partial S-box layers. This exploitable vulnerability was precisely what enabled the attacks on the specific matrices employed in Poseidon, where corresponding vulnerabilities in the hash functions were identified in [25], [27].
Our Contribution. In this paper we study the effect of the special MDS matrix on the security level of P-SPN designs. To mitigate the impact of nonlinear layers on path propagation within subspaces, our study hones in on those subspaces that persistently fail to activate the S-boxes during the scheme's iterations. At this point, our focus shifts to understanding the pivotal role that the properties of the linear layer assume in the security apparatus of the P-SPN structural scheme. Regarding the linear layer matrix M, our investigation endeavors to explore the conditions that give rise to subspaces of substantial large dimensions. The choice of both the quantity and the strategic placement of S-boxes within P-SPN (Permutation-Substitution Permutation Network) structures significantly influences the algorithmic security, necessitating further investigation into the optimization and positioning of these nonlinear components. Our research is dedicated to attaining a comprehensive understanding of the properties of the linear layer and their contribution to the security of P-SPN design. It aims to provide critical insights into enhancing the cryptographic robustness of P-SPN structures, ensuring their resilience against emerging threats and vulnerabilities.
In our work, we investigated the security of the P-SPN’s structure for a class of special matrices.
Firstly, we construct a special block matrix with circulant block M, which is employed in the linear layer matrix of the P-SPN structure schemes. Through the in-depth analysis of this kind of matrix, the properties that can be used effectively are obtained.
In addition, we present the annihilating polynomial of low degree of this special block matrix with circulant block,
f(x)=(x−2l−1∑i=02k−1∑j=0ci,j)d,k,l∈N+
In the special block matrix with circulant block M, ci,j represents the elements, and (l,k) denotes the dimensions of the matrix. Moreover, we put forward the range of determining its minimum polynomial degree, which satisfied certain essential conditions. Within this framework, the degree d is associated with the matrix, culminating at a maximum value of 2k.
Finally, we provide a lower bound estimate for the dimension of the maximum invariant subspace within the P-SPN structure schemes when it incorporates this specific type of matrix. The estimate is given by 2k+l−sd, where s denotes the number of S-boxes within the nonlinear layer. On the one hand, for instances of the P-SPN structure schemes where s=1, we are able to precisely determine the dimension of its maximum invariant subspace, which is 2k+l−d. On the other hand, for cases with s>1, with some certain specific conditions, our research establishes more compact lower bound for the dimensionality of the maximum invariant subspace,i.e., t−(sd−2k⋅(d/2−1)).
Previous literature has concluded that no invariant subspace exists when s=2k. However, our work further challenges and refutes that perspective. The specific results are shown in Table 1. This paper presents a series of instance results based on the special block matrix with circulant block and the corresponding number and position of S-boxes. It can be observed that when l>k, the dimension of the largest invariant subspace is greater than in the case where l≤k. Therefore, from a design perspective, it is recommended to use parameters with l>k when constructing the linear layer with such matrices.
Table
1.
In accordance with the P-SPN structure scheme and the linear layer matrix configuration presented herein, we delineate the dimensions of the maximum invariant subspaces across various parameter settings. Herein, s denotes the count of S-boxes within the nonlinear layer, T indicates the number of the branch, and (l,k) signifies the order of the matrix. Furthermore, deg(f) is utilized to express the minimal polynomial degree of the linear layer matrix M, and dim(Umax) represents the dimension of the maximum invariant subspace of the P-SPN structure scheme under the corresponding linear layer.
Structure of the Paper. The rest of paper is organised as follows. In Sect.2, we give some notations and definitions used throughout the paper. Sect.3 introduces special block matrix with circulant block over a binary field and its properties. Then we focus on the annihilating polynomial of low degree of this type of special matrix, as well as puts forward the range of determining its minimum polynomial degree. In Sect.4, we provide the dimension of the largest invariant subspace within the P-SPN structure schemes when it incorporates this specific type of matrix. Finally, we conclude the paper in Sect. 5.
II.
Preliminaries
In this section, we introduce the notations and definitions essential for the concepts and analyses presented throughout this paper.
Notation
(1) The finite fields under consideration are denoted by Fq, where q=2n and n∈N+.
(2) Subspaces are indicated with calligraphic letters, e.g., U. For a given subspace U⊂Fq, the complementary subspace is denoted by Uc⊂Fq such that U⊕Uc=Fq.
(3) Matrices are represented by uppercase bold letters, e.g., M. Additionally, M[i,j] represents the element at the i-th row and j-th column of the matrix, and M[i,:] represents all elements in the i-th row of the matrix.
(4) In this paper, we employ the boldface notation 0 to denote a fully zeroed matrix or vector;
(5) Vectors are represented by boldface italic capital letters, e.g., X.
1
Partial SPN Schemes
In this paper, we will focus on P-SPN block ciphers and permutations over Fq. All our results are independent of the round keys and constants. For this reason, in the following we do not clearly distinguish between block ciphers and unkeyed permutations, and we just refer to them using the term schemes.
PartialSPNSchemes(P−SPN) [18]. We denote the application of r rounds of a t-word P-SPN scheme by Er:Ftq→Ftq. For every input X=(x1,…,xt∈Ftq), the output is defined by Er(X)=(Rr∘…∘R0)(X+c0), where Ri:Ft→Ftq is defined as Ri(X)=R(X)+ci, and ci is a publicly known round constant or a secret round key for i∈{0,1,…,r}.
As shown in Figure 1, let 1≤s≤⌈t/2⌉ be the number of S-boxes per round. We denote by R the composition of the S-box layer and of the linear layer, i.e., we have R:Ftq→Ftq with
Figure
1.
One round schematic representation of the P-SPN structure.
where Si:Fq→Fq for i∈{1,2,…,s} is a nonlinear permutation, and hence t−s input words are unaffected by the S-box layer, which is the only difference to classical SPN schemes. We also assume that the s S-boxes are applied to the first s words.
The linear layer M(⋅) is defined by the multiplication with an invertible matrix M∈Ft×tq, that is, M(X)=M⋅X. In the following, we assume that the matrix M ensures full diffusion after a finite number of rounds, in the sense that there exists an r∈N such that every word of the internal state after the application of r rounds depends on every input word x1,…,xt.
Before going on, we point out that all word-wise (aligned) P-SPN schemes can be written in the above way.
2
Invariant Subspaces
The invariant subspace attack, initially introduced by Leander et al. in 2011, serves as a potent analytical instrument targeted at block cryptographic algorithms in [29].
This paper consider the following a more general property, for each a∈Ftq, there is a unique b∈Ftq such that
Rk(U+a)=R(U+a)+k=U+b,
where the round function R is defined by Equation (1). In this scenario, the intrinsic nature of the subspace U remains invariant, yet its coset shifts from the original. The value of b is contingent upon both a and to the round key k. Consequently, the concept of an invariant subspace is hereby introduced.
Definition 1 (Invariant Subspace Trail)[24] Let U⊂Ftq be a subspace. The subspace U is said to generate an r-round invariant subspace of the function Er:Ftq→Ftq if for all 1≤i≤r and for all ai∈Ftq, there exists an ai+1∈Uc such that,
Ri(U+ai)=U+ai+1.
The primary objective of this attack is to identify the so-called invariant subspace, which represents a subset of all potential states and key values. This subset is critical for examining the invariance of the scheme's round transformation. The discovery of such a subset enables an attacker to encrypt plaintext that falls within this subset, posit that the master key is also encompassed by it, and ultimately aims to retrieve the corresponding ciphertext that is likewise a member of the subset. This approach is not only instrumental in crafting a key discriminator but also serves as a viable avenue for key recovery efforts, thereby enhancing the cryptanalysts capability to challenge the security of the cryptographic scheme in question.
3
Special Matrice and Circulant Matrix
In the P-SPN structure scheme, in order to achieve the effect of full diffusion, the linear layer matrix of most algorithms adopts MDS matrix selected randomly. In this subsection, we will introduce the definition of the special matrix and circulant matrix.
Special matrices are defined in the following inductive way.
Definition 2 (Special Matrix) [25] Let the matrix M2k×2k∈F2k×2k2n, k≥1. Matrix M is called a special matrix if it adheres to the following form:
M=(A2k−1×2k−1B2k−1×2k−1B2k−1×2k−1A2k−1×2k−1),
where A2k−1×2k−1 and B2k−1×2k−1 are matrices that are also classified as special.
A circulant matrix is defined as a square matrix where each row is a cyclic permutation of the first row.
Definition 3 (Circulant Matrix) Let c0,c1,…,c2k−1 be 2k elements from a finite field F2n, where k≥1. A matrix C is referred to as a circulant matrix constructed from these elements if it can be represented as:
III.
Special Block Matrix with Circulant Block and Its Properties
In this section we study the properties of a certain class of matrices over binary fields F2n. Focusing on P-SPN schemes which use the same linear layer in each round, here we study the properties that the matrix that defines the linear layer must satisfy in order to prevent infinitely long invariant subspace trails without active S-boxes.
We present the definition of the special block matrix with circulant block based on the prove definitions.
Definition 4 (Special Block Matrix with Circulant Block) Let M be a matrix of order (2l,2k), which has 2l×2l blocks. M is referred to as a special block matrix with circulant block if it can be represented as:
where i∈{0,1,…,2l−1}, and each block matrix Ci=circ(ci,0,ci,1,…,ci,2k−1)∈F2k×2k2n is a circulant matrix. When Ci serves as an element within the matrix, M is considered to be of a special block matrix with circulant block.
Next, we recommend the concept of the Kronecker Product, a pivotal tool utilized in the meticulous analysis of special block matrix with circulant block.
Definition 5 (Kronecker Product)[30] Let A be an m×n matrix and B be an s×t matrix. The Kronecker product of A and B, denoted by A⊗B, is an ms×nt matrix given by
Therefore, we can calculate the following results.
Corollary 1 For the identity matrix I2l, it holds that I2l⊗I2=I2l+1. For the substitution matrix P, there is the following trivial result that, Let P2l×2l=circ(0,1,0,…,0) be a substitution matrix with dimension 2l×2l. It holds that P2l=I2l.
Building upon the aforementioned definitions and corollaries, we introduce the concept of the Kronecker product monomial. This mathematical construct is instrumental in streamlining the computations presented in the subsequent sections of this manuscript.
Definition 6 (Kronecker Product Monomial.) Let μ∈F2l be represented by its Boolean tuple (μl−1,…,μ1,μ0). We define the Kronecker product monomial πμ(⋅) associated with μ for the matrix P2 as follows:
πμ(P2)=(P2)2μl−1⊗…⊗(P2)2μ1⊗(P2)2μ0.
Here, P2 denotes the substitution matrix of dimension 2×2.
With this definition in place, we can study the special block matrix with circulant block in detail, and give some properties for subsequent use.
The following Lemma 1 articulates the representation of a special block matrix with circulant blocks through the Kronecker product monomial. This formulation serves as an exceedingly effective and convenient instrument in the demonstration of several subsequent theorems.
Lemma 1 Let Ci=circ(ci,0,ci,1,…,ci,2k−1)∈F2k×2k2n for i∈{0,1}. We can represent a special block matrix with circulant blocks M of order (2,2k) as
M21+k×21+k=(C0C1C1C0)=I2⊗C0+P2⊗C1.
Furthermore, a special block matrix with circulant blocks M of order (2l,2k) can be expressed in the form
M2l+k×2l+k=2l−1∑i=0(π(2l−1)−i(P2)⊗Ci).
Proof To establish the preceding result, we begin by decomposing the special block matrix with circulant block M21+k×21+k of order (2,2k) as follows:
Furthermore, by the inductive hypothesis, we can similarly decompose the special block matrix with circulant block M2(l−1)+k×2(l−1)+k of order (2l−1,2k) as:
For the special block matrix with circulant blocks M2l+k×2l+k of order (2l,2k), let M′i for i∈{1,2} be the special block matrix with circulant block M2(l−1)+k×2(l−1)+k of order (2l−1,2k). Through iterative calculation, we arrive at the following result:
Furthermore, we proceed to demonstrate the power results of a special block matrix with circulant block, commencing with an examination of the square matrix scenario. Consider a special block matrix with circulant block M of order (2l,2k), where Ci=circ(ci,0,ci,1,…,ci,2k−1)∈F2k×2k2n for i∈{0,1,…,2l−1} are circulant matrices. Leveraging Lemma 1, we derive the following:
It is evident that the square power of a special block matrix with circulant block constitutes a highly regular block diagonal matrix, an observation of considerable interest. This insight then paves the way for us to discuss the scenarios of other powers.
Moving forward, we initially turn our attention to the results for Mp, where 2<p<2k. The first case is delineated by the following Theorem 1, which states that M2d, where 1<d<k.
Theorem 1 Let M be a special block matrix with circulant block of order (2l,2k), where i∈{0,1,…,2l−1}, and Ci=circ(ci,0,ci,1,…,ci,2k−1) are circulant matrices in F2k×2k2n. Then, for 1<d<k, the matrix M2d retains its form as a special block matrix with circulant block, given by
M2d=I2l⊗2l−1∑i=0(Ci)2d.
Furthermore, for every p∈[1,2k−d−1], if the condition
2l−1∑i=02d−1∑j=0(ci,p+2k−dj)2d=0
is satisfied, then
M2d=2l−1∑i=02d−1∑j=0(ci,2k−dj)2d⋅I2k+l.
Proof To substantiate the preceding result, we invoke Lemma 1 to derive the following sequence of equalities for the special block matrix with circulant block M of order (2l,2k):
It is a well-established fact that the product of circulant matrices remains a circulant matrix. Furthermore, (Ci)2=circ(∑2−1j=0(ci,0+2k−1j)2,…,∑2−1j=0(ci,2k−1−1+2k−1j)2)⊗I2. In general scenarios, we can directly compute that,
Expanding upon the preceding discourse, we now address the second scenario, which posits that for M2d+s, where s∈[1,2d−1], and 1<d<k, the matrix M exhibits specific properties that are pivotal for our subsequent analysis.
Theorem 2 Let M be a special block matrix with circulant block of order (2l,2k), where each Ci=circ(ci,0,ci,1,…,ci,2k−1) is a circulant matrix in F2k×2k2n for i∈{0,1,…,2l−1}. For s∈[1,2d−1] and 1<d<k, it is demonstrated that the matrix M2d+s maintains its structure as a special block matrix with circulant block.
Proof To substantiate the preceding result, we invoke Lemma 1. Consequently, let the binary representation of s be s=(sd−1,sd−2,…,s0), such that s=∑d−1i=0si2i.
The subsequent derivation process is analogous to that of Theorem 1, hence we omit an exhaustive explanation here. It is demonstrated that the matrix M2d+s maintains its structure as a special block matrix with circulant block.
□
In the initial section of our analysis, we introduce a pivotal property of circulant matrices, which serves as a foundational element in the subsequent proof of the theorem.
Corollary 2 Let Ci=circ(ci,0,ci,1,…,ci,2k−1) be a circulant matrix in F2k×2k2n for i∈{0,1,…,2l−1}. It follows from the work of [26] that,
(Ci)2k=(2k−1∑j=0c2ki,j)⋅I2k.
Furthermore, we derive a special result, namely,
2l−1∑i=0(Ci)2k=(2l−1∑i=02k−1∑j=0c2ki,j)⋅I2k.
Proof In order to prove the previous result, we can directly substituting the above general conclusion that,
Theorem 3 Let M be a special block matrix with circulant block of order (2l,2k), where i∈{0,1,…,2l−1}, and Ci=circ(ci,0,ci,1,…,ci,2k−1) are circulant matrices in F2k×2k2n. Then, we have the following result:
M2k=(2l−1∑i=02k−1∑j=0c2ki,j)⋅I2k+l.
Proof To prove the previous result, we leverage the insights derived from Lemmas 1, and 2. We commence by observing that,
2l−1∑i=0(Ci)2k=(2l−1∑i=02k−1∑j=0(ci,j)2k)⋅I2k,
This expression facilitates the subsequent demonstration:
In conclusion, we have presented a multitude of properties pertaining to special block matrix with circulant block M, which can be effectively harnessed for further analysis. Moving forward, we delve deeper into the discourse on the annihilating polynomial and the minimal polynomial associated with matrices of this nature.
Theorem 4 Consider a special block matrix M with circulant blocks with order (2l,2k), where i∈{0,1,…,2l−1} and each Ci=circ(ci,0,ci,1,…,ci,2k−1) is a 2k×2k circulant matrix over the field F2n. The annihilating polynomial of matrix M can be articulated as:
f(x)=(x−2l−1∑i=02k−1∑j=0ci,j)2k,
where the degree of the polynomial f is deg(f)=2k. Moreover, the minimal polynomial of matrix M must be a divisor of any of its annihilating polynomials. Therefore, the minimal polynomial of M is given by:
φ(x)=(x−2l−1∑i=02k−1∑j=0ci,j)p,
where 0<p≤deg(f). Specifically, for every p∈[1,2k−d−1] and 1≤d<k, if matrix M satisfies the condition
2l−1∑i=02d−1∑j=0(ci,p+2k−dj)2d=0,
then, M possesses an annihilating polynomial of a lower degree 2d, defined as:
f(x)=(x−2l−1∑i=02k−1∑j=0ci,j)2d.
Proof To verify the annihilating polynomial for matrix M, we substitute M directly into the polynomial, we have
This demonstrates that f(x) is an annihilating polynomial of M with a degree of 2d.
□
In order to make the matrix M, as the linear layer of the P-SPN structure scheme, resist invariant subspace attacks, we hope that the number of minimal polynomial is as large as possible. The following inference gives the condition that the degree of the minimal polynomials of M equal to 2k. When the parameter value selected by the designer meets this condition, a safer linear layer matrix is naturally obtained.
Theorem 5 Let M be a special block matrix with circulant block of order (2l,2k), where for each i∈{0,1,…,2l−1}, the matrix Ci=circ(ci,0,ci,1,…,ci,2k−1) is a 2k×2k circulant matrix over the finite field F2n. The minimal polynomial of matrix M has a degree of d=2k if and only if M2k=(∑2l−1i=0∑2k−1j=0(ci,j)2k)⋅I2k+l, with M2k−1≠(∑2l−1i=0∑2k−1j=0(ci,j)2k−1)⋅I2k+l.
Proof We begin by establishing the necessity. If the degree of the minimal polynomial of matrix M is d=2k, then the polynomial
g(x)=(x−2l−1∑i=02k−1∑j=0ci,j)2k−1
cannot be an annihilating polynomial of M. In other words,
M2k−1≠(2l−1∑i=02k−1∑j=0(ci,j)2k−1)⋅I2k+l.
This is consistent with Theorem 1, which implies that
2l−1∑i=02k−1−1∑j=0(ci,1+2k−1j)2k−1≠0.
Next, we address the sufficiency. According to Theorem 4, the minimal polynomial of M must be of the form
φ(x)=(x−2l−1∑i=02k−1∑j=0ci,j)d,0<d≤2k.
If M2k−1≠(∑2l−1i=0∑2k−1j=0(ci,j)2k−1)⋅I2k+l, then g(x)=(x−∑2l−1i=0∑2k−1j=0ci,j)2k−1 cannot be an annihilating polynomial of M, leading to the conclusion that 2k−1<d≤2k.
For the case where 2k−1<d<2k, by Theorem 2, let d=2k−1+s, with s∈[1,2k−1−1]. If
2l−1∑i=02k−1−1∑j=0(ci,1+2k−1j)2k−1≠0,
and considering the binary representation of s as s=(sk−2,sk−3,…,s0), that is, s=∑k−2i=0si2i, for all i′∈[0,k−1], let
χisi=2l−1∑isi=0(Cisi)si⋅2i′.
Then, for every s∈[1,2k−1−1], referring to Equation (3),
M2k−1+s=I2l⊗(2l−1∑i=0(Ci)2k−1∏i′χisi)⋅Ms0
are not in the form of a constant multiplication of the identity matrix. Furthermore,
φ(x)=(x−2l−1∑i=02k−1∑j=0ci,j)2k−1+s
is not an annihilating polynomial of M. Thus, the degree of the minimal polynomial of matrix M is indeed 2k.
□
IV.
Subspaces of special block matrix with circulant block
In this section, we present a lower bound on the dimension of the maximal invariant subspace for P-SPN scheme with special block matrices with circular block. A generic P-SPN scheme means that when the linear layer of the scheme is any type of matrix, the conclusions in Lemma 2 are always valid.
Lemma 2 [26] Consider a P-SPN structure scheme defined over the field F2n, with a non-linear layer comprising s S-boxes. The output words following the S-box operation are represented by the set J={j0,j1,…,js−1}. The round function R is characterized by Equation (1). Its linear layer is described by an invertible matrix M, with the minimal polynomial f(x) satisfying deg(f)=d, where d<⌊t/s⌋. The matrix A is defined by:
where (Mi)[jm,:] denotes the jm-th row of Mi for i∈{0,1,…,d−1} and jm∈J. Denote the solution space of A⋅X=0 by W. A subspace U⊂Ft2n is an invariant subspace of the P-SPN structure if and only if U⊆W. Moreover, the maximum invariant subspace of the scheme, denoted by Umax⊆W, has a dimension of at least t−sd, and for all X∈Umax, no S-boxes are activated after any rounds of encryption.
Our work establishes the existence of an invariant subspace through the annihilating polynomial of the linear matrix and its degree. According to the definition of matrix A, the invariant subspace U in Lemma 2 is naturally a necessary and sufficient condition. That is, if U⊆W, then to generate an infinitely long invariant subspace trail without active S-boxes, it must satisfy U=M⋅U. Furthermore, when invariant subspaces exist, our objective is twofold: to construct the maximal invariant subspace and to ascertain its dimension. This dimension is correlated with both the degree of the annihilating polynomial of the linear matrix and the count of S-boxes in the S-box layer.
In the subsequent sections, we shall delve into the maximal invariant subspaces associated with P-SPN structure schemes. Specifically, we focus on instances where the linear layer matrices are characterized as eversible special block matrix with circulant blocks.
Theorem 6 Given the P-SPN structure scheme defined over finite field F2n. The round function R is defined by Equation (1). The linear layer matrix is an reversible special block matrix with circulant blocks M, and its minimal polynomial is f(x), where deg(f)=d, and d<⌊t/s⌋. The non-linear layer consists of s S-boxes, and the set J={j0,j1,…,js−1} denotes the output words following the S-box operations. Subsequently, the dimension of the maximum invariant subspace Umax⊆Ft2n within the scheme at least t−sd. Furthermore, for every vector X∈Umax, no S-boxes are activated after any S-boxes after any rounds of encryption.
Proof Since M is an invertible matrix forming a special block matrix with circulant block of order (2l,2k), and with f(x) being an annihilating polynomial of matrix M, we draw upon Lemma 2 to establish the existence of a subspace Umax with a dimension of at least t−sd. For every vector X∈Umax, no S-boxes are activated after any number of rounds within the P-SPN layer.
□
By using Theorem 6, we can get that the lower bound of the dimension of the R-round maximal invariant subspace of a special block matrix with circulant blocks is 2k+l−sd, R represents an arbitrary number of iterative rounds.
For the case of s=1, in which the nonlinear layer of the P-SPN structure algorithm has only one S-box, the accurate value of its maximum invariant subspace dimension can be obtained.
Theorem 7 Given the P-SPN structure scheme defined over finite field F2n. The round function R is defined by Equation (1). The linear layer matrix is an reversible special block matrix with circulant block M, and its minimal polynomial is f(x), where deg(f)=d, and d<⌊t/s⌋. The non-linear layer consists of a single S-box (s=1), and the set J={j} denotes the output words following the S-box operations. Subsequently, the dimension of the maximum invariant subspace Umax⊆Ft2n within the scheme is equal to t−d. Furthermore, for every vector X∈Umax, no S-boxes are activated after any S-boxes after any rounds of encryption.
Proof To establish the preceding result, we initially define j=(ε−1)⋅2k+ξ, where 1≤ε≤2l and 1≤ξ≤2k. We then construct the matrix
A=((M0)[j,:](M1)[j,:]⋮(Md−1)[j,:])
where (Mi)[j,:] denotes the j-th row of Mi for i∈{0,1,…,d−1} and j∈J. It is recognized that A is a d×2k+l matrix. The solution space of A⋅X=0 is denoted by W. Referring to Lemma 2, the maximum invariant subspace of the scheme is represented as W=Umax.
For any i∈{0,1,…,d−1}, given that M is a special block matrix with circulant block, Theorems 3.1 and 3.2 demonstrate that Mi is also a special block matrix with circulant block. Furthermore, each matrix Mi can be distinctly identified by the 2l matrices located in its ε-th row.
For any 1≤ξ′≤2k, the (Mi)[(ε−1)⋅2k+ξ′,:] is derived from (Mi)[(ε−1)⋅2k+ξ,:] by a cyclic shift of ξ−ξ′ positions to the left, expressible as
where P is a 2k×2k substitution matrix, and ξ−ξ′ is calculated by modulo 2k.
To proceed with the proof of rank(A)=d, we will utilize the method of contradiction.
When ξ,ξ′ is fixed, for any i∈{0,1,…,d−1}, ξ−ξ′ is fixed, if we assume that rank(A)<d, there is a series of constant a0,a1,…,ad−1 that are not all zero, such that,
Since each matrix Mi can be distinctly identified by the 2l matrices located in its ε-th row, it holds for every 1≤ε′≤2l that
d−1∑i=0ai(Mi)[(ε′−1)⋅2k+ξ,:]=0.
Thus, we can prove that
d−1∑i=0ai⋅(Mi)=0.
At this juncture, we can assert that the polynomial g(x)=∑d−1i=0aixi serves as an annihilating polynomial for the matrix M, with g(x) having a degree of d−1. This finding contradicts the established minimal polynomial degree of M, which is d, thereby indicating a discrepancy in our assumptions. Therefore, the rank of the matrix A is d, that is, rank(A)=d.
Finally, the dimension of the solution space W of the equation system A⋅X=0 is dim(W)=t−rank(A)=t−d, and thus it follows that
dim(Umax)=dim(W)=t−d.
□
Utilizing Theorem 7, we deduce that the lower bound of the dimension of the R-round maximal invariant subspace of a special block matrix with circulant blocks is 2k+l−d, R represents an arbitrary number of iterative rounds.
As everyone knows, the choice of both the quantity and the strategic placement of S-boxes within P-SPN structures significantly influences the algorithmic security, necessitating further investigation into the optimization and positioning of these nonlinear components. Next, we will focus on discussing the relevant aspects of this part.
From Lemma 2, previous literature has concluded that no invariant subspace exists when s=2k. However, our work further challenges and refutes that perspective. The specific conclusion is presented in Theorem 8. The specific results are shown in Table 1.
This paper presents a series of instance results based on the special block matrix with circulant block and the corresponding number and position of S-boxes. It can be observed that when l>k, the dimension of the largest invariant subspace is greater than in the case where l≤k. Therefore, from a design perspective, it is recommended to use parameters with l>k when constructing the linear layer with such matrices.
Theorem 8 Given the P-SPN structure scheme defined over the finite field Ft2n. The round function R is defined by Equation (1). The linear layer matrix is an reversible special block matrix with circulant block M, and its minimal polynomial is f(x), where deg(f)=d, and d<2⌊(t/s)−1⌋. The non-linear layer consists of s=2k coterminous S-boxes, all aligned within the same block of the corresponding linear matrix. The set J={j0,j1,…,js−1} represents the output words subsequent to the S-box operations. Subsequently, the dimension of the maximum invariant subspace Umax⊆Ft2n within the scheme is determined to be at least t−s(d/2+1). This calculation provides a compact lower bound for the dimension of the subspace. Furthermore, for every vector X∈Umax, no S-boxes are activated after any S-boxes after any rounds of encryption.
Proof To substantiate the preceding result, we initially define the index jξ=(ε−1)⋅2k+ξ, where 1≤ε≤2l and 0≤ξ≤s−1. We then construct the matrix
where (Mi)[j,:] denotes the j-th row of the matrix Mi for i∈{0,1,…,d−1} and j∈J. It is established that A is a sd×2k+l matrix. The solution space of A⋅X=0 is denoted by W. Furthermore, referring to Lemma 2, the maximum invariant subspace of the scheme is represented as W=Umax.
We are currently considering a scenario where the non-linear layer comprises s=2k coterminous S-boxes, all of which are aligned within the same block of the corresponding linear matrix.
For any i∈{0,1,…,d−1}, given that M is a special block matrix with circulant block, Theorems 3.1 and 3.2 demonstrate that Mi is also a special block matrix with circulant block. Moreover, it is established that each matrix Mi can be distinctly identified by the 2l matrices located in its ε-th row.
Assuming the S-box is taken from the block in its ε-th row, A can be represented as shown in Matrix (4). From this matrix, it can obviously be inferred that, the number of rows satisfying (∑2l−1i=0(Ci)2m,0,…,0) is ⌊log2d⌋−1. Referring to Equation (2), we can deduce that the number of rows satisfying (M2m+n(∑∏),0,…,0) is
Accordingly, as 1≤ε≤2l takes all possible values, we can demonstrate the identical outcome in each scenario.
Therefore, the dimension of the solution space W of the equation system A⋅X=0 is
dim(W)≥t−rank(A)≥t−(sd−2k⋅(d/2−1))=t−s(d/2+1),
which implies that
dim(Umax)≥dim(W)≥t−s(d/2+1).
□
Example 2 Let M be a special block matrix with circulant block of F2, with orders (2l,2k)=(23,2). The block matrices are defined as follows: C0=C1=C6=circ(1,0),C2=C4=circ(0,1),C3=C7=circ(1,1),C5=circ(0,0). where the non-linear layer comprises s=2 coterminous S-boxes, all of which are aligned within the same block of the corresponding linear matrix. Consequently, it can be demonstrated that, M2k=M2=I24. Thus, d=2, and we can derive the matrix A as follows:
A=(I20…0C0C1…C7),
where rank(A)=4. The solution space of A⋅X=0 is denoted by W, where e(⋅) denotes a vector with a 1 in the subscripted position and 0s elsewhere. That is,
In recent years, there has been a surge of interest in symmetric codes designed for multi-party computation, fully homomorphic encryption, and zero-knowledge proofs. The P-SPN structure has emerged as a promising strategy in cryptographic design. However, current research has not yet provided a systematic investigation into the security aspects of the linear layer within this structure. Furthermore, there is a need for a more comprehensive theoretical framework to underpin the design principles, construction techniques, and parameter selection processes. In this paper, we show that the matrix used in P-SPN schemes has a considerable impact on the security level provided by the cryptosystem. We have made several contributions towards both the theoretical understanding and the practical use of MPC-∖ FHE-∖ ZK-friendly symmetric cryptographic algorithms. Firstly, we investigate the properties of a special block matrix with circulant block, which is employed in the linear layer matrix of the P-SPN structure schemes. Furthermore, this study also presents the annihilating polynomial of low degree of this type of special matrix, as well as puts forward the range of determining its minimum polynomial degree. Finally, we provide a lower bound estimate for the dimension of the largest invariant subspace within the P-SPN structure schemes when it incorporates this specific type of matrix. On the one hand, for instances of the P-SPN structure schemes where s=1, we are able to precisely determine the dimension of its maximum invariant subspace. On the other hand, for cases with s>1, with some certain specific conditions, our research establishes more compact lower bound for the dimensionality of the maximum invariant subspace.
Further exploration is needed for various linear layer matrix types, such as Cauchy and Vandermonde matrices. Analyzing these matrices to understand their transformational relationships is crucial. Such analysis will provide designers with intuitive guidelines for selecting appropriate matrices in P-SPN schemes. Our goal extends beyond circulant matrices to identify conditions that confer resistance to invariant subspace attacks across different matrix types, including those over binary and prime fields. We aim to generalize our findings from binary fields to other fields and to consider the impact of active S-boxes. Additionally, developing more effective techniques for invariant subspace attacks is a priority. We foresee achieving these objectives in the near future.
Acknowledgements
This work was supported by the National Natural Science Foundation of China (No. 62072445). We express our sincere gratitude to the editorial team of the Chinese Journal of Electronics and all the peer reviewers for their diligent work and valuable contributions to the review process.
M. R. Albrecht, C. Rechberger, T. Schneider, et al., “Ciphers for MPC and FHE,” in Proceedings of the 34th Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2015, Sofia, Bulgaria, pp. 430–454, 2015.
[2]
P. Méaux, A. Journault, F. X. Standaert, et al., “Towards stream ciphers for efficient FHE with low-noise ciphertexts,” in Proceedings of the 35th Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2016, Vienna, Austria, pp. 311–343, 2016.
[3]
A. Canteaut, S. Carpov, C. Fontaine, et al., “Stream ciphers: A practical solution for efficient homomorphic-ciphertext compression,” Journal of Cryptology, vol. 31, no. 3, pp. 885–916, 2018. DOI: 10.1007/s00145-017-9273-9
[4]
C. Dobraunig, M. Eichlseder, L. Grassi, V. et al., “Rasta: A cipher with low ANDdepth and few ANDs per bit,” in Proceedings of the 38th Annual International Cryptology Conference on Advances in Cryptology – CRYPTO 2018, Santa Barbara, CA, USA, pp. 662–692, 2018.
[5]
P. Hebborn and G. Leander, “Dasta – alternative linear layer for Rasta,” IACR Transactions on Symmetric Cryptology, vol. 2020, no. 3, pp. 46–86, 2020. DOI: 10.13154/tosc.v2020.i3.46-86
[6]
M. Albrecht, L. Grassi, C. Rechberger, et al., “MiMC: Efficient encryption and cryptographic hashing with minimal multiplicative complexity,” in Proceedings of the 22nd International Conference on the Theory and Application of Cryptology and Information Security on Advances in Cryptology – ASIACRYPT 2016, Hanoi, Vietnam, pp. 191–219, 2016.
[7]
L. Grassi, C. Rechberger, D. Rotaru, et al., “MPC-friendly symmetric key primitives,” in Proceedings of 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna Austria, pp. 430–443, 2016.
[8]
M. R. Albrecht, L. Grassi, L. Perrin, et al., “Feistel structures for MPC, and more,” in Proceedings of the 24th European Symposium on Research in Computer Security on Computer Security – ESORICS 2019, Luxembourg, pp. 151–171, 2019. (查阅网上资料,未找到本条文献出版地信息,请确认) .
[9]
L. Grassi, R. Lüftenegger, C. Rechberger, et al., “On a generalization of substitution-permutation networks: The HADES design strategy,” in Proceedings of the 39th Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2020, Zagreb, Croatia, pp. 674–704, 2020.
[10]
C. Dobraunig, L. Grassi, A. Guinet, et al., “CIMINION: Symmetric encryption based on Toffoli-gates over large finite fields,” in Proceedings of the 40th Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2021, Zagreb, Croatia, pp. 3–34, 2021.
[11]
T. Ashur and S. Dhooghe, “MARVELlous: A STARK-friendly family of cryptographic primitives,” Available at: https://eprint.iacr.org/2018/1098, 2018-11-15.
[12]
A. Aly, T. Ashur, E. Ben-Sasson, et al., “Design of symmetric-key primitives for advanced cryptographic protocols,” IACR Transactions on Symmetric Cryptology, vol. 2020, no. 3, pp. 1–45, 2020. DOI: 10.13154/tosc.v2020.i3.1-45
[13]
L. Grassi, D. Kales, D. Khovratovich, et al., “STARKAD and POSEIDON: New hash functions for zero knowledge proof systems,” IACR Transactions on Symmetric Cryptology, vol. 2019, no. 2, article no. 458, 2019. (查阅网上资料, 未找到本条文献信息, 请确认) .
[14]
J. Ha, S. Kim, B. Lee, et al., “Rubato: Noisy ciphers for approximate homomorphic encryption,” in Proceedings of the 41st Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2022, Trondheim, Norway, pp. 581–610, 2022.
[15]
J. Cho, J. Ha, S. Kim, et al., “Transciphering framework for approximate homomorphic encryption,” in Proceedings of the 27th International Conference on the Theory and Application of Cryptology and Information Security on Advances in Cryptology - ASIACRYPT 2021, Singapore, Singapore, pp. 640–669, 2021.
[16]
L. Grassi, D. Khovratovich, C. Rechberger, et al., “POSEIDON: A new hash function for zero-knowledge proof systems,” in Proceedings of the 30th USENIX Security Symposium (USENIX Security 21), pp. 519–535, 2021. (查阅网上资料, 未找到本条文献出版地信息, 请补充) .
[17]
L. Grassi, D. Khovratovich, and M. Schofnegger, “POSEIDON2: A faster version of the POSEIDON hash function,” in Proceedings of the 14th International Conference on Cryptology in Africa on Progress in Cryptology - AFRICACRYPT 2023, Sousse, Tunisia, pp. 177–203, 2023, doi: 10.1007/978-3-031-37679-5 8.
[18]
B. Gerard, V. Grosso, M. Naya-Plasencia, et al., “Block ciphers that are easier to mask: How far can we go?” in Proceedings of the 15th International Workshop on Cryptographic Hardware and Embedded Systems - CHES 2013, Santa Barbara, CA, USA, pp. 383–399, 2013.
[19]
A. Bar-On, I. Dinur, O. Dunkelman, et al., “Cryptanalysis of SP networks with partial non-linear layers,” in Proceedings of the 34th Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2015, Sofia, Bulgaria, pp. 315–342, 2015.
[20]
I. Dinur, Y. M. Liu, W. Meier, et al., “Optimized interpolation attacks on LowMC,” in Proceedings of the 21st International Conference on the Theory and Application of Cryptology and Information Security on Advances in Cryptology – ASIACRYPT 2015, Auckland, New Zealand, pp. 535–560, 2015.
[21]
C. Dobraunig, M. Eichlseder, and F. Mendel, “Higher-order cryptanalysis of LowMC,” in Proceedings of the 18th International Conference on Information Security and Cryptology - ICISC 2015, Seoul, South Korea, pp. 87–101, 2016.
[22]
A. Bar-On, “Improved higher-order differential attacks on MISTY1,” in Proceedings of the 22nd International Workshop on Fast Software Encryption, Istanbul, Turkey, pp. 28–47, 2015.
[23]
C. Beierle, A. Canteaut, G. Leander, et al., “Proving resistance against invariant attacks: How to choose the round constants,” in Proceedings of the 37th Annual International Cryptology Conference on Advances in Cryptology – CRYPTO 2017, Santa Barbara, CA, USA, pp. 647–678, 2017.
[24]
L. Grassi, C. Rechberger, and M. Schofnegger, “Proving resistance against infinitely long subspace trails: How to choose the linear layer,” IACR Transactions on Symmetric Cryptology, vol. 2021, no. 2, pp. 314–352, 2021. DOI: 10.46586/tosc.v2021.i2.314-352
[25]
N. Keller and A. Rosemarin, “Mind the middle layer: The HADES design strategy revisited,” in Proceedings of the 40th Annual International Conference on the Theory and Applications of Cryptographic Techniques on Advances in Cryptology – EUROCRYPT 2021, Zagreb, Croatia, pp. 35–63, 2021.
[26]
B. L. Wang and W. L. Wu, “Security analysis of P-SPN schemes against invariant subspace attack with inactive S-boxes,” Designs, Codes and Cryptography, vol. 92, no. 11, pp. 3753–3782, 2024. DOI: 10.1007/s10623-024-01465-z
[27]
T. Beyne, A. Canteaut, I. Dinur, et al., “Out of oddity – new cryptanalytic techniques against symmetric primitives optimized for integrity proof systems,” in Proceedings of the 40th Annual International Cryptology Conference on Advances in Cryptology – CRYPTO 2020, Santa Barbara, CA, USA, pp. 299–328, 2020.
[28]
L Zhang and W. L. Wu, “Improved differential and linear active S-boxes search techniques for feistel type ciphers,” Chinese Journal of Electronics, vol. 24, no. 2, pp. 343–348, 2015. DOI: 10.1049/cje.2015.04.020
[29]
G. Leander, M. A. Abdelraheem, H. AlKhzaimi, et al., “A cryptanalysis of PRINTCIPHER: The invariant subspace attack,” in Proceedings of the 31st Annual Cryptology Conference on Advances in Cryptology – CRYPTO 2011, Santa Barbara, CA, USA, pp. 206–221, 2011.
[30]
T. Lyche, G. Muntingh, and Ø. Ryan, “The kronecker product,” in Exercises in Numerical Linear Algebra and Matrix Factorizations, T. Lyche, G. Muntingh, Ø. Ryan, Eds. Springer, Cham, pp. 179–188, 2020.
Table
1.
In accordance with the P-SPN structure scheme and the linear layer matrix configuration presented herein, we delineate the dimensions of the maximum invariant subspaces across various parameter settings. Herein, s denotes the count of S-boxes within the nonlinear layer, T indicates the number of the branch, and (l,k) signifies the order of the matrix. Furthermore, deg(f) is utilized to express the minimal polynomial degree of the linear layer matrix M, and dim(Umax) represents the dimension of the maximum invariant subspace of the P-SPN structure scheme under the corresponding linear layer.