Block cipher of self-inverse structure, application, instruction set, device and program
By designing an alternating self-inverse structure of odd and even wheels, combining the MDS matrix and S-box components, the problems of inconsistent wheel key form and insufficient diffusion efficiency in existing self-inverse packet ciphers are solved, and efficient encryption and decryption logic is achieved and low latency packet password.
Patent Information
- Application Number
- CN202411440321.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-10-15
AI Technical Summary
The existing self-inverse nature packet cipher standards have inconsistent wheel key forms during encryption and decryption, and it is difficult to achieve a combination of high diffusion efficiency such as SP structure and encryption and decryption mode switching such as feistel structure.
Design an overall structure, adopting an alternating self-inverse structure of odd wheels and even wheels, using MDS matrix and S box components, odd wheels are transformed through S component and MDS matrix transformation, and even wheels are transformed through MDS-1 to achieve the consistent encryption and decryption logic. , and the inverse operation logic of the inlet operator and the exit operator realizes the inverse order of the wheel key.
It realizes that the encryption and decryption logic is completely consistent, the diffusion efficiency is high, and decryption can be achieved by using the wheel key only inverse order. It has a simple structure and is suitable for hardware and software implementation, reducing circuit area and calculation delay.
Smart Images

Figure CN119030692A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer symmetric cryptography design and its industrial application, and more specifically to a block cipher with a self-reversible structure, and also to block cipher working mode application, instruction set design method, IP core product, CPU product, device, and program. Background Art
[0002] 1. Classic overall structures include SP structure, feistel structure, generalized feistel structure, MISTY structure, and Lai-Massey structure. SP structure standards include American AES, Korean ARIA, and ANUBIS; feistel structure (including generalized feistel structure) block ciphers include DES, Japanese Camellia, and Chinese SM4.
[0003] 2. Compared with the feistel structure, the advantage of the SP structure is that it has high diffusion efficiency. Each round of iteration can change each bit while the feistel structure only changes the state of 1 and a half bits. The "3.5 Number of Rounds" in "Advanced Encryption Standard (AES) Algorithm: Design of Rijndael" ([Belgian] Delmon et al., translated by Gu Dawu et al., Tsinghua University Press, January 2003) states that the two-round AES "full diffusion" round number index is better than the feistel structure cipher by at least three rounds. Compared with the SP structure, the advantage of feistel (including the generalized feistel structure) is that the encryption and decryption logic is consistent and only the reverse order of the round keys is required.
[0004] 3. The self-invertible block cipher standards include ARIA, ANUBIS, Khazad, "SP network structure lightweight LBT block cipher with consistent encryption and decryption" and its citation (patent application number 201711093878.4). The designs are all SP structures, not non-feistel structures, and the designs all use the involution property P transformation component or S transformation component. In particular, the ARIA algorithm uses a 128X128 involution matrix with 8 branches, ANUBIS uses a 32X32 involution matrix and an 8X8 involution S box, and each round of LBT transformation is a composite structure of 2 layers of S boxes and an involution MDS matrix.
[0005] 4. Block cipher standards all define the logical function transformation from plaintext to ciphertext. For different industrial applications and working modes, the input and output of the logical function transformation or inverse transformation are obviously not limited to plaintext and ciphertext, but at least involve IV and noise. Confidentiality modes include ECB mode, CBC mode, OFB mode, CFB mode, CTR mode, XTS disk mode, and self-synchronization mode; authentication working modes include CBC-MAC, CMAC, CBCR, and TrCBC; authentication encryption working modes include Encrypt-then-MAC, OCB, CCM, and GCM. According to textbooks, one type of experts only studies the design of block ciphers, and the other type of experts only studies the working modes of block ciphers and their security assessments; it is generally believed that the industrial application of block ciphers is a combination of a certain block cipher and a certain working mode. Summary of the invention
[0006] Instruction manual reading guide statement: Those with the ☆☆ prefix are the highest-level summaries, which mainly summarize the technical problems, inventive points, inventive concepts and core technical effect statements of the present invention; the ☆ prefix and serial number guide the invention content of the present invention.
[0007] The inventor studied the advantages and disadvantages of the overall structure of block ciphers such as ARIA, ANUBIS, and Khazad; the inventor found that although the self-inverted (involutive) block cipher standard described in the background technology formally realizes the self-inverted structure, that is, the encryption and decryption logic is completely consistent, the wheel key forms of the two stages of encryption and decryption are different, and the wheel key for encryption and decryption differs by one P transformation (linear transformation); the inventor also found that the self-inverted structure or block cipher standard of the background technology contains an involutive S-box component or an involutive P transformation component. The overall structure that the block cipher design field and the industrial application field have always dreamed of is that the diffusion efficiency is as high as the SP structure, and the encryption and decryption mode switching is preferably reversed like the feistel structure.
[0008] In summary, ☆☆1 The technical problem and purpose of the present invention is to construct a new self-reversible block cipher that meets the above properties; in particular, a competitive design that can challenge Aes, Sm4, and ARIA should be given in the embodiment. ☆☆1 Invention content, an overall structure is created, and the overall structure has two properties: 1. The diffusion efficiency is as high as the SP structure, and 2. The encryption and decryption mode switching is equal to the reverse wheel key.
[0009] The main research process and invention results are described as follows:
[0010] The inventors believe that only by creating a completely new overall structure can the above technical problems be solved, because the block cipher structures and standards of the background technology cannot solve the technical problems and invention purposes of the present invention.
[0011] The inventor believes that the key to designing a self-reversible structure is to arrange S components, S -1 Component, PComponent, P -1 Components, finally realizing a self-inverting structure of alternating S components and P components. It should be noted that the S components or P components may be of involutive nature or not. After a large number of permutation and combination experiments, the inventor finally found the first design that meets the purpose of the present invention, which is denoted as ☆**1.
[0012] ☆**1 is the first principle design - block cipher including MDS matrix
[0013] The encryption from plaintext to ciphertext is defined as follows:
[0014] 1. A self-inverting structure that starts with an odd number and alternates between an even number and an odd number.
[0015] The beginning of encryption is the first round, and the end of encryption is the third or fifth round;
[0016] 2. Odd round: Input (st, rkeyi, rkeyi+1), output
[0017] S component transformation
[0018] or
[0019] S component transformation (st+rkeyi)-rkeyi+1;
[0020] Among them, S component transformation () is 16 juxtaposed involution property S boxes,
[0021] The recommended typical design of S box is That is, the nonlinear part of the AES S-box;
[0022] 3. Even round: input (st), output
[0023] MDS -1 (S component transformation (MDS(st)));
[0024] Among them, MDS() is an MDS matrix transformation (maximum distance coding matrix) with a specification of 16 bytes*16 bytes.
[0025] Taking round 5 as an example, we analyze the basic structural types of the above block ciphers. First, we remove the combination of the wheel keys and only analyze the combination of the S component and the P component. The following intermediate calculation steps can be expanded to prove that the technical characteristics of the SP structure are met. In fact, the wheel keys are isolated one by one by the S() logic.
[0026] Plain text->S()->MDS->S()->MDS -1->S()->MDS->S()->MDS -1 ->S()->ciphertext.
[0027] Taking round 3 as an example, it is proved that the encryption / decryption conversion can be achieved by reversing the wheel keys; in the encryption stage, there are obviously 4 sets of wheel keys (actually 2 pairs), recorded as Rkey0, Rkey1, Rkey2, Rkey3; in the decryption stage, it is only necessary to reverse the order to Rkey3, Rkey2, Rkey1, Rkey0 to achieve decryption. The concepts of entry operator and exit operator are introduced for the first time here, and the "S component transformation" The corresponding operation logic is and The operation logic corresponding to "S component transformation (st+rkeyi)-rkeyi+1" is "+" and "-" respectively.
[0028] The following uses the differential branch number theory to evaluate the ability of ☆**1 to resist differential analysis, which proves that the block cipher has a strong diffusion effect. Because the number of branches of the MDS matrix is not less than 17, the lower bound analysis result of the active S box is obtained.
[0029] ☆**1 Algorithm round number: 1 2 3 4 5 6 7 8 9
[0030] Lower bound of number of active S-boxes: 1 17 18 34 35 51 52 68 69
[0031] So far ☆**1 embodiment - the block cipher including the MDS matrix can achieve the technical problem and invention purpose of the present invention. That is, the diffusion efficiency is the same as the SP structure, and the decryption method only needs to use the wheel key in reverse order, which obviously satisfies the self-reversibility according to the definition.
[0032] ☆**1 The embodiment gave the inventor great confidence. The inventor continued to explore more embodiments that met the purpose of the invention and refined the common contents, and finally summarized the invention points and invention concepts.
[0033] The following is the research process of the inventor inventing the X-structure component. For the MDS matrix element of embodiment ☆**1, this element contributes to the full diffusion effect and the maximum branch number effect. For the convenience of presentation, it is defined that the "quasi-MDS matrix" is a full diffusion matrix (the number of branches is not limited); a square matrix of all 1 elements minus the unit matrix is a typical "quasi-MDS matrix"; obviously, the number of branches of the quasi-MDS matrix can be very small but it can still be used as a component to construct a block cipher. Continue to reduce the avalanche effect of the component, do not select the property matrix of full diffusion or nonlinear transformation, the inventor tracks the position of the related output bit after the input bit undergoes logical transformation or certain components, and the inventor's research results are either a self-inverted structure or an X structure, where the mathematical formula of the X structure is defined as X({l, r})={F -1 (r),F(l)}.
[0034] The following are some of the research results and summaries. 奇 (), the module combination of even rounds is refined into S 偶 (). Specifically to ☆**1 embodiment, MDS -1 (S component transformation (MDS())) is equal to S even (), S component transformation () is equal to S odd (). The inventors found that the definition of MDS (S component transformation (MDS -1 The design of ())) equals Sodd() and S component transformation () equals Seven() can also achieve the technical problem and invention purpose of the present invention, and the number of branches is exactly the same. The inventor found that based on the X structure component design concept, the S box and S box inverse logic of AES can also construct S component transformation () that meets the involution property. The specific method is 8 S boxes and 8 S -1 The left 8 bytes of the input are concatenated through 8 boxes, and the result is placed on the right. The right 8 bytes of the input are concatenated through 8 S -1 The result is placed on the left. This type of structural construction method is called X structure. There are more construction methods in the embodiments and terminology, such as based on 2 128 The construction of the multiplication inverse element on the field, two S even and S odd designs based on ARX instructions or ARX modules are given in Example 5. In short, S even and S odd are essentially a kind of logical transformation, which can complete certain diffusion and confusion functions by itself, and achieve the effect of (error) full diffusion through the combined action of the two.
[0035] ☆☆2 In order to intuitively reflect the invention point and the invention concept, the following formula is used to describe the overall structure. The use of the formula description makes it easier to prove the self-reversibility of the overall structure.
[0036] 1. Encryption starts from round 1 and ends at an odd round;
[0037] 2. Odd rounds: Input (st, rkeyi, rkeyi+1), output
[0038] S_odd(rkeyi + st) - rkeyi+1
[0039] where S_odd = S_odd -1 , it should be noted that the "+" and "-" operators can be generalized to the concepts of the input arithmetic unit and the output arithmetic unit;
[0040] 3. Even rounds: Input (st), output
[0041] S_even(st), where it is recommended that S_even ≠ S_odd, and S_even = S_even -1 .
[0042] ☆☆Summary of the invention points. First, the present invention involves 4 indispensable components, and the definitions and construction of the connection relationships of the 4 components are defined through 3 invention points. The first invention point is the structure of the start of an odd round ending and the alternation of even rounds - odd rounds. The other 2 invention points are stated as follows.
[0043] The second invention point: The input arithmetic unit and the output arithmetic unit are inverse operation logics. The S_odd logic transformation is respectively connected to the output end of the input arithmetic unit and one input end of the output arithmetic unit. The main function of the arithmetic unit is to fuse the entropy (information) of the round key with the plaintext or a certain intermediate result. There is a cancellation synergistic effect between the two arithmetic units. Because of the inverse operation logic design, there is a cancellation effect, and the cancellation effect realizes the consistency of the encryption and decryption logics. Additionally, if the two pairs of arithmetic units designed can provide a certain non-linear confusion effect, it is also acceptable. The main contribution of this invention point is that the encryption and decryption mode can be switched by simply reversing the round key without changing the logic circuit; here, the S_odd logic must contribute a certain diffusion effect, but the confusion effect depends on the situation. If the arithmetic unit cannot contribute a non-linear confusion effect, the S_odd logic must contribute a sufficient non-linear confusion effect. It should be noted that in addition to the common "+" and "-", "*" and " / " operators, a two-dimensional substitution table controlled by the round key can also be selected; in the term explanation and Example 6 parts, the demonstration of the vertical decomposition and horizontal decomposition of the "output of the input arithmetic unit and the output arithmetic unit" will be detailedly stated.
[0044] The third invention point: "Recommend Seven ≠ Sodd", especially recommend "limit Seven ≠ Sodd"; the actual protection scope is all of Seven ≠ Sodd and the part of Seven = Sodd. The above invention points are the result of research and deduction. The effect contributed by this invention point is that there is freedom in the selection of Seven logic and solves the problem of failure in constructing block ciphers due to poor diffusion ability of Sodd. More specifically, because Seven ≠ Sodd, theoretically there are many choices for Seven. Proof by contradiction: The inventor found that if Seven = Sodd is limited and Sodd cannot be fully diffused, then the entire block cipher will fail in the overall design because it cannot be fully diffused. Here, "fully diffused" means that each input symbol is associated with all input symbols; obviously, constructing the fully diffused "Sodd = Seven" logic is not friendly to the design of block ciphers and the engineering implementation of block ciphers.
[0045] ☆☆4: Combining ☆☆2 and ☆☆3, the invention concept is to construct a self-inverting block cipher for 4 components and 3 invention points, and its language description is as follows. It should be noted that for the description of the structure, the numbers have no execution order restrictions.
[0046] ☆1. A block cipher with a self-reversible structure, including several groups of round keys, the invention content is an overall structure, the overall structure is a self-reversible structure starting with odd rounds and alternating between even rounds and odd rounds,
[0047] The overall structure is defined as follows:
[0048] 1. The encryption starts with the first round and ends with an odd-numbered round;
[0049] 2. The odd-numbered wheel structure is a series structure consisting of three components;
[0050] The decomposition from input to output in the encryption direction is:
[0051] Entry operator, S odd and exit operator,
[0052] Among them, the input operator and the output operator are designed with inverse operation logic, and S is a self-inverse logic transformation;
[0053] 3. The internal connection relationship of the odd-numbered rounds is:
[0054] The input of the entry operator is connected to a set of wheel keys.
[0055] The input of the export operator is connected to a set of wheel keys.
[0056] The odd input of S is connected to the output of the entry operator.
[0057] The output of S is connected to the other input terminal of the output operator;
[0058] 4. An even number of rounds is equal to a self-inverse logical transformation, denoted as S even;
[0059] 5. The relationship between Seven and Sodd is, "recommend Seven ≠ Sodd"; specifically, the limited scope of "recommend Seven ≠ Sodd" is a special term, and "recommend Seven ≠ Sodd" means Seven ≠ Sodd for all and Seven = Sodd.
[0060] It should be noted that the "series structure including three components" is not limited to three components. The following is an example of a series structure of five components, based on the formula description of the odd-numbered wheel of ☆☆2, Px -1 (S odd (rkeyi + Px (st)) - rkeyi + 1), where Px and Px -1 It is a pair of reversible transformations. For a more detailed demonstration, see Example 6 and the explanation of related terms; in short, the design scheme that achieves the same technical effect of the present invention by promoting the main inventive concept of cancellation based on the demonstration and explanation of this specification also belongs to the protection scope of the present invention.
[0061] ☆☆5: Demonstrate and state the main invention effects:
[0062] 1. The overall structure of the present invention can achieve that the encryption and decryption logics are completely consistent, and decryption can be achieved by simply using the wheel key in reverse order. Substituting into formula ☆☆2, it is obviously established.
[0063] 2. In the construction phase of S even and S odd logic components, as long as the S even and S odd logic of ☆☆2 does not degenerate, an SP type block cipher can be constructed. Here, non-degenerate means that each output of S even and S odd is associated with at least 2 input symbols.
[0064] First of all, the structural construction results of ☆☆2 and ☆1 can solve the technical problems of the present invention. The above technical effects are derived from industrial applications and engineering implementations in that a set of hardware, software or instruction sets can realize encryption and decryption functions, and the form of the wheel key remains unchanged, because the overall structure of the present invention is equivalent to a certain SP structure cipher, which can theoretically construct a low-latency block cipher with good parallelism using branch number analysis technology; in short, it is very friendly to software development and implementation, hardware development and implementation, and user use.
[0065] In summary, the technical effects of the invention also include:
[0066] 3. It is very user-friendly for users who call the encryption and decryption modules. They only need to call one set of software, hardware or instruction set.
[0067] 4. It is friendly to engineers who develop encryption and decryption modules. They only need to focus on developing one set of encryption software, one set of encryption hardware or one set of encryption instruction sets, saving manpower and circuit area.
[0068] ☆2. The block cipher according to ☆1, wherein the input arithmetic unit and the output arithmetic unit are modulo-2 addition arithmetic units, that is operation;
[0069] The odd rounds only include 3 components, specifically an input arithmetic unit, an output arithmetic unit, and an S-odd logic module;
[0070] It is defined that S-even ≠ S-odd.
[0071] Statement of design principle and technical effect. 1. Compared with the “+” and “-” arithmetic units and more complex round key selection substitution tables, The operation is the design with the least energy consumption and area consumption, which can be efficiently implemented by both the CPU and hardware, and is also the most commonly used arithmetic unit in block cipher design. 2. Since S-even ≠ S-odd is defined, there are theoretically a large number of selections for S-even; compared with the LBT structure in the background technology, S-odd and S-even do not need to be restricted to the design category of full diffusion. 3. Only including 3 components is the simplest and most concise design in engineering, and the formal simplicity is a design advantage; more morphological construction methods of odd rounds will be stated in the term explanations and embodiments of the arithmetic unit and odd rounds. The inventor believes that the technical effect of a more complex design is that the security may be better at the same computational cost, and a more complex structure is disadvantageous to the security analysis side.
[0072] ☆3. The block cipher according to ☆1 or ☆2,
[0073] S-even and S-odd share the same non-linear logic.
[0074] Statement of design purpose and technical principle: In order to compete with the feistel structure in the 1-cycle-1-round mode in terms of circuit area performance and substantially solve the problem of circuit area saving; the saved area quantity / code space quantity is approximately equal to the area of the non-linear logic that can be reused. The solution is to select S-even and S-odd stages to try to ensure that the area of the non-linear logic that can be reused is large enough.
[0075] The above construction method can be described and evaluated by formulas. The reused non-linear logic is denoted as Wire_Share(). Therefore, S-odd and S-even of the present invention are organized into the following expressions:
[0076] S-odd(st) = P-odd -1 (Wire_Share(P-odd(st)))
[0077] and S-even(st) = P-even -1 (Wire_Share(P-even(st)).
[0078] Obviously, it is only necessary to increase the area of the selection circuit slightly to achieve the reuse of Wire_Share(). The following is the behavioral description of the Verilog hardware code, and flage guides the selection of either S odd or S even.
[0079] Input (st, flage), output out128;
[0080] assign w_temp = Wire_Share(flage == 1? P_odd(st) : P_even(st));
[0081] assign out128 = flage == 1? P_odd -1 (w_temp) : P_even -1 (w_temp).
[0082] Evaluate the area consumption of one round and one beat of the present invention from the above expressions. The total area of the encryption and decryption logics and the saved area are approximately: P_odd -1 () + P_odd() + P_even -1 + P_even + Wire_Share() + the area of the selection circuit and Wire_Share().
[0083] Furthermore, it is recommended that one of P_odd and P_even be selected as a direct transformation; typically, the structure is that S_odd(st) = P -1 (Wire_Share(P(st))), S_even = Wire_Share(). Define S_even() = X() and S_odd = P -1 (X(P())) design. The basic idea is that in the physical S_odd circuit, X({l,r}) = {Sx -1(r), Sx(l)} as large as possible. The requirement for the X component is that the P that cooperates with the X component at least realizes the entropy exchange between {l,r}. Of course, the selection of P requires low industrial implementation overhead and can actively increase the number of differential active S boxes. Examining the results of Example 2, the combinational circuit of the multiplexing mode in the 1-beat 1-round mode consumes 1603 cells, the combinational circuit of the S-odd mode in the 1-beat 2-round mode consumes 1508 cells, and the combinational circuit of the S-even mode consumes 1016 cells; therefore, it can be considered that the proportion of the circuit area reused in the 1-beat 1-round mode is 63.38% (1016 / 1603); taking S-odd as 1 unit, the ratio index of the circuit of the multiplexing mode to S-odd is 106.3% (1603 / 1508). The closer the former index and the latter index are to 1, the better; in short, the area ratio of the reused X component of the reused mode circuit in the 1-beat 1-round mode of EWES is equal to 63.38%, and the area of the reused mode circuit in the 1-beat 1-round mode is 106.3% of the operator + S odd logic, and the area of the selection circuit only consumes 6.3%. The analysis of the circuit area of the above embodiment can also prove that the area consumption of the 1-beat 1-round mode is basically equal to the largest area of S even and S odd; from the comprehensive results, the area of the selection circuit is indeed smaller, so the area saved is basically equal to Wire_Share() minus the area of the selection circuit.
[0084] ☆4. According to the block cipher described in ☆3,
[0085] The reused nonlinear logic is equal to the X-structured logic transformation, where the definition of the X-structured logic transformation is that the nonlinear transformation F of the left input is placed on the right, and the nonlinear transformation F of the right input is placed on the right. -1 Put it on the left.
[0086] Design principle and technical effect description. As mentioned above, the X structure component is also one of the inventive points of the embodiment of the present invention. The X structure component can construct S odd or S even components. Because the X structure has many advantages, it is defined that X() = Wire_Share(), where the mathematical formula of the X structure is defined as X({l, r}) = {F -1 (r),F(l)}.
[0087] Obviously, the X structure is self-inverted (involutive). It should be noted that F and F -1 Does not enforce self-inversion (i.e. F = F -1 ).
[0088] The main advantages of the X structure component are stated below, which are also the advantages of block cipher ☆4.
[0089] 1. To construct self-inverting S-even and S-odd components, there is no need to use self-inverting components, and the selection range is obviously wider.
[0090] 2. In some cases, F and F -1 can be implemented in parallel. For example, in the embodiment EWES, on a superscalar CPU platform, instruction pairing is used to pair the look-up table instruction and the calculation instruction.
[0091] ☆5. For the block cipher according to ☆4,
[0092] the length of the block cipher is limited to 8 bytes, 16 bytes or 32 bytes;
[0093] the number of final rounds of the block cipher is limited to N, where N is an odd number greater than or equal to 5;
[0094] F is limited to an SP structure design, where the S-box is designed as the inverse element in the 256 field and P has a linear diffusion effect.
[0095] Statement of design principle and technical effect. By limiting the SP structure, two benefits are brought:
[0096] 1) Since the P element of the F component already has a certain linear diffusion effect, when designing P and P -1 , the design pressure of the linear layer index is greatly reduced. More specifically, when P is in a certain XOR gate situation, it is easier to select a design with a very large differential branch number. The embodiment EWES algorithm is a design model. The branch number of 2 rounds of EWES is 10, but the P component of EWES only has 5 64-bit operations. Obviously, these linear relationships are not enough to support the design with a branch number of 10; therefore, the linear transformation of the F component of the EWES algorithm makes an indispensable contribution to the branch number up to 10.
[0097] 2) Similar to the large table look-up implementation of AES, it is friendly to superscalar instructions. Because sp -1 (r) and sp(l) are implemented in parallel, and the sp table look-up implementation and the operation of p -1 can be executed in parallel through instruction pairing. The measured results are shown in the performance of the embodiment EWES and AES on the X64 platform. The main definition of the EWES algorithm is that S_odd(st) = P -1 (X(P(st))), S_even = X(), where X({l, r}) = {sp -1 (r), sp(l)}.
[0098] ☆6. For the block cipher according to ☆5,
[0099] the length of the block cipher is limited to 16 bytes,
[0100] the differential branch number is limited to be greater than or equal to 10.
[0101] The purpose and significance of the above design is that the length of the block cipher is 16 bytes, which is the most widely used industrial interface standard at present; compared with industrial standards such as ARIA and AES, the number of differential branches greater than or equal to 10 is a large branch number design. It is a fact that there is a strong correlation and indivisibility of at least 10 bytes between each 2 layers of S-boxes. The inventor believes that no matter what kind of distinguisher is used for block cipher analysis, the number of branches based on 10 is sufficient to support the minimum security of 80 bytes, which is sufficient for IoT application scenarios. It should be noted that the method for determining the number of differential branches is to determine that the minimum code weight is not less than 10 through the check matrix. More specifically, it is proved by solving the equation that there is no correlation between any 9 columns of the 32 columns of the check matrix.
[0102] ☆7. According to the block cipher described in ☆6,
[0103] Encryption starts from round 1 and ends at round 7;
[0104] 8 sets of wheel keys, denoted as rkey0-rkey7;
[0105] Odd rounds: input st, output
[0106] S Qi
[0107] Where, S odd (t) = P -1 (X(P(t)));
[0108] Even round: input st, output X(st);
[0109] The called linear diffusion component P is defined based on the 64-bit modulo 2 addition instruction and the circular shift instruction. The input is {l,r}. The intermediate steps of the calculation are:
[0110] The called X() component: define X({l,r}) = {Sx -1 (r),Sx(l)}, where Sx -1 The (r) element is an sp structure transformation. More specifically, the p transformation part is a linear combination of 9 64-bit cyclic shifts. The 9 left shift parameters are 2, 0, 8, 16, 24, 32, 40, 48, and 56. The intermediate result of the linear combination is passed through 8 juxtaposed S -1 Box, S -1 Defined by the following S-box;
[0111] The called S-box: Based on the inverse element design on the GF256 domain, due to space limitations, the table lookup output of 0x00-0xff is shown in Example 2-EWES algorithm. The following is the table lookup output of 0x00-0x0f: b2 c0 a0 48 54 fc 99 2f 39 e3 2cf7 cc d8 5a 8d; the definition of other modules, P -1 () module and Sx() module refer to P() module and Sx -1 ()Module definition.
[0112] The above is also extracted from Example EWES, see the Example and its related drawings for details.
[0113] ☆8. A working mode (application method) based on a block cipher, the working mode is one of a confidentiality mode, an authentication working mode or an authentication encryption working mode, and the called block cipher meets the definition of ☆1-7.
[0114] Paragraph 4 of the background technology states that the use of block cipher standards is not limited to encryption and decryption scenarios. In fact, there are many working modes and related mode standards. The specific modes can refer to cryptography textbooks and industrial standards. Block cipher standards are recognized by the public for their performance and security evaluation. Regarding the performance and security of working modes, we can pay attention to the research results of scientists or the release of national standardization documents. Therefore, a block cipher standard + a working mode is the form of current industrial application.
[0115] In order to illustrate the position of the instruction set construction method of the present invention in the industrial ecology, the following supplementary explanation of common knowledge is given.
[0116] The definition of instruction set architecture (ISA), the interface between computer hardware and system software, standard, refers to the computing function characteristics and conceptual structure that can be seen by machine language programmers or operating system, compiler, and interpreter designers. Its core part is the instruction system, which also includes data type and data format definition, register organization, I / O addressing and data transmission method, interrupt structure, computer state definition and switching, storage protection, etc. The quality of ISA design directly determines the performance and cost of the computer. The instruction set is the computer ecosystem. Famous instruction set architectures include Intel and AMD's X64 series, ARM series, RISC-V, and ALPHE series.
[0117] According to the hierarchical division of the industrial ecosystem, the definition of the computer field from top to bottom is: user / application->operating system->instruction set architecture (ISA)->microarchitecture->IP hard core-(tapeout)->CPU chip.
[0118] ☆9. A method for constructing an instruction set, wherein the defined instructions functionally implement the S-odd logic transformation defined in ☆1-7, and / or the S-even logic transformation. The "or" situation means that one of the S-even logic transformation and the S-odd logic transformation is selected, and the other logic transformation can be quickly calculated by existing general instructions.
[0119] First of all, it should be noted that the general instruction set can implement any standard block cipher. The purpose of the new instruction is to accelerate the encryption and decryption speed of the block cipher. Based on the above reasons, the acceleration of the instruction set construction method focuses on the S-odd logic transformation and the S-even logic transformation. The purpose of the invention of ☆9 is that the defined new instructions can significantly accelerate the execution speed of S-even and / or S-odd. It should be supplemented that the designed instructions only accelerate the nonlinear transformation of S-even and S-odd, which also falls within the protection scope of ☆9, which is described in detail in the following "#4" paragraph.
[0120] There are industrial precedents and related patents for defining instructions to accelerate block ciphers or hash algorithms on the instruction set architecture. In particular, Intel has laid out a large number of patents for AES and hash algorithms. On the other hand, Intel's instruction set manual implements some patents as appropriate. For example, the instructions for AES-NI and VAES in the Intel instruction set manual are AESENC, AESENCLAST, AESDEC, AESDECLAST, AESKEYGENASSIST, and AESIMC. To complete the AES encryption and decryption functions, four instructions must be defined and used: AESENC, AESENCLAST, AESDEC, and AESDECLAST. The Loongson instruction set also defines instructions to accelerate SM4.
[0121] Because the encryption and decryption logic of the present invention is consistent and the encryption and decryption switching only requires the reverse wheel key, the present invention only needs to define and use 2 instructions. The 1-beat 2-round mode is, 1 Sodd->Seven instruction, 1 Sodd instruction. The 1-beat 1-round mode is, 1 Sodd instruction, 1 Seven instruction. The inventor believes that 2 instructions are more conducive to the wiring design of the micro-architecture layer and the IP hard core. In Example 2, a reference effect of Sodd and Seven multiplexing non-linear logic is given. Three instruction set design demonstrations are given below. According to the recommendation from performance priority to area priority, the 1-line 2-round mode is, The 1-line 1-wheel mode placed in front, The following description is for the EWES embodiment, Seven = X(st) and Sodd = P -1 (X(P(st))), its implementation principle can be extended to other block ciphers that meet the definition of ☆1-7.
[0122] #1 1 line 2 wheels mode
[0123] ALU type 3-operand instruction; the operands are recorded as %xmmx, %xmmy, %xmmz, and the opcodes are defined as follows.
[0124] The logical function corresponding to EWES_odd is: input (%xmmx, %xmmy, %xmmz)
[0125]
[0126] The logical function corresponding to EWES_odd_env is: input (%xmmx, %xmmy, %xmmz)
[0127] %xmmz←X(EWES_odd(%xmmx,%xmmy,%xmmz)).
[0128] Formally, EWES_odd_env is the output of EWES_odd concatenated with X(). Microarchitecture design suggests that speed-first implementation is implemented as 1-step EWES_odd_env, and area-first implementation is implemented as 2-step, 1-step calculation of EWES_odd and 1-step X().
[0129] #2 Pre-positioned 1-line 1-wheel mode
[0130] ALU type 3-operand instruction; the operands are recorded as %xmmx, %xmmy, %xmmz, and the opcodes are defined as follows.
[0131] EWES_xor_odd(%xmmx,%xmmy,%xmmz)
[0132] implement:
[0133] EWES_xor_env(%xmmx,%xmmy,%xmmz)
[0134] implement:
[0135] #3 Post-positioned 1-line 1-wheel mode
[0136] ALU type 3-operand instruction; the operands are recorded as %xmmx, %xmmy, %xmmz, and the opcodes are defined as follows.
[0137] EWES_odd_xor(%xmmx,%xmmy,%xmmz)
[0138] implement:
[0139] EWES_env_xor(%xmmx,%xmmy,%xmmz)
[0140] implement:
[0141] The above three operands are just function definitions. The Intel instruction set manual and related Intel patents have given enough reference examples for the implementation of the three operands. For example, %xmmz in a two-round mode can be called implicitly, such as specifying %xmmz as %xmm0; you can also refer to the reference example where all three operands are input registers. The reference embodiments of the post-placed 1-line 1-round mode are AESENC, AESENCLAST, VAESENC, and VAESENCLAST. How to integrate with the existing instruction set (ISA) depends on the choice of the instruction set copyright owner. For example, the advantage of the implicit method is that the critical path is fixed, so it is beneficial to generate the critical path physical circuit. The disadvantage of the implicit method is that it is not conducive to the pipeline structure compatible with the CPU microarchitecture.
[0142] #4 Implement instructions for X components or X components 1 and a half
[0143] First, some instruction sets do not support 128-bit registers, or the designers of the instruction sets believe that the area consumption of directly constructing a 1-round mode or a 2-round mode is too large. For the sake of engineering application compromise, only accelerating the nonlinear part of the X component is also a good effect. It can be considered that the designed instructions only accelerate the nonlinear transformation of S even and S odd, and other logical operations are implemented at high speed by the general instruction set. The inventor simulated the physical effect of a certain embodiment on the X64 platform, and the physical effect of the Sx(r) element and the Sx(l) element of the X component being accelerated by two hard instructions.
[0144] Comparing the X64 performance of Example EWES and Example 3.1, on the X64 platform, the performance of a single-channel EWES is 12.5C / B. If the X component Sx -1 (r) is defined as (r*A) mod 2 64 , the Sx(l) element is defined as (r*A -1 )mod2 64 , the measured result is 4.9C / B. If EWES Sx -1 The execution efficiency of the (r) instruction and the Sx(l) instruction is equivalent to the multiplication instruction of the i7-4770, and its performance is also equivalent to 4.9C / B, which is equivalent to a 250% improvement. Therefore, the design instruction only accelerates the nonlinear part of S even and S odd, and the effect is also significant.
[0145] Based on the above statements, we recommend one instruction to implement the "S odd + S even" design, which is defined as follows.
[0146] ☆10. According to the instruction set construction method described in ☆9,
[0147] The inlet operator and the outlet operator are modulo 2 add operators, that is, Operation;
[0148] The instructions constructed are two AUL type instructions, the operand mnemonics are %xmmx, %xmmy, %xmmz, and the instruction mnemonics that define the odd round function are fun_odd(%xmmx, %xmmy, %xmmz).
[0149]
[0150] Define the instruction mnemonic for odd round + even round function, fun_odd_env(%xmmx, %xmmy, %xmmz)
[0151] %xmmz←Seven(fun_odd(%xmmx,%xmmy,%xmmz));
[0152] The entity call mode of operand %xmmz is one of the following three situations: implicit call, 3-operand call, and coprocessor module call.
[0153] The demonstration of implicit call is i386's mul / imul instruction, eax / rax and edx / rdx registers as implicit source operands; the demonstration of 3-operand call is FMA3 instruction set and Intel patent "three-operand addition instruction" - CN102103486B; the coprocessor call can refer to the custom instruction set part of RISC-V, and the called coprocessor core module can refer to the appendix of this invention. Figure 6 -EWES Example 1: 2 rounds of state machine calculation circuit.
[0154] In order to state the position of the IP core (intellectual Property) products related to the present invention in the industrial ecology, common knowledge is supplemented again. Now the SOC ecology (System On chip) is prevalent in the chip industry. Chip manufacturers often reduce the complexity of the design by purchasing third-party hardware IP cores, and concentrate limited resources on the development of key modules of the integrated design core; in short, purchasing IP core products to build chips is one of the current industrial ecosystems. The IP core may take many forms, including hardware code (behavioral level description of the algorithm), netlist or layout (GDS). The layout is essentially a hardware IP core, which is a drawing for chip tape-out. Currently, companies selling IP hard core products include ARM, Sysnopsys, and TSMC.
[0155] ☆11. An IP core product, the IP core includes the S-odd logic transformation and / or the S-even logic transformation defined by ☆1-7, or the IP core includes the block cipher operation module defined by ☆1-7.
[0156] The block cipher constructed by the present invention is implemented in the IP core product in a manner including but not limited to an instruction set circuit for accelerating block cipher operations, especially a low-latency wiring design result which can be sold as a product. Figure 6 A block cipher computing component based on a finite state machine automaton.
[0157] ☆12. A CPU chip, the defined instructions functionally implement the S-odd logic transformation described in ☆1-7, and or, the S-even logic transformation. The "or" situation means that one of the S-even logic transformation and the S-odd logic transformation is selected, and the other logic transformation can be quickly calculated by other general instructions. For details, refer to the instruction set construction method in part ☆9.
[0158] Because the chip tape-out is based on IP hard core, the protection content and definition can refer to an IP core product.
[0159] ☆13. An information processing device, comprising a block cipher computing module capable of implementing the functions of ☆1-7.
[0160] The EWES of the embodiment of the present invention is a competitor of SM4 and AES, so in theory, the applications and devices involved in SM4 and AES, EWES or the present invention can replace the SM4 and AES modules. According to the Chinese standard guidance, commercial cryptographic products based on the SM4 algorithm at least include USB smart password keys, cloud server cryptographic machines, IPSec VPN gateways, and SSL VPN gateways. Industrial applications involved. According to the relevant working modes and relevant standards stated in Background Technology 4, physical product communication terminals, WiFi, and communication handsets. Modules such as authentication and encryption protection used by communication modules.
[0161] ☆14. A computer program product, comprising a computer program or instructions, characterized in that when the computer program or instructions are executed, the block cipher computing function defined by ☆1-7 is implemented.
[0162] The types of programs / instructions include binary executable codes and directly / indirectly executed scripting languages, where indirect means compiled and executed by a general compiler, such as go language code; computers here include but are not limited to general-purpose CPUs, single-chip microcomputers, and FPGA-type programmable hardware; so the corresponding code forms are: compilable codes include but are not limited to C language, Go language and other source codes, scripting languages include but are not limited to java, shell, FPGA codes include but are not limited to downloadable and executable hardware codes and corresponding behavioral level description hardware codes, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0163] The embodiments and drawings are used to explain the present invention and do not constitute an improper limitation of the present invention. It should be noted that when it is necessary to use coloring to distinguish between odd-numbered wheel modules, even-numbered wheel modules, and operator components, the coloring principle is that the odd-numbered wheel components or modules are colored blue or purple as a whole, the operator components must be colored purple, and the even-numbered wheel modules and the decomposed components are colored red.
[0164] Figure 1 . Embodiment 1 of the present invention - Structure diagram (including block cipher of MDS matrix transformation)
[0165] Figure 2 .EWES Example P Component and P -1 Component Definition
[0166] Figure 3 . Schematic description of the components of EWES embodiment X
[0167] Figure 4 .EWES Implementation Example SX -1 Component Definition
[0168] Figure 5 .SX element definition of EWES embodiment
[0169] Figure 6 .EWES Example 1: 2-round state machine calculation circuit
[0170] Figure 7 A more general form of the X structure of Example 3
[0171] Figure 8 .S-box layer design implementation example
[0172] Fig. 9 .6 ways to connect wheel key, S-Odd and calculator
[0173] Fig.10 . More complex connection between wheel key, S odd and operator DETAILED DESCRIPTION
[0174] In order to guide readers to read the detailed implementation method more quickly and better, the key content index and the embodiment index are organized as follows. The term explanation content is "recommendation S even ≠ S odd", "odd number round", "entry operator and exit operator" and "X structure component"; the main content also includes "self-assessment and declaration of novelty of the present invention".
[0175] Example 1. Research on block ciphers including MDS matrix and its extension
[0176] Example 2. EWES (competitor of AES and SM4)
[0177] Example 3. Example of combining a certain X component with a multiplication instruction
[0178] Example 4. Example of DES S-box substitution table and matching quasi-MDS matrix
[0179] Example 5. Example of constructing X component based on ARX structure
[0180] Example 6. Horizontal and vertical design of computing unit
[0181] Example 7.X -1 S-odd and S-even in logic design
[0182] Terminology explanation:
[0183] 1. “Recommendation S even ≠ S odd”
[0184] Special terms used to limit the scope of protection of the present invention and explain the third invention point. The scope of limitation is the whole of Seven≠Sodd and the part of Seven=Sodd, where the scope of protection of Seven=Sodd is mainly to exclude the structure and derivatives of the background technology LBT, which is described in detail in the following "Self-evaluation and declaration of novelty of the present invention".
[0185] Statement of the range of Seven = Sodd:
[0186] Protection range elimination background technology LBT structure: the S odd is "S box layer -> involution MDS matrix -> S -1 Box layer", the operator is and
[0187] It is generally believed that S odd must be designed as a logic with strong diffusion capability. A typical embodiment is embodiment 4. The S box substitution table of DES and the corresponding quasi-MDS matrix. The main structure is, 1. S even = S odd, where S odd is equal to the corresponding quasi-MDS matrix or MDS matrix. As stated in the invention content, the quasi-MDS matrix has full diffusion capability but the number of branches is not as good as the MDS matrix. 2. The operator is a substitution table controlled by the wheel key, and the selected substitution table corresponds to the S box to provide a nonlinear confusion effect.
[0188] Statements for the range of Seven ≠ Sodd:
[0189] The third invention of the present invention. As mentioned above. Because S even ≠ S odd, there are more options for S even; more importantly, the selection of S even and S odd does not need to be limited to the full diffusion wheel design and the involutive MDS matrix elements. It is especially recommended to use X structure components to construct S even and or S odd, and the main contribution is that S even or S odd can be constructed without the need for involutive elements.
[0190] 2. Odd-numbered wheels of the present invention
[0191] Necessary technical features of the present invention. The definition has been stated in the content of the invention. The odd round is a series structure including three components. The series structure is decomposed into an entry operator, S odd and an exit operator according to the encryption direction. It is limited that the entry operator and the exit operator are mutually inverse operation logic designs, and S odd is a self-inverse logic transformation.
[0192] The meaning of "a series structure including three components" is not limited to three components. The following is an example of a series structure consisting of five components, using the formula description of an odd number of ☆☆2, Px -1 (S odd (rkeyi + Px (st)) - rkeyi + 1), where Px and Px -1 is a pair of reversible transformations. Therefore, the description of the three components is only a statement of the main idea and the simplest special case, and there are actually more derivative design schemes. These derivative design schemes include, Example 6 "The output of the entry operator and the exit operator" is decomposed vertically and horizontally, and the connection with the S-odd logic is realized on the basis of the vertical decomposition and horizontal decomposition; Example 7. Design demonstration of S-odd and S-even logic transformation. In short, the odd wheel is a reversible series structure, including but not limited to 3 components; all derivative designs are in line with the main idea of the second invention point. The derivative expression of the main idea of the second invention point is that more entry operator elements and more exit operator elements are allowed, wherein more entry operator elements and more exit operator elements are actually inverse operation relationships with each other, and the basic principle of the connection between the S-odd logic and the operator elements is that the entry operator elements and the exit operator elements are designed according to the cancellation principle; thereby achieving the overall effect, the logic circuit of the odd wheel remains unchanged, and only the wheel key needs to be used in reverse to achieve the encryption and decryption mode switching.
[0193] 3. Input and output operators
[0194] The two indispensable components of the odd wheel; the connection relationship with S odd and the working principle of the operator are described in the second invention point of the invention content. and "+" and "-", "*" and " / " can also select the wheel key control selection substitution table operation mode; the definition of the substitution table function is controlled by the wheel key to select an S box or S -1 Box, the entry operator is S box, and the corresponding exit operator is S -1 Box. Example 4 gives an embodiment of the S box based on the DES algorithm; the embodiments of "+" and "-" are IBM's MARS algorithm. It should be noted that the entry operator and the exit operator are not limited to a formal definition, but actually embody the main idea of collaborative cancellation. More specifically, they can be decomposed vertically and horizontally; see Example 6 "The output of the entry operator and the exit operator" for details, which decomposes vertically and horizontally, and realizes the connection with the S odd logic on the basis of vertical decomposition and horizontal decomposition. Regardless of vertical decomposition or horizontal decomposition, the basic principle is that they can be cancelled, and ultimately the whole can be cancelled, thereby realizing the self-reversibility of odd rounds, and ultimately realizing the self-reversibility of the entire block cipher.
[0195] 4.X structural components
[0196] Embodiment Inventive point. Method for constructing S odd or S even components. Definition of X structure, X({l, r}) = {F -1 (r), F(l)}. The language description is defined as, the definition of X structure logical transformation is, the nonlinear transformation F of the left input is placed on the right, and the nonlinear transformation F of the right input is placed on the right. -1 On the left, the main conclusions and effects related to the X structural component.
[0197] 1. The X structural component is self-inverted (involutive), where F -1 No need to restrict to self-inversion (i.e. F = F -1 ).
[0198] Prove that: X(X({l,r}))={l,r}, that is, the involution property.
[0199] Proof: X(X({l,r}))=X({F -1 (r),F(l)})
[0200] ={F -1 (F(l)),F(F -1 (r))}={l,r}.
[0201] 2. In some cases, F and F -1 It can be executed in parallel, such as in a superscalar CPU, where table lookup and calculation are performed in parallel through instruction pairing.
[0202] It should be noted that the above definitions of left and right are based on F and F -1The input and output of the entity information may differ by one bit; for example Figure 3 and Figure 7 The logic circuits are exactly the same, with no essential difference.
[0203] Self-assessment and declaration of novelty of the invention:
[0204] In order to self-evaluate the originality, the inventor has searched the public data to the best of his ability for the block cipher with self-reversible structure. When S even = S odd is defined, some technical feature combinations of LBT in the background patent CN107707343 are consistent with some technical features of the present invention. Although the 16-round design of LBT does not meet the technical feature of ending with an odd number of rounds, the inventor declares to eliminate the relevant situations of LBT. It is declared that the combination of the following technical features is voluntarily abandoned.
[0205] 1. Encryption starts from round 1 and ends at an odd round; the inverse operator is and
[0206] 2. Limit S even = S odd, where S even is S layer -> involution MDS matrix -> S -1 layer.
[0207] The following is the inventor's technical analysis of the background patent, which can reversely prove the technical advantage of the third invention point of the present invention. The
[0034] paragraph of patent CN107707343 states: "The diffusion speed of the round function of the LBT cryptographic algorithm is twice that of the round function of the AES cryptographic algorithm. In terms of resisting differential and linear attacks, the number of active S boxes in the cryptographic round function structure is twice that of the AES cryptographic round function structure." A single round uses 2 layers of S boxes and consumes the computational delay of 2 layers of S boxes? The inventor believes that in terms of design effect, the limitation of the LBT cipher and the present invention of S even = S odd requires the design of complex logic functions in order to achieve full diffusion in one round; this limitation is both an advantage and a disadvantage. The advantage is that the diffusion and obfuscation effects of a single round must have very high performance, and the accompanying disadvantage is that the complex single-round logic is not friendly to engineering implementation.
[0208] Example 1. Research on block ciphers including MDS matrix and their replacement extension
[0209] Invention content ☆**1 has described embodiment 3.1, the design principle and main parameters of the overall structure can be compared Figure 1 It is a known technical fact that the MDS matrix can achieve full diffusion of MDS (maximum distance coding matrix) transformation symbols once, and can provide the maximum number of branch contributions, so it is most suitable as a demonstration of the principle of the present invention. By replacing components or elements, the design principle of the overall structure of the present invention and related technical effects can be more deeply understood.
[0210] 3.1 Reference Figure 1 , the block cipher including the MDS matrix is defined as follows:
[0211] 1) A self-inverting structure that starts with an odd number and alternates between an even number and an odd number.
[0212] The beginning of encryption is the first round, and the end of encryption is the third or fifth round;
[0213] 2) The odd-numbered rounds of logical transformation and connection relationship are: input (st, rkeyi, rkeyi+1),
[0214] Output
[0215] S Qi
[0216] or
[0217] S odd (st+rkeyi)-rkeyi+1;
[0218] Among them, Sodd is S component transformation, and the definition of S component transformation () is 16 juxtaposed involution property S boxes; the definition of color is as mentioned above, the blue solid box represents Sodd, and the blue solid box represents Seven;
[0219] 3) The even-numbered round logic transformation is: input (st), output
[0220] MDS -1 (S component transformation (MDS(st)));
[0221] Here, MDS() is an MDS matrix transformation with a specification of 16 bytes x 16 bytes.
[0222] 3.2 Example: Replace the S component transformation with the X structural component form
[0223] Using the AES algorithm's 8 S-boxes (equivalent to Plus the S-box of the linear affine transformation module) and 8 S -1 The X structure component is defined as follows: the 8 bytes on the left are passed through 8 S boxes in parallel and the results are placed on the right, and the 8 bytes on the right are passed through 8 S boxes in parallel. -1 The box results are placed on the left.
[0224] Obviously, after the replacement, the whole is involutive (self-inverted), but there is no involutive S-box element.
[0225] More S-box layer design demonstrations are added here. Figure 8 The S-box layer is involutive, which includes two types of S-boxes: one is the AES algorithm S-box, and the other is the X-box on the 256-element field. -1 operation; so based on Figure 8 The S-level thought structure is also possible. Figure 8Another design concept embodied is that by adopting an X structure, an involutory overall transformation component can be constructed using non-involutory elements.
[0226] 3.3 Embodiment: Replace S_odd with PL -1 (S_even(PL()))
[0227] S_odd(st) = PL -1 (S_even(PL())), where PL is a matrix transformation of bit or byte permutation or an instruction operation of related permutation (PL has no arithmetic operation), and where MDS(PL(MDS -1 (X))) must be a matrix transformation with fully diffusive property or close to fully diffusive property.
[0228] Considering the complexity of MDS, a non-degenerate PL can be found. Embodiment 3.2 proves that there exists a design where S_odd and S_even only differ in the PL transformation; the inventor believes through simulation analysis that generally, a qualified PL can be found when the linear diffusion ability of S_odd / S_even is strong.
[0229] 3.4 Embodiment of Duality Property Design
[0230] A design with exactly the same security as that of Embodiment 3.1. Due to the natural property of the overall structure of the present invention, for a given overall structure of the present invention, there exists a dual design, which is essentially the interchange of S_even and S_odd.
[0231] S_odd(st) = MDS(S component transformation(MDS -1 (st)));
[0232] S_even(st) = S component transformation(st).
[0233] In terms of differential analysis and linear analysis, only the content between S-box layers is analyzed, so the security of Embodiments 3.1 and 3.4 is exactly the same.
[0234] Embodiment 2. EWES (Competitors of AES and SM4)
[0235] 2.1 Introduction
[0236] AES and SM4 are industrial standards for block ciphers. The inventor believes that the main disadvantage of AES is that the encryption and decryption logics are inconsistent, and the main disadvantage of SM4 is that the low-diffusion design of 32-round indicators leads to poor low-latency performance, especially CBC encryption performance hardware performance. Because the design concept is economic wiring and economic instruction set (economic wire & economic instruction Set), the competing product is named EWES according to the English abbreviation. Two specifications are now disclosed, EWES-128-7-1024 is 8 groups of 128-bit wheel keys / 7 rounds / nominal 128-bit security; EWES-128-7-256 is 2 groups of 128-bit wheel keys / 7 rounds / nominal 80-bit security. The key extension to the wheel key does not belong to the content of the present invention, so it is directly stated from the wheel key. The difference between EWES-128-7-256 and EWES-128-7-1024 is that two groups of keys are copied into eight groups in sequence during the key usage phase, so only EWES-128-7-1024 is described below.
[0237] 2.2 The EWES standard is defined in a structured language and described in hardware module form. The numbering is not limited in order.
[0238] EWES-128-7-1024 Standard Definition
[0239] Packet width 16 bytes;
[0240] 1. At the end of the 7th round, 8 sets of wheel passwords are recorded as rkey0-rkey7;
[0241] 2. Odd rounds: input st, output
[0242] S Qi
[0243] Where, S odd (t) = P -1 (X(P(t)));
[0244] 3. Even round: input st, output X(st);
[0245] 4. The called linear diffusion component P: defined based on the 64-bit modulo 2 addition instruction and the circular shift instruction, with input {l,r}, the intermediate steps of definition are,
[0246] This module controls, Figure 2 .EWES Example P Component and P -1 Definition of components;
[0247] 5. Called X component: define X({l,r}) = {Sx -1(r),Sx(l)}, where Sx -1 The (r) element is an sp structure transformation. More specifically, the p transformation part is a linear combination of 9 64-bit cyclic shifts. The 9 left shift parameters are 2, 0, 8, 16, 24, 32, 40, 48, and 56. The middle of the linear combination is passed through 8 juxtaposed S -1 Box, S -1 Defined by the following S-box;
[0248] The above X components and their components are broken down and compared. Figure 3 .Schematic description of X component; Figure 4 .EWES' SX -1 Component definition; Figure 5 , SX component definition of EWES;
[0249] 6. The called S-box: based on the inverse element of the GF256 field, the table lookup output table of 0x00-0xff;
[0250]
[0251]
[0252] 7.P -1 () module and Sx() module refer to the above P() and Sx -1 The definition of () is not repeated here; the design of the S-box and the recommended tower domain expression are omitted in this paper.
[0253] 2.3 Test vectors for components and elements
[0254] Sx -1 (64'h0706050403020100) = {S -1 (1c)_S -1 (18)_S -1 (14)_S -1 (10)_S -1 (0c)_S -1 (08)_S -1 (04)_S -1 (00)}=64'h6bdc13daea945d23;
[0255] X(128'h0706050403020100_0b0b0a0a09090808)=128'h7dfdcb0b38f8ce4e_6bdc13daea945d23;
[0256] P(128'h 0411100001040014 0011100001000010)=128'h 40;
[0257] 2.4 Test vectors for EWES-128—7-256
[0258] {Rkey1, rkey0} copies {Rkey3, rkey2}, {Rkey5, rkey4}, {Rkey7, rkey6}, where {Rkey1, rkey0} =
[0259] 0xd7404121f8b8f23af34f1e3f1796967a_9d4b00e365727ad013d044f4f0ad8b6a.
[0260] Plain text: 0x 0000000000000000 0000000000000000
[0261] Encryption 1: 0x 70545b8d3ccc6509 25772368a4e1ff56
[0262] Encryption 2nd time: 0x 102bdd3e4d0b8206 770e9be805a61d43
[0263] 2.5X64 platform performance
[0264] Drawing on the AES big table lookup implementation, the SX(l) element of EWES also looks up a big table; however, while looking up the big table, the RORX instruction implements the Sx -1 The linear part of the (r) element, the RORX instruction and the table lookup operation of SX(l) benefit from instruction pairing. In the dual-path state, the P component and P -1 Components can also benefit more and better from instruction pairing. The following test results can prove that a well-designed X component can benefit from instruction-level parallelism. More specifically, 12.5C / B is the result of good instruction pairing. The above analysis and measured performance can support the technical effect of the block cipher described in ☆5 and ☆4, where the block cipher is limited to F as an SP structure design.
[0265] Test platform and test plan
[0266] Intel i7-4770 / @3.4G / 16GB memory; Windows-7 / 64-bit operating system / compiler gcc version4.8.1 or higher / –O4 compilation. The millisecond output of GetTickCount() is used as the numerator of MByte / S, and the output of rdtsc instruction is used as the numerator of C / B. This article defines C / B as the CPU clock consumed to process 1 byte. The benchmark AES-128 source code is OpenSSL.1.1 version. Continuous single-pass encryption corresponds to the peak performance of CBC encryption, and the dual-pass encryption index corresponds to the peak performance of CBC decryption, ECB, CTR, etc.; the number of continuous tests is 1G packet encryption or 1G byte encryption.
[0267] EWES Performance and AES-128 Performance
[0268]
[0269] To sum up, as for encryption and decryption performance, as long as the compiler is excellent, no competitor has claimed to exceed the 10.0C / B performance of AES for single-channel encryption (CBC encryption performance); the single-channel performance of EWES is very close to that of AES, and the dual-channel performance of EWES is basically equal to the single-channel performance of AES.
[0270] 2.6 8-bit performance
[0271] AT89c51 / development software Keil-uVision2 / physical hardware verification. The timing is based on 1 / 32 second interrupt timing.
[0272] EWES-7-256C / BB / S measured time
[0273] 2 16 Single-channel encryption 162.00 12345 84.93 seconds
[0274] Atmega16 is a high-performance chip with a 16M crystal oscillator. The development environment is Atmel Studio 6.2, C embedded assembly programming, and the clk of the CPU is obtained by software simulation. For comparison, the performance of AES-128 single-channel encryption is 143.00C / B.
[0275] 1 encryption EWES-7-1024 129.75C / B 123.31KB / S2076clk
[0276] 2.7 Hardware wiring design and performance
[0277] The following analysis results are from the output of the synthesizer, and the analysis results can prove. ☆3's specific implementation effect of limiting S even and S odd to reuse the same nonlinear logic. It can be proved that the amount of area saved / the amount of code space is approximately equal to the area of the nonlinear logic that can be reused. For the circuit implementation of EWES, it can be considered that the proportion of circuit area reused in the 1-beat 1-round mode is 63.38% (1016 / 1603); taking S odd as 1 unit, the ratio index of the constructed multiplexing mode circuit to S odd is 106.3% (1603 / 1508). The closer the former index and the latter index are to 1, the better; in short, the area ratio of the multiplexing mode circuit reuse X components in the 1-beat 1-round mode of EWES is equal to 63.38%, and the area of the multiplexing mode circuit in the 1-beat 1-round mode is 106.3% of that of S odd. The analysis of the circuit area of the above embodiment can prove that S even and S odd reuse the same nonlinear logic can be implemented, and the area consumption of the 1-beat 1-round mode is basically equivalent to the maximum area of S even or S odd.
[0278] #1.1 shot 2 rounds mode
[0279] The specific circuit design is Figure 6 , EWES embodiment - 1 beat 2 rounds state machine calculation circuit. Figure 6 It can be proved that EWES has a completely consistent design for encryption and decryption logic, and only 4 steps are needed for each encryption and decryption. Figure 6 The called application scenario is called through a coprocessor set instruction method; the instructions include setting three registers, recovering the ciphertext result, and updating the intermediate result to the main register.
[0280] Hardware: EP2C5T144C8, synthesizer: Quartus II Version 9.0, 4 encryptions per time.
[0281] Theoretical C / B area fmax (estimated peak velocity)
[0282] 0.25 2722cell 24.48M 97.92MB / S
[0283] It includes 3 128 registers with a total of 2722 cells, of which the odd-round and even-round logics are 1508 cells and 1016 cells respectively.
[0284] #2.1 shot 1 round mode
[0285] Hardware: EP2C5T144C8, synthesizer: Quartus II Version 9.0, 7 encryption steps per time.
[0286] Theoretical C / B area fmax (estimated peak velocity)
[0287] 7 / 16 1773cell 34.79Mhz 83.144MB / S
[0288] It includes 3 128 registers with a total of 1773 cells, of which the odd-numbered round and even-numbered round reusable logic are 1603 cells respectively.
[0289] 2.9 EWES Security Statement
[0290] Thanks to the wide-trace strategy design ideas of the AES designers. The P transform and S-box of EWES are also selected based on the number of branches and the number of active S-boxes. The first step is to construct the X() component. Obviously, X() has a little linear diffusion ability. The second step is to limit 5 Operation, the optimal number of branches is selected to achieve the optimal P transformation. The third step is to select a low-area S-box, which completely destroys all low-weight differential paths. It should be noted that the linear layer of differential analysis and linear analysis is the encoding between the odd-round S-box layer and the even-round S-box layer; in terms of security, EWES's full diffusion capability and the number of differential active S-boxes are better than AES.
[0291] Main technical features of S-box: GF256 multiplication inverse element design, maximum differential advantage 2 -6 , maximum linear advantage 2 -3 .
[0292] The number of differentially active S-boxes is distributed as follows: 1, 10, 16, 23; according to the maximum differential technical characteristics of the S-box, 4 rounds provide 2 -138 The security of the other 3 rounds is redundant; similarly, the 3 rounds provide 2 -96 The number distribution of linearly active S-boxes and the linear evaluation results are omitted.
[0293] 2.10EWES instruction set design
[0294] Refer to the invention content ☆9 to ☆10 and #1.1 beat 2 round mode. Main achievements: Design for 128-bit instructions. For 1 beat 1 round or 2 round modes, AES requires 4 instructions, while EWES only needs 2 instructions; Design suggestions for 64-bit instructions. The other operation logic of EWES is implemented by the 64-bit instruction general instructions, and only 2 instructions are designed to accelerate the X component Sx -1 The instructions of the (r) component and the Sx(l) component are estimated to improve the performance of the X64 platform by 250%, and the single-channel encryption and decryption performance is expected to be 4.9C / B.
[0295] Example 3. Example of combining X component with multiplication instruction
[0296] Intel's 64-bit unsigned multiplication instruction has a high execution efficiency, so the operator and X structure components applicable to the present invention can be designed based on the unsigned 64-bit multiplication instruction, and the operation efficiency on the X64 platform is extremely fast. The structure based on the multiplication constant can be considered as a type of ARX structure. Therefore, this embodiment mainly proves that it is feasible for the components based on the ARX structure principle of the overall structure of the present invention to be components other than the SP structure principle. This is a type of block cipher that is particularly friendly to software, especially X64. At the same time, it is proved that the structure of the operator can be a composite of multiple operations.
[0297] The following is 1 / 2 of the selection of the operator, which is mainly designed for xorq and mulq instructions.
[0298] Definition: Input operator 1 (rk, X) outputs out64;
[0299]
[0300] Definition: Output operator 2 (rk, X) outputs out64;
[0301]
[0302] Definition: Input operator 3 (rk, X) outputs out64;
[0303] Out64 = (rk*X) mod 2 64 ; Limit X to an odd number;
[0304] Definition: Output operator 4 (rk, X) outputs out64;
[0305] Out64 = (rk*X -1 )mod2 64 ; Limit X to an odd number;
[0306] Obviously, the input operator 1 and the output operator 2 are a pair of mutually inverse operators, and the input operator 3 and the output operator 4 are a pair of mutually inverse operators, which can be canceled in calculation. It should be noted that X is an odd number, X -1 mod2 64 Yes, it exists, so the formal definition of multiplication and division is that they are inverse operations, and the actual operation is multiplication; this definition of division is actually the technique (technical means) for implementing multiplication, which is supported by most C language compilers and some algorithm optimization programming textbooks have been made public.
[0307] Because the X component can construct S even and S odd, the called X component,
[0308] X({l,r})={r*A,l*A -1}, where constant A = 0xcc33111155113311, constant A -1 =0x1A21B4412BA61DF1
[0309] Replace the X component of Example 2. EWES with X({l,r})={r*A,l*A -1}, thus defined as Example 3.1.
[0310] Definitions of Example 3.1:
[0311] The group width is 16 bytes, with 8 groups of wheel passwords, recorded as rkey0-rkey7;
[0312] 1. Encryption starts from round 1 and ends at round 7;
[0313] 2. Odd rounds: input st, output
[0314] S Qi
[0315] Where, S odd (t) = P -1 (X(P(t)));
[0316] 3. Even round: input st, output X(st);
[0317] 4. The called linear diffusion component P: defined based on the 64-bit modulo 2 addition instruction and the circular shift instruction, with input {l,r}, the intermediate steps of definition are,
[0318] 5. The called X component, X({l,r}) = {r*A,l*A -1}, where A = 0xcc33111155113311, A -1 =0x1A21B4412BA61DF1.
[0319] The performance of Example 3.1, the test platform is exactly the same as EWES, 685.89MByte / S, 4.9C / B.
[0320] Replace the left area of the operator in Example 3.1 with a multiplication / division operator to obtain Example 3.2.
[0321] Definitions of Example 3.2:
[0322] The group width is 16 bytes, with 8 groups of wheel passwords, recorded as rkey0-rkey7, where rkeyi is an odd number;
[0323] 1. Encryption starts from round 1 and ends at round 7;
[0324] 2. Odd rounds: input st, output
[0325] S Qi
[0326] Where, S odd (t) = P -1 (X(P(t))), Indicates the XOR operation of the left 64 bits and the right 64 bits modulo 2 64 multiplication, Indicates the XOR operation of the left 64 bits and the right 64 bits modulo 2 64 division;
[0327] 3. The even-numbered rounds, the called linear diffusion component P, and the called X component are completely identical to the definitions in Example 3.1.
[0328] It should be noted that the above tests are all implemented based on the mulq instruction, that is, although the definition of the inverse operator uses "*" and " / ", the actual implementation is a multiplication instruction, and the large integer modinv module is used to implement the multiplication inversion adjustment of the wheel key.
[0329] The performance of Example 3.1 and Example 3.2 are basically the same. The X64 platform test environment is the same as the test environment of Example 2. EWES. The actual performance of 3.1 is 4.9C / B, 672Mbyte / S; the actual performance of 3.2 is 5.05C / B. Therefore, it is 250% times the performance of EWES's 12.5C / B.
[0330] Example 4. DES S-box substitution table and the corresponding quasi-MDS matrix
[0331] This embodiment will prove that the inverse operator using a two-dimensional substitution table structure is also feasible; it will also prove that the quasi-MDS matrix with Seven=Sodd as the involution is also feasible, that is, when the operator can provide nonlinearity (confusion effect), Seven and Sodd only need to ensure the linear diffusion effect when constructing.
[0332] The DES standard defines a total of 8 6-input and 4-output substitution tables. This substitution table is considered as 32 4-input and 4-output S-box tables. Obviously, each of the 32 S -1 The box table exists. The following is a 4-input and 4-output selection of the operator based on the DES standard S box. The other input end is rk, which controls and selects 32 S boxes.
[0333] Definition: 4-bit input arithmetic unit (rk, X) outputs out4;
[0334] Out4 = S[rk][X], where rk is 5 bits;
[0335] Definition: 4-bit output operator (rk, X) outputs out4;
[0336] Out4=S -1 [rk][X], where rk is 5 bits;
[0337] The packet width is 16 bytes, with 8 groups of wheel codes, recorded as rkey0-rkey7, where rkeyi is an odd number; 16 bytes equals 32 4-bit symbols. According to the knowledge of channel coding, there is no MDS code, so a quasi-MDS code is constructed. The so-called quasi-MDS code requires that each input symbol error can be diffused to all symbols, and each output symbol is associated with the input of all symbols.
[0338] Quasi-MDS code matrix components with poor branch number performance:
[0339] MDS1(st) = "all 1 element matrix - identity matrix"; obviously, the number of branches is 4.
[0340] The quasi-MDS code matrix components with good branch number are:
[0341] MDS2(st)=P -1 X(P(st)); where P is a random reversible matrix, and F of the X structure is a small random reversible matrix; obviously MSD(st) is an involution linear transformation, and the number of branches must be large.
[0342] According to the design of the above-mentioned operator elements and quasi-MDS matrix elements, the following embodiments are constructed.
[0343] Definitions of Example 4.1
[0344] The packet width is 16 bytes, recorded as 32 4-bit symbols;
[0345] 8 sets of wheel passwords, recorded as rkey0-rkey7, each rkeyi is recorded as 32 5-bit symbols, and the access address of the symbol is recorded as rkeyi.rkj, where i is 0-7 and j is 0-31;
[0346] 1. Encryption starts from round 1 and ends at round 7;
[0347] 2. Sodd = Seven, Sodd is MDS1() or MDS2();
[0348] 3. The entry operator consists of 32 sub-operators, each of which has inputs Xj and rkj and outputs S[rk][X], where S[rk][X] is equal to the 8 6-input and 4-output S-box tables of the DES standard;
[0349] 4. The export operator consists of 32 sub-operators, each of which has inputs Xj and rkj and outputs S -1 [rk][X], where S -1 Correspondingly, S[rk][X] is equal to the DES standard 8 6-input and 4-output S-box tables.
[0350] It can be seen from the above embodiment that the operator can provide a nonlinear confusion effect. When providing a nonlinear confusion effect, S even = S odd can be designed by linear transformation. This embodiment also shows that for the design of the operator or the operator element using a two-dimensional substitution table structure, the number of bits of the wheel key participating in the operation each time may not be equal to S box / S -1 The bit length of the box.
[0351] Example 5. Example of constructing X component based on ARX structure
[0352] Ballet is a block cipher designed by Cui Tingting and others in 2019. Its main features are ARX structure / ARX instruction, no S-box and complex linear layer, and only implemented by addition, XOR, and circular shift operations. The main advantage is that it is software-friendly for high-performance CPUs, and the diffusion effect is good based on the Lai-Massey structure design. The task of this embodiment is to use the encryption round transformation and decryption round transformation of Ballet-128 as elements to construct the X component. The main purpose of this embodiment is to prove that a cipher that conforms to the overall structure of the present invention can be constructed without S-box elements / operations; of course, embodiments 3.1 and 3.2 can also be attributed to the generalized ARX structure / ARX instruction embodiments.
[0353] ARX-256 implementation example definition: A self-reversible block cipher-256 based on the Ballet-128 round transformation element, i.e., a block cipher length of 256 bits. The main components and connection relationships are defined as follows:
[0354] The inverse operator is and or "+" and "-";
[0355] Definition: St = P -1 XP(st), where P can be designed by using XOR operation and circular shift operation according to the principle of EWES. The main design idea is to realize the exchange of information on the left and right sides of the X component;
[0356] Define S(st) = X(st);
[0357] Where, X({l,r})={Baller_F(l,RC),Baller_F-1(l,RC),};
[0358] Baller_F is the 4-round transformation of the Ballet-128 encryption algorithm. -1 It is the 4-round transformation of the Ballet-128 decryption algorithm. RC is the round constant, which is equivalent to 4 fixed groups of Ballet-128 wheel keys.
[0359] In summary, the ARX-256 implementation based on the Ballet-128 round transformation conforms to the overall structure of the present invention, so it is self-reversible; in addition, it can be inferred that the ARX-256 implementation does not have S-box, addition, XOR, and circular shift operations.
[0360] Example 6: Horizontal and vertical design of computing units
[0361] Example 3.2 is and More generally, the operator component can be decomposed into one or more combinations of smaller operator components in the horizontal direction; the types of operator components include, and The "+" and "-", "*" and " / " operators can also select the replacement table selected by the round key. So in theory, there are many options for horizontal design.
[0362] The vertical design is described below. The invention content has been described, including "a series structure of three components"; the actual design is not limited to three components, and the relevant demonstration is a series connection of five components / elements. In terms of vertical design, the operator or operator element can be connected to the overall S-odd logic multiple times. First, the connection between the entry operator and the exit operator and the S-odd is not limited to the entry operator being the first in the series structure and the exit operator being the last in the series structure. Fig. 9 Six connection methods are demonstrated, all of which can achieve the cancellation effect. Fig. 9 More general promotion Fig.10 The derived connection method of two pairs of operators, where Fig.10 The "?1" and "?-1", "?2" and "?-2" of the MCU reflect the design concept of cancellation. It should be noted that Fig. 9 and Fig.10 "P-odd", "S-odd" and "P-odd" -1 The three elements together constitute the S-odd logic transformation component of the present invention.
[0363] In short, the basic principle of the horizontal and vertical design of the operator is to construct odd-numbered rounds based on the design idea of cancellation, and first realize the self-reversibility of the odd-numbered rounds, thereby ensuring the self-reversibility of the entire block cipher.
[0364] Example 7.X -1 S-odd and S-even in logic design
[0365] X -1 Refers to the multiplication inversion operation of a large domain, because X -1 It can achieve full diffusion, so theoretically there is no need to construct P transformation. -1 The nonlinear advantage and linear advantage are extremely small, so 5 rounds are enough to provide extremely high safety.
[0366] The block cipher based on the overall structure of the present invention has a length of 16 bytes, a total number of rounds of 5 rounds, the inlet operator and the outlet operator are modulo 2 addition, S odd and S even are the X -1 Logic Design. Only the construction of Seven and Sodd components is discussed and evaluated below.
[0367] 7.1 X when S even = S odd -1
[0368] S 奇 For x -1 modp(x), where p(x) is an irreducible polynomial.
[0369] For example
[0370] Obviously, it can be fully diffused, which basically meets the design requirements of block ciphers. From the perspective of security, the expression is extremely simple and there is a risk of being attacked by algebraic analysis. In other words, the differential performance is particularly good but the algebraic analysis security may have major flaws.
[0371] 7.2 The first type of X when S even ≠ S odd -1 design
[0372] The length of the block cipher is 16 bytes,
[0373] S 奇 for The record format has the low bit on the right, that is, the rightmost bit is 1.
[0374] S 偶 for The record format has the low bit on the left, that is, the leftmost bit is 1.
[0375] 7.3 The second type of X when S even ≠ S odd -1 design
[0376] The length of the block cipher is 16 bytes,
[0377] S 奇 for The record format has the low bit on the right, that is, the rightmost bit is 1;
[0378] S 偶 for The record format has the low bit on the left, that is, the leftmost bit is 1.
[0379] Although 7.3 and 7.1 are basically the same in form, a very complex linear expression can be derived by simply adding a little bit permutation, which is helpful in resisting algebraic attacks; this embodiment can prove that the design that limits Seven ≠ Sodd is better. This embodiment also proves that even if Seven = Sodd, it is possible in some cases. It also proves that it is possible for Seven and Sodd to differ by only one permutation and inverse permutation.
[0380] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.
Claims
1. A self-invertible block cipher, comprising a plurality of groups of wheel keys, characterized in that: The overall structure is a self-inverting structure starting with an odd number of rounds and alternating between even number rounds and odd number rounds. The overall structure is defined as follows: The beginning of encryption is the first round, and the end of encryption is an odd-numbered round; The odd-numbered round structure and its components are a series structure including three components; the components from input to output in the encryption direction are decomposed into an entry operator, an S odd and an exit operator, wherein the entry operator and the exit operator are mutually inverse operation logic designs, and the S odd is a self-inverse logic transformation; The connection relationship of the components of the odd-numbered round is that the input end of the entry operator is connected to a certain set of wheel keys, the input end of the exit operator is connected to a certain set of wheel keys, the input of the odd-numbered S is connected to the output end of the entry operator, and the output of the odd-numbered S is connected to another input end of the exit operator; The even-numbered round is equal to a self-inverse logical transformation, denoted as Seven; The relationship between the Seven and the Sodd is, "recommend Seven≠Sodd"; specifically, "recommend Seven≠Sodd" is a special term, and its limited scope is the whole of Seven≠Sodd and the part of Seven=Sodd.
2. The block cipher according to claim 1, characterized in that The inlet operator and the outlet operator are both modulo 2 addition operators; The relationship between the Seven and the Sodd is Seven≠Sodd.
3. The block cipher according to claim 1 or 2, characterized in that: The Seven and the Sodd multiplex the same nonlinear logic design.
4. The block cipher according to claim 3, characterized in that: The multiplexed nonlinear logic is an X-structured logic transformation; Among them, the X structure logical transformation is that the nonlinear transformation F of the left input is placed on the right, and the nonlinear transformation F of the right input is -1 Place on the left.
5. The block cipher according to claim 4, characterized in that: The length of the block cipher is 8 bytes, 16 bytes or 32 bytes; The number of ending rounds of the block cipher is N, where N is an odd number not less than 5; The F is an SP structure, wherein S is an S-box designed with inverse elements on a 256-domain, and P is a linear diffusion component.
6. The block cipher according to claim 5, characterized in that: The length of the block cipher is 16 bytes, The number of differential branches of the block cipher is at least 10.
7. The block cipher according to claim 6, characterized in that: The final round is the 7th round; 8 sets of wheel passwords, recorded as rkey0-rkey7; Odd round: input st, output S odd (rkeyi⊕st)⊕rkeyi+1, Where, S odd (t) = P -1 (X(P(t))); Even round: input st, output X(st); The called linear diffusion component P: based on the 64-bit modulo 2 addition instruction and the rotation shift instruction definition, the input {l,r}, the intermediate steps of the calculation are, {l⊕r,r}->{l,r<<<14}->{l,r⊕l}->{l<<<44,r}->{l⊕r,r}->{l,r<<<8}->{l,r⊕l}->{l<<<24,r}->{l⊕r,r}; The called X component: define X({l,r}) = {Sx -1 (r),Sx(l)}, where Sx -1 The (r) element is a nonlinear transformation of the SP structure. The P transformation part is a linear combination of 9 64-bit cyclic shifts. The 9 left shift parameters are 2, 0, 8, 16, 24, 32, 40, 48, and 56. The intermediate result of the linear combination is passed through 8 juxtaposed S -1 Box, the S -1 The box is defined by the following S box; the table lookup output for 0x00-0x0f is b2 c0 a0 48 54fc 99 2f 39e3 2c f7 cc d8 5a 8d c9 5e e8 14 09 1e cd 1b 89 11 56c5 4d 19 6b aa 81 6f a3 00 4f 0a 83b0 3b a7 2d 44 73d0 f0 36 9b d9 c2 4e 8c f4 bc ff d5 88 85a2 96 62a9 7d d1 0f d7 72 74ac bd c8 3c 38ea 26cf ef 4a a6 8b 3f f2 03 97c1 61 47 82 68c7 02 75 04 9a 24 37c4 6a ce d4 42f8 f6 76 91 7e 1c e7 0e 66bb 35 34ee c6 a1 e5 5c 41 4c 7c 1d 30 6d fd 2a 63 23e1 60ae 29 52deec 15 3e 46 64b9 d3 d6 98 be b4 16b7 08 53 65ba da b6 31ca 9f 7a fe b1 01 49 12e0 06 13 58 55 33 9c ab 95f9 fa 5b fb ed e4 70dc 25 94dd f3 22 7b 4b b5 92e6 5d 43 f1 71 8a d2 57 3a 8f 5f a8 db 1f e2 9e cb 2e 59 b3 b8 9d 79 3d 21 20a5 af 0d 10 6e 18f5 93 17 0b 84eb 51bf 50a4 e9 32 2b 0c c3 1a 7f 78 27 90 28ad 8e 40 87 77 80 69 45 05 07 86 67 6c df; Among them, P -1 () module refers to the P() module definition, and the Sx() module refers to the Sx -1 ()Module definition.
8. A block cipher-based working mode, the working mode being a confidentiality mode, an authentication working mode or an authentication encryption working mode, characterized in that: The block cipher called by the working mode applies the block cipher with a self-inverse structure as described in any one of claims 1 to 7.
9. A method for constructing an instruction set, characterized in that: The defined instructions are functionally capable of implementing the S-odd logical transformation described in any one of claims 1 to 7, and / or the S-even logical transformation.
10. The instruction set construction method according to claim 9, characterized in that: The inlet operator and the outlet operator are both modulo 2 addition operators; The instructions constructed are two AUL type instructions, and the operand mnemonics are %xmmx, %xmmy, %xmmz. Define odd round function instruction, fun_odd(%xmmx, %xmmy, %xmmz) %xmmz←Sodd(%xmmx⊕%xmmz)))⊕%xmmy; Define odd and even round function instructions, fun_odd_env(%xmmx, %xmmy, %xmmz) %xmmz←Seven(fun_odd(%xmmx, %xmmy, %xmmz)); The entity calling mode of operand %xmmz includes at least one of the following: Implicit call, 3-operand call, coprocessor module call.
11. An IP core product, characterized in that: comprising an IP core, wherein the IP core comprises the S-odd logic transformation and / or the S-even logic transformation according to any one of claims 1 to 7, Or, the IP core includes a block cipher with a self-invertible structure as described in any one of claims 1 to 7.
12. A CPU chip, characterized in that: A certain instruction of the CPU chip instruction set can execute the S-odd logic transformation and / or the S-even logic transformation described in any one of claims 1 to 7.
13. An information processing device, characterized in that: The information processing device applies the block cipher of the self-inverse structure as described in any one of claims 1 to 7.
14. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction applies the self-inverse block cipher according to any one of claims 1 to 7.
Citation Information
Patent Citations
Addition instruction for adding three source operands
CN102103486B
SP network structure lightweight LBT block cipher realizing method with consistent encryption and decryption
CN107707343A
Encryption method for network and information security
CN101764686A
Parallelization method for ARIA symmetric block cipher algorithm based on CUDA
CN103490877A
Lightweight cryptographic algorithm HBcipher implementation method and device
CN108206736A
