Safety circuit including dual encoder and encryption / decryption device including safety circuit
By designing an S-box in which two encoders share one decoder in the encryption and decryptor, and uniformly adjusting Hamming weights and logical operations, the deficiencies of the S-box in preventing side channel attacks are solved and a more efficient Security and resource utilization.
Patent Information
- Application Number
- CN202011549749.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-12-24
AI Technical Summary
When existing encryption and decryption devices prevent side-channel attacks, the S-box is the main target and is vulnerable to attacks, and redundant logic increases complexity and resource consumption, making it difficult to effectively prevent side-channel attacks.
Design a security circuit in which two encoders share a decoder's replacement box (S-box), prevent side-channel attacks by uniformly adjusting the Hamming weight of the output data, and use multiple logic gate modules to perform logic operations to generate output data.
It effectively prevents side channel attacks, improves the security of encryption and decryptors, reduces redundant logic, and improves resource utilization efficiency.
Smart Images

Figure CN113315622B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims the priority of Korean Patent Application No. 10-2020-0023836 filed on February 26, 2020 in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference. Technical Field
[0003] Exemplary embodiments of the inventive concept relate to a security circuit, and more particularly, to a security circuit including a substitution box (S-box) in which two encoders share one decoder, and an encryption / decryption device including the S-box. Background Art
[0004] The personalized electronic device includes security information about the user. In order to prevent the security information about the user from being leaked by hackers, a hardware encryption / decryption device (eg, an encryption / decryption device) can send the security information as a password through a signing or authentication process.
[0005] Encryption technology is often used to ensure the security of data transmission. Encryption technology encrypts the plain text at the sender and decrypts the cipher text at the receiver. The encryption of plain text and the decryption of cipher text are called encryption technology.
[0006] Because encryption operations are generally slow, encryption operations are often implemented in hardware for use in devices such as smart cards. Block cipher algorithms may include Data Encryption Standard (DES), Advanced Encryption Standard (AES), SEED, ARIA, SM4, and the like.
[0007] In the implementation of encryption / decryption operators, it is important to apply prevention techniques against side channel attacks. As a technique for preventing side channel attacks, a method of randomly or uniformly displaying power and electromagnetic waves (ie, information collected through the side channel) can be used.
[0008] In the case of block ciphers, the S-box can be a prime target for attack. The security of the encryption / decryption operator can be determined based on the security of the substitution operations performed in the S-box. When security is increased by duplicating the S-box, side-channel attacks may be difficult, but redundant logic (e.g., reusing decoder logic) may increase. Summary of the invention
[0009] According to an exemplary embodiment of the present invention, a security circuit may include: a decoder configured to receive input data and output a decoding signal in response to the input data; a first encoder configured to output a first phenotype corresponding to any integer among N-ary integers (N is a natural number of 1 or greater) in a first phenotype as a first encoding value in response to the decoding signal; a second encoder configured to output a second phenotype corresponding to any integer among N-ary integers in a second phenotype as a second encoding value in response to the decoding signal; and a gate module circuit configured to generate output data by performing a logic operation on the first encoding value and the second encoding value.
[0010] According to an exemplary embodiment of the inventive concept, a security circuit may include: a first permutation logic circuit configured to output a first decoded value; a second permutation logic circuit configured to output a second decoded value; a first encoder including a plurality of first row gates configured to receive the first decoded value, wherein the first encoder is assigned a first phenotype as an output of the plurality of first row gates based on a specific Hamming weight value, and the first encoder is configured to output, in response to a binary number having a bit value of 1, one of the first phenotypes assigned to one of the plurality of first row gates as a first encoded value; and a second encoder including a plurality of second row gates configured to receive the second decoded value, wherein the second encoder is assigned a second phenotype as an output of the plurality of second row gates based on a specific Hamming weight value, and the second encoder is configured to output, in response to a binary number having a bit value of 1, one of the second phenotypes assigned to one of the plurality of second row gates as a second encoded value.
[0011] According to an exemplary embodiment of the present invention, an encryption / decryption device may include: an input terminal configured to receive input data from an external device; a substitution box (S-box) configured to generate output data encoded or decoded from the input data received via the input terminal; and an output terminal configured to output the output data. The S-box also includes: a decoder configured to output a decoding signal in response to the input data; a first encoder configured to output a first phenotype corresponding to any integer among N-ary integers (N is a natural number of 1 or greater) in the first phenotype as a first encoding value in response to the decoding signal; and a second encoder configured to output a second phenotype corresponding to any integer among N-ary integers in the second phenotype as a second encoding value in response to the decoding signal. The output data is the result of performing a logical operation on the first encoding value and the second encoding value.
[0012] According to an exemplary embodiment of the present invention, an S-box may include: a decoder configured to receive input data and inverted input data, and output a decoded signal based on the input data and the inverted input data; a first permutation logic circuit configured to select one of the integers in a first integer group as a first decoded value for transmission in response to the decoded signal; a second permutation logic circuit configured to select one of the integers in a second integer group as a second decoded value for transmission in response to the decoded signal; a first encoding module circuit configured to receive the first decoded value and output a first encoded value in response to the first decoded value; a second encoding module circuit configured to receive the second decoded value and output a second encoded value in response to the second decoded value; and a plurality of logic gates configured to receive the first encoded value and the second encoded value and generate output data. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features of the present inventive concept will be more clearly understood by describing in detail exemplary embodiments of the present inventive concept with reference to the attached drawings.
[0014] Figure 1 is a block diagram illustrating an electronic device according to an exemplary embodiment of the inventive concept.
[0015] Figure 2 is a diagram showing an exemplary embodiment according to the inventive concept Figure 1 Block diagram of the encryption and decryption device.
[0016] Figure 3 is a diagram showing an exemplary embodiment according to the inventive concept Figure 2 Block diagram of the S-box.
[0017] Figure 4 is a diagram showing an exemplary embodiment according to the inventive concept Figure 3 Block diagram of the S-box.
[0018] Figure 5 is a circuit diagram illustrating an encoder circuit according to an exemplary embodiment of the inventive concept.
[0019] Fig. 6A and Figure 6B is a circuit diagram illustrating an encoder circuit according to an exemplary embodiment of the inventive concept.
[0020] Figure 7 is a table illustrating encoding values according to an exemplary embodiment of the inventive concept.
[0021] Figure 8 is a table illustrating first and second coded values according to exemplary embodiments of the inventive concept.
[0022] Fig. 9is a digital circuit diagram illustrating an S-box according to an exemplary embodiment of the inventive concept.
[0023] Fig.10 is a table describing first and second coded values according to exemplary embodiments of the inventive concept.
[0024] Fig.11 is a table describing a first combination set of phenotypes according to an exemplary embodiment of the inventive concept.
[0025] Fig.12 is a table describing a second combination set of phenotypes according to an exemplary embodiment of the inventive concept.
[0026] Fig.13 is a table describing a third combination set of phenotypes according to exemplary embodiments of the inventive concept.
[0027] Fig.14A and Fig. 14B The exemplary embodiments according to the present invention are described based on Fig.13 The table of output data in which the encoded values of the table type are XORed.
[0028] Fig.15 is used to describe an exemplary embodiment according to the inventive concept. Fig.13 A table of the Hamming weights of the first and second coded values of the phenotypes in .
[0029] Fig.16A and Fig. 16B is a digital circuit diagram illustrating an encoder module according to an exemplary embodiment of the inventive concept. DETAILED DESCRIPTION
[0030] Exemplary embodiments of the inventive concept implement an S-box having a small area in which two encoders share one decoder, and provide an S-box that prevents a side channel attack by uniformly adjusting a Hamming weight of output data, and an encryption / decryption device including the S-box.
[0031] Hereinafter, exemplary embodiments of the inventive concept will be described in detail with reference to the accompanying drawings.Throughout the application, like reference numerals may refer to like elements.
[0032] Figure 1 is a block diagram illustrating an electronic device according to an exemplary embodiment of the inventive concept.
[0033] Reference Figure 1 , the electronic device 1000 may control a smart card, a memory card, etc., and, for example, the electronic device 1000 may include an application processor.
[0034] The electronic device 1000 may include an encryption / decryption device 1, a processor 2, a physical layer (PHY) 3, and a memory controller 4. The processor 2 may perform data transmission and reception with a radio frequency (RF) chip 5 via the PHY 3. In addition, the processor 2 may perform a task and store its result in a memory device 6 by using the control of the memory controller 4. For example, the processor 2 may include at least one core.
[0035] The encryption / decryption device 1 can encrypt or decrypt data sent from an external device (e.g., the RF chip 5 and / or the memory device 6) to the electronic device 1000, or can encrypt or decrypt data output from the electronic device 1000 to the external device. The encryption / decryption device 1 can encrypt or decrypt at least a portion of data used for the operation of the electronic device 1000 to improve the security of the electronic device 1000.
[0036] Figure 2 is a diagram showing an exemplary embodiment according to the inventive concept Figure 1 Block diagram of the encryption and decryption device.
[0037] Reference Figure 2 The encryption / decryption device 1 may include an input terminal 11 , a replacement box (S-box) 12 , and an output terminal 13 .
[0038] The encryption / decryption device 1 of the exemplary embodiment of the present inventive concept can encrypt the data received by the electronic device 1000. In addition, the encryption / decryption device 1 can decrypt the encrypted data. For example, the encryption / decryption device 1 can provide the received data to the S-box 12. In this case, the S-box 12 can receive the input data SB_IN via the input terminal 11. The S-box 12 can replace the input data SB_IN with the output data SB_O by a specific replacement operation. The S-box 12 can generate the output data SB_O encoded or decoded from the input data SB_IN received via the input terminal 11. The S-box 12 can output the output data SB_O including the bits different from at least some bits of the input data SB_IN to an external device. For example, the input data SB_IN and the output data SB_O can be mapped one-to-one, and the number of bits (e.g., 8 bits) of the input data SB_IN can be the same as the number of bits (e.g., 8 bits) of the output data SB_O. The first phenotype and the second phenotype described in detail below can be preset so that the input data SB_IN and the output data SB_O are mapped one-to-one. Hereinafter, when the S-box 12 performs a safety operation, the S-box 12 may be referred to as a safety circuit.
[0039] Figure 3 is a diagram showing an exemplary embodiment according to the inventive concept Figure 2 Block diagram of the S-box.
[0040] Reference Figure 3 , the encryption / decryption device 1 may include an input terminal 11, an S-box 12, a gate module 240, and an output terminal 13. The S-box 12 may include a decoder 210, a permutation module 220, and an encoder module 230, and the gate module 240 may include a first XOR gate 241 and a second XOR gate 242. The permutation module 220 may include a first permutation logic 221 and a second permutation logic 222, and the encoder module 230 may include a first encoder 231 and a second encoder 232. On the other hand, Figure 3 Unlike shown, the gate module 240 may be included in the S-box 12. The components of the encryption / decryption device 1 may be circuits, which will be described in detail below.
[0041] The decoder 210 may receive input data SB_IN from the input terminal 11 and output a decoded signal based on or in response to the input data SB_IN. The decoded signal may include a first decoded signal DS1 and a second decoded signal DS2. The first decoded signal DS1 and the second decoded signal DS2 may be referred to as a decoded signal DS.
[0042] The replacement module 220 may receive a first decoding signal DS1 and a second decoding signal DS2 from the decoder 210, and output a first decoding value DV1 and a second decoding value DV2 based on or in response to the received first decoding signal DS1 and the second decoding signal DS2. The first decoding value DV1 and the second decoding value DV2 may be referred to as a decoding value DV. In other words, the first replacement logic 221 and the second replacement logic 222 may output a first decoding value DV1 and a second decoding value DV2 based on the first decoding signal DS1 and the second decoding signal DS2, respectively. The first decoding value DV1 may be a value indicated by the first decoding signal DS1. For example, in response to the first decoding signal DS1 outputted from the first AND gate among the plurality of AND gates included in the decoder 210, the first replacement logic 221 may output the first decoding value DV1. In this case, the first decoding value DV1 may be one of hexadecimal values 0, 1, ..., E, and F (for example, hexadecimal E represents 14). Similar to the above case, the second replacement logic 222 may output a second decoded value DV2 in response to a second decoded signal DS2 outputted from a second AND gate among a plurality of AND gates included in the decoder 210. In this case, the second decoded value DV2 may be one of hexadecimal values.
[0043] The encoder module 230 may output first encoding values EN1 and second encoding values EN2 and first inverted encoding values EN1 and second inverted encoding values EN2 based on or in response to first decoding values DV1 and second decoding values DV2 received from the substitution module 220. The first inverted encoding values EN1 and second inverted encoding values EN2 may be data in which the first encoding values EN1 and second encoding values EN2 have been inverted, respectively. For example, when the first encoding value EN1 is "0100" as a binary number, the first inverted encoding value EN1 may be "1011" as a binary number.
[0044] The first encoder 231 may convert the first decoded value DV1 into one of the first phenotypes, and may output the converted value as the first encoded value EN1. In addition, the second encoder 232 may convert the second decoded value DV2 into one of the second phenotypes, and may output the converted value as the second encoded value EN2. The first phenotype and the second phenotype may be values mapped to the first decoded value DV1 and the second decoded value DV2, respectively. In addition, the first phenotype and the second phenotype may correspond to any one of the N-ary integers (where N is a natural number of 1 or greater). For example, the first decoded value DV1 may be 4, which is one of the 16 values that can be represented in hexadecimal, and the second decoded value DV2 may be A, which is also one of the 16 values that can be represented in hexadecimal. The first phenotype may include 3, 5, A, and C in hexadecimal, and the second phenotype may include 3, 6, 9, and C in hexadecimal. In this case, the first encoder 231 may convert the first decoded value DV1 (i.e., 4) into 5 (i.e., one of the first phenotypes corresponding to 4), and may output 5 as the first encoded value EN1. In addition, the second encoder 232 may convert the second decoded value DV2 (i.e., A) into 9 (i.e., one of the second phenotypes corresponding to A). In this manner, the first encoder 231 may select one of the first phenotypes based on the first decoded value DV1, and may output the selected first phenotype as the first encoded value EN1. In addition, the second encoder 232 may select one of the second phenotypes based on the second decoded value DV2, and may output the selected second phenotype as the second encoded value EN2.
[0045] The gate module 240 can generate the first output data SB_OA by using a logic operation on the first encoding value EN1 and the second encoding value EN2, and can output the second output data SB_OB based on or in response to the first inverted encoding value EN1 and the second inverted encoding value EN2. For example, the first XOR gate 241 can perform an XOR operation on the first encoding value EN1 and the second encoding value EN2, and output the data after the XOR operation as the first output data SB_OA. In addition, the second XOR gate 242 can perform an XOR operation on the first inverted encoding value EN1 and the second inverted encoding value EN2, and output the data after the XOR operation as the second output data SB_OB. Because the first output data SB_OA and the second output data SB_OB are normal data and inverted data after the XOR operation, respectively, they can be the same as each other.
[0046] The output terminal 13 may receive the first output data SB_OA and the second output data SB_OB. For example, the output terminal 13 may output transmission data including the first output data SB_OA as a high bit and the second output data SB_OB as a low bit. For example, the transmission data may have the same number of bits as the input data SB_IN.
[0047] Figure 4 is a diagram showing an exemplary embodiment according to the inventive concept Figure 3 The block diagram of the S-box is shown in the following. Figure 3 Descriptions are given with reference to the reference numerals in FIG.
[0048] Reference Figure 4 , the decoder 210 may include a first input gate module 211 and a second input gate module 212. The first permutation logic 221 may include a first index unit A1, and the second permutation logic 222 may include a second index unit A2.
[0049] According to an exemplary embodiment of the inventive concept, the input data SB_IN may be bx0101, and the inverted input data ~SB_IN may be bx1010. The first input gate module 211 may include a plurality of AND gates, and each of the plurality of AND gates may receive different data bits from each other via two input terminals. For example, each input terminal of the AND gate may receive a data bit of the input data SB_IN and / or a data bit of the inverted input data ~SB_IN. For example, the first input gate module 211 may include a first AND gate GA1 and a second AND gate GA2. The input terminal of the first AND gate GA1 may receive the input data SB_IN of the bit value 1 and the inverted input data ~SB_IN, and the output terminal of the first AND gate GA1 outputs the bit value 1. In addition, the input terminal of the second AND gate GA2 may also receive the bit value 1, and the output terminal of the second AND gate GA2 outputs the bit value 1. The number of AND gates included in the first input gate module 211 may be equal to the sum of the number of bits of the input data SB_IN and the number of bits of the inverted input data ~SB_IN.
[0050] According to an exemplary embodiment of the inventive concept, the second input gate module 212 may include a plurality of AND gates, and the plurality of AND gates of the second input gate module 212 may receive bit values from the first input gate module 211. In other words, each AND gate included in the second input gate module 212 may receive bit values from two AND gates among the AND gates included in the first input gate module 211. For example, each AND gate included in the first input gate module 211 may be connected to two AND gates among the AND gates included in the second input gate module 212 via two output lines.
[0051] According to an exemplary embodiment of the inventive concept, a plurality of AND gates of the second input gate module 212 may output a first decoded signal DS1 and a second decoded signal DS2. The first decoded signal DS1 and the second decoded signal DS2 may have a bit value of 0 or 1.
[0052] As an example, the second input gate module 212 may select one of the indexes of the first index unit A1 (e.g., 3) and one of the indexes of the second index unit A2 (e.g., 3) by outputting the first decoded signal DS1 and the second decoded signal DS2 having a bit value of 1. As another example, the second input gate module 212 may not select other indexes (e.g., 0 to 2 and 4 to F) among the indexes of the first index unit A1 and other indexes (e.g., 0 to 2 and 4 to F) among the indexes of the second index unit A2 by outputting a decoded signal having a bit value of 0.
[0053] The first permutation logic 221 may output a first decoded value DV1. The first decoded value DV1 may include a bit value 1 for a selected index (e.g., 3) and a bit value 0 for an unselected index (e.g., 0 to 2 and 4 to F). The second decoded value DV2 may also include a bit value 1 for a selected index (e.g., 3) and a bit value 0 for an unselected index (e.g., 0 to 2 and 4 to F). For example, the first decoded value DV1 and the second decoded value DV2 may include data in which a bit value 0 or 1 is recorded in each of a plurality of indexes. For example, the first decoded value DV1 and the second decoded value DV2 may include data including a bit value 1 in one index and a bit value 0 in other indexes.
[0054] Reference Figure 4 , the second input gate module 212 may select the same index (eg, 3) in the first index unit A1 and the second index unit A2. However, the inventive concept is not limited thereto, and the second input gate module 212 may select different indexes from the first index unit A1 and the second index unit A2.
[0055] According to an exemplary embodiment of the inventive concept, each of the first encoder 231 and the second encoder 232 may receive a decoded value indicating the same integer, but the decoded values may be received via different receiving means included in each of the first encoder 231 and the second encoder 232. For example, even if the first encoder 231 and the second encoder 232 receive a first decoded value DV1 and a second decoded value DV2 respectively indicating 3, the first encoder 231 may output a first encoded value EN1 of bx0011, and the second encoder 232 may output a second encoded value EN2 of bx1100 different from the first encoded value EN1. The first encoder 231 may output a first inverted encoded value ˜EN1 including bx1100 in which the first encoded value EN1 has been inverted, and the second encoder 232 may output a second inverted encoded value ˜EN2 including bx0011 in which the second encoded value EN2 has been inverted.
[0056] The first XOR gate 241 may output the first output data SB_OA by performing an XOR operation on the first and second encoding values EN1 and EN2. In addition, the second XOR gate 242 may output the second output data SB_OB by performing an XOR operation on the first and second inverted encoding values EN1 and EN2.
[0057] Figure 5 is a circuit diagram showing an encoder circuit according to an exemplary embodiment of the present invention. Figure 4 Descriptions are given with reference to the reference numerals in FIG.
[0058] Reference Figure 5, the encoding circuit EC may be a digital circuit of the first encoder 231 and the second encoder 232 described above. The encoding circuit EC may include a plurality of row gates RG and a plurality of column gates CG. The plurality of row gates RG may include a first row gate R1, a second row gate R2, a third row gate R3, and a fourth row gate R4, each of the plurality of row gates RG may be implemented by an OR gate, and each of the plurality of row gates RG may include a plurality of input terminals (e.g., four input terminals). In addition, the plurality of column gates CG may include a first column gate C1, a second column gate C2, a third column gate C3, and a fourth column gate C4, each of the plurality of column gates CG may be implemented by an OR gate, and each of the plurality of column gates CG may include a plurality of input terminals (e.g., four input terminals).
[0059] According to an exemplary embodiment of the inventive concept, the encoding circuit EC may be included in the first encoder 231. In this case, the encoding value EN output by the encoding circuit EC may be the first encoding value EN1. As another example, the encoding circuit EC may be included in the second encoder 232. In this case, the encoding value EN output by the encoding circuit EC may be the second encoding value EN2.
[0060] The encoding circuit EC can output various types of encoding values. Fig. 6A The first encoding circuit EC1 can output a first type of encoding value ( Fig. 6A ET1), and for example, the first type coded value ET1 can be output as the first coded value EN1, and as another example, Fig. 6A The first encoding circuit EC1 can output a second type of encoding value ( Figure 6B ET2 in the figure) as the first encoding value EN1. Fig. 6A and Figure 6B Describe the details.
[0061] The multiple indexes of the decoded values DV may be allocated to the multiple input terminals (e.g., 16 input terminals) of the row gate RG in a specific combination. In addition, the multiple indexes of the decoded values DV may be allocated to the multiple input terminals (e.g., 16 input terminals) of the column gate CG in the same combination as the specific combination or in a different combination. Fig. 6A and Figure 6B Describe the details.
[0062] Fig. 6A and Figure 6B is a circuit diagram illustrating an encoder circuit according to an exemplary embodiment of the inventive concept.
[0063] Reference Fig. 6A The first encoding circuit EC1 may include a first encoder ( Figure 4 231) digital circuit, and refer to Figure 6BThe second encoding circuit EC2 may include a second encoder ( Figure 4 232) digital circuit.
[0064] Reference Figure 4 and Fig. 6A , the first encoder 231 may include a plurality of row gates RG, which receive the first decoded value DV1 and assign a first phenotype as an output of the plurality of row gates RG based on a specific Hamming weight value. For example, the first phenotype may include 3, 6, 9, and C in hexadecimal to be output by the first row gate R1, the second row gate R2, the third row gate R3, and the fourth row gate R4, respectively. The first phenotype may include a value assigned based on a specific Hamming weight value. For example, the first phenotype may include 3, 6, 9, and C in hexadecimal. The first phenotype may be represented as 0011, 0110, 1001, and 1100 in binary, and each of the first phenotypes may have a specific Hamming weight value of 2.
[0065] In other words, at least one of the first phenotype and the second phenotype may have a Hamming weight value of 2, and the side channel attack may be strongly resisted by using a uniform Hamming weight value. However, the specific Hamming weight value is not limited to 2, and in some cases, at least one of the first phenotype and the second phenotype may include 3, 4, or 5. According to the above example, the first encoder 231 may use Fig. 6A The first encoding circuit EC1 is implemented, but not limited thereto, and the second encoder 232 can be used Figure 6B In addition, the first encoder 231 and the second encoder 232 may be implemented in various forms through a plurality of exemplary embodiments described below. In response to the first row gate R1 outputting a binary number having a bit value of 1, the first encoder 231 may output one of the first phenotypes (e.g., 3) assigned to the first row gate R1 as the first encoding value EN1.
[0066] Reference Figure 4 and Figure 6B , the second encoder 232 may include a plurality of row gates RG, which receive the second decoded value DV2 and assign a second phenotype as an output of the plurality of row gates RG based on a specific Hamming weight value. Figure 6B , the second phenotype may include hexadecimal 3, 6, 9, and C, but may also include hexadecimal 3, 5, A, and C. Similarly, the first phenotype may also include hexadecimal 3, 5, A, and C. In response to the fourth row gate R4 outputting a binary number having a bit value of 1, the second encoder 232 may output one of the second phenotypes (e.g., C) assigned to the fourth row gate R4 as the second encoded value EN2.
[0067] Return to reference Figure 5 and Fig. 6A, a plurality of indexes may be assigned to the input terminal of the row gate RG in the form of a first index combination FP1. In addition, a plurality of indexes may be assigned to the input terminal of the column gate CG in the form of a second index combination FP2.
[0068] The first index combination FP1 and the second index combination FP2 may include a first index including “FEDC”, a second index including “BA98”, a third index including “7654”, and a fourth index including “3210”. The first index may be assigned to the input terminals of the fourth row gate R4 and the first column gate C1, the second index may be assigned to the input terminals of the third row gate R3 and the second column gate C2, the third index may be assigned to the input terminals of the second row gate R2 and the third column gate C3, and the fourth index may be assigned to the input terminals of the first row gate R1 and the fourth column gate C4.
[0069] According to an exemplary embodiment of the inventive concept, one of the plurality of row gates RG may output a binary number of a bit value of 1, and the other row gates of the plurality of row gates RG may output a binary number of a bit value of 0. In response to the binary number of the bit value 1 being output, the first encoding circuit EC1 may output one of the phenotypes (e.g., 3) as the first type encoding value ET1. For example, the first encoding circuit EC1 may output "0011" as the first type encoding value ET1, and output "1100" as the first type inverted encoding value ~ET1.
[0070] When the row gate RG receives the code value of the bit value 1, the first encoding circuit EC1 can output one of the plurality of phenotypes as the first type code value ET1. The phenotype can be a range of values that the encoding circuit EC can have as an output. In addition, the first phenotype can correspond to any one of the integers in the N-ary system (N is a natural number of 1 or greater). For example, referring to Fig. 6A , the phenotype may include 3, 6, 9, and C among the hexadecimal integers. Each phenotype may be assigned to the first row gate R1, the second row gate R2, the third row gate R3, and the fourth row gate R4. For example, when the first row gate R1 assigned with phenotype 3 receives a bit value 1 via one of the input terminals of the first row gate R1, the first encoding circuit EC1 may output phenotype 3 as the first encoding value EN1. In this case, the decoded value DV input to the input terminal of the first row gate R1 may include a bit value 1 for hexadecimal index 0, a bit value 1 for hexadecimal index 1, a bit value 1 for hexadecimal index 2, or a bit value 1 for hexadecimal index 3. Refer to Fig. 6A , as one of the input terminals of the first row gate R1 , the decoded value DV having a bit value 1 for the hexadecimal index 3 may be input to one of the input terminals of the first row gate RG1 .
[0071] The first encoding circuit EC1 may output the first type encoding value ET1, and, for example, the first encoding circuit EC1 may use the first type encoding value ET1 as the first encoding value EN1. In this case, the first encoding circuit EC1 may be included in the first encoder 231. As another example, the first encoding circuit EC1 may output the first type encoding value ET1 as the second encoding value EN2. In this case, the first encoding circuit EC1 may be included in the second encoder 232.
[0072] Reference Figure 6B , the third index combination FP3 and the fourth index combination FP4 may include a fifth index including "FB73", a sixth index including "EA62", a seventh index including "D951", and an eighth index including "C840". The fifth index may be assigned to the input terminals of the fourth row gate R4 and the first column gate C1, the sixth index may be assigned to the input terminals of the third row gate R3 and the second column gate C2, the seventh index may be assigned to the input terminals of the second row gate R2 and the third column gate C3, and the eighth index may be assigned to the input terminals of the first row gate R1 and the fourth column gate C4.
[0073] and Fig. 6A Unlike the example shown in FIG. 1 , when the decoded value DV including the bit value 1 for the hexadecimal index 3 is input to the second encoding circuit EC2, the fourth row gate R4 and the first column gate C1 may output the bit value 1. In this case, Fig. 6A As shown, the second encoding circuit EC2 may output "1100" as the second type encoding value ET2, and output "0011" as the second type inverted encoding value ~ET2. This is because the indexes assigned to the input terminals of the row gate RG and the column gate CG may have changed.
[0074] The second encoding circuit EC2 may output the second type encoding value ET2, and for example, the second encoding circuit EC2 may output the second type encoding value ET2 as the first encoding value EN1. In this case, the second encoding circuit EC2 may be included in the first encoder 231. As another example, the second encoding circuit EC2 may output the second type encoding value ET2 as the second encoding value EN2. In this case, the second encoding circuit EC2 may be included in the second encoder 232.
[0075] Reference Figure 4 , Fig. 6A and Figure 6B, the first encoding circuit EC1 may include a plurality of row gates RG receiving the first decoded value DV1, and may output a first phenotype (e.g., 3) assigned to the row gate (e.g., R1) as the first encoding value EN1 in response to the row gate (e.g., R1) outputting a binary number including a bit value of 1. In addition, the second encoding circuit EC2 may include a plurality of row gates RG, and output a phenotype (e.g., C) assigned to the row gate (e.g., R4) as the second encoding value EN2 in response to the row gate (e.g., R4) outputting a binary number including a bit value of 1.
[0076] Refer again Figure 5 , the encoding circuit EC may determine the first encoding value EN1 based on the outputs of the row gate RG and the column gate CG. For example, the first most significant bit MSB of the first encoding value EN1 may be a bit value obtained by performing an OR operation on the bit values of the fourth row gate R4 and the third row gate R3. The second most significant bit MSB2 of the first encoding value EN1 may be a bit value obtained by performing an OR operation on the bit values of the fourth row gate R4 and the second row gate R2. The third most significant bit MSB3 of the first encoding value EN1 may be a bit value obtained by performing an OR operation on the bit values of the fourth column gate C4 and the second column gate C2. The least significant bit LSB of the first encoding value EN1 may be a bit value obtained by performing an OR operation on the bit values of the fourth column gate C4 and the third column gate C3.
[0077] In addition, the encoding circuit EC can determine the first inverted encoding value ~EN1 based on the outputs of the row gate RG and the column gate CG. For example, the most significant bit MSB of the first inverted encoding value ~EN1 may be a bit value obtained by performing an OR operation on the bit values of the second row gate R2 and the first row gate R1. The second most significant bit MSB2 of the first inverted encoding value ~EN1 may be a bit value obtained by performing an OR operation on the bit values of the third row gate R3 and the first row gate R1. The third most significant bit MSB3 of the first inverted encoding value ~EN1 may be a bit value obtained by performing an OR operation on the bit values of the third column gate C3 and the first column gate C1. The least significant bit LSB of the first inverted encoding value ~EN1 may be a bit value obtained by performing an OR operation on the bit values of the second column gate C2 and the first column gate C1.
[0078] Figure 7 is a table illustrating encoding values according to an exemplary embodiment of the inventive concept.
[0079] Reference Fig. 6A , Figure 6B and Figure 7, each row of the table may indicate a row gate RG, and each column of the table may indicate a column gate CG. "0x0" to "0xF" may be the first encoding value EN1 and / or the second encoding value EN2. In other words, one of the row gates RG may output a bit value 1, the remaining row gates RG may output a bit value 0, one of the column gates CG may output a bit value 1, and the remaining column gates CG may output a bit value 0. In this case, the encoding circuit EC may output a value corresponding to one of the row gates RG that has output a bit value 1 and one of the column gates CG that has output a bit value 1 as the first encoding value EN1 or the second encoding value EN2.
[0080] According to an exemplary embodiment of the present invention, when one of the row gates RG outputs a bit value of 1 and one of the column gates CG outputs a bit value of 1, the encoding circuit EC can be configured so that any one from "0x0" to "0xF" is output as the first encoding value EN1 or the second encoding value EN2.
[0081] According to an exemplary embodiment of the inventive concept, the first row gate R1 may output a bit value of 1, and the remaining second to fourth row gates R2 to R4 may output a bit value of 0. In addition, the fourth column gate C4 may output a bit value of 1, and the remaining first to third column gates C1 to C3 may output a bit value of 0. In this case, the encoding circuit EC may output "0x3" as the first encoding value EN1 or the second encoding value EN2.
[0082] According to an exemplary embodiment of the inventive concept, the fourth row gate R4 may output a bit value of 1, and the remaining first to third row gates R1 to R3 may output a bit value of 0. In addition, the first column gate C1 may output a bit value of 1, and the remaining second to fourth column gates C2 to C4 may output a bit value of 0. In this case, the encoding circuit EC may output "0xC" as the first encoding value EN1 or the second encoding value EN2.
[0083] Figure 8 is a table illustrating first and second coded values according to exemplary embodiments of the inventive concept.
[0084] Reference Fig. 6A , Figure 6B and Figure 8 , when the decoded value DV is input to the encoding circuit EC, the first type encoding value ET1 and the second type encoding value ET2 can be output. As described above, the first type encoding value ET1 can be the first encoding value EN1 or the second encoding value EN2, and the second type encoding value ET2 can be similar to this. In this case, when the input data ( Figure 4) is a four-bit binary code, the number of instances (e.g., possible values) of the input data SB_IN may be 16, and therefore, the number of instances of the decoded value DV may also be 16. In this case, the number of first phenotypes of the first encoder 231 may be 4 (e.g., 0x3, 0x6, 0x9, and 0xC), and the number of second phenotypes of the second encoder 232 may be 4 (e.g., 0x3, 0x6, 0x9, and 0xC). The first encoder 231 may output a first encoded value EN1 including the first phenotype, and the second encoder 232 may output a second encoded value EN2 including the second phenotype. For example, for each case where the first encoded value EN1 may include 3, 6, 9, and C, the second encoded value EN2 may include 3, 6, 9, and C, respectively. By performing an XOR operation on the first type encoded value ET1 having four instances and the second type encoded value ET2 having four instances, the S-box ( Figure 4 12) can output the first output data including 16 instances ( Figure 4 SB_OA).
[0085] Reference Fig. 6A , Figure 6B and Figure 8 , when the decoded value DV is 3 (for example, when the decoded value DV has a bit value of 1 for the hexadecimal index 3), the first row gate R1 and the fourth column gate C4 included in the first encoding circuit EC1 may output the bit value 1. In addition, the fourth row gate R4 and the first column gate C1 included in the second encoding circuit EC2 may output the bit value 1. Therefore, the first encoding circuit EC1 may output hexadecimal 3 as the first type encoding value ET1, and the second encoding circuit EC2 may output hexadecimal C as the second type encoding value ET2. Figure 8 In the table shown, even if the first type code value ET1 and the second type code value ET2 are interchanged, the same technical concept can be applied.
[0086] Fig. 9 is a digital circuit diagram illustrating an S-box according to an exemplary embodiment of the inventive concept.
[0087] Reference Fig. 9, the first encoder 231a and the first encoder 231b and the second encoder 232a and the second encoder 232b may include the above-mentioned encoding circuit EC. The first encoder 231a and the first encoder 231b may be included in the first encoding module 230a. The second encoder 232a and the second encoder 232b may be included in the second encoding module 230b. Compared with the above-mentioned decoder 210, the decoder 210a may include a larger number of gates. For example, the first input gate module 211a may include 16 AND gates corresponding to each bit of the input data SB_IN and the inverted input data ~SB_IN. In addition, the second input gate module 212a may include 256 AND gates to decode the 8-bit input data SB_IN. Each of the third permutation logic 223 and the fourth permutation logic 224 may include 16 AND gates including 16 input terminals to select one of the 16 integers included in each of the third index unit A3 and the fourth index unit A4.
[0088] Reference Fig. 9 , the decoder 210a may receive input data SB_IN and inverted input data ~SB_IN. The input data SB_IN and the inverted input data ~SB_IN may each be data including 8 bits. In this case, the first encoder 231a may output a portion EN1[7:4] of the first encoded value, and the first encoder 231b may output the remainder EN1[3:0] of the first encoded value. In other words, the first encoding module 230a may output the first encoded value EN1. On the other hand, the second encoder 232a may output a portion EN2[7:4] of the second encoded value, and the second encoder 232b may output the remainder EN2[3:0] of the second encoded value. In other words, the second encoding module 230b may output the second encoded value EN2. Unlike the first encoded value EN1 and the second encoded value EN2 shown in the previous figures, Fig. 9 Each of the first encoding value EN1 and the second encoding value EN2 shown in FIG. 1 may include 8 bits of data.
[0089] A portion EN1[7:4] of the first encoded value may include a first type encoded value ET1, and the remaining portion (e.g., the remaining portion) EN1[3:0] of the first encoded value may include a second type encoded value ET2. Similar to this case, a portion EN1[7:4] of the second encoded value may include a first type encoded value ET1, and the remaining portion (e.g., the remaining portion) EN2[3:0] of the second encoded value may include a second type encoded value ET2. In other words, the first encoder 231a and the first encoder 231b may output encoded values of different types from each other, and the second encoder 232a and the second encoder 232b may output encoded values of different types from each other.
[0090] The first encoding module 230a and the second encoding module 240b may respectively receive decoded values from the third permutation logic 223 and the fourth permutation logic 224. The first encoder 231a and the first encoder 231b may share the third permutation logic 223, and the second encoder 232a and the second encoder 232b may share the fourth permutation logic 224.
[0091] The decoder 210a may output a decoded signal based on the input data SB_IN and the inverted input data ~SB_IN. The third replacement logic 223 may send one of the integers included in the third index unit A3 as a first decoded value DV1a to the first encoder 231a based on the decoded signal received from the decoder 210a. In addition, the third replacement logic 223 may send one of the integers included in the third index unit A3 as a second decoded value DV2a to the first encoder 231b based on the decoded signal.
[0092] The fourth replacement logic 224 may transmit one of the integers included in the fourth index unit A4 as a first decoded value DV1b to the second encoder 232a based on the decoded signal received from the decoder 210a. In addition, the fourth replacement logic 224 may transmit one of the integers included in the fourth index unit A4 as a second decoded value DV2b to the second encoder 232b based on the decoded signal.
[0093] A plurality of logic gates (e.g., XOR gates) may receive a first encoding value EN1 and a second encoding value EN2 and generate first output data SB_OA and second output data SB_OB. The third XOR gate 243 and the fifth XOR gate 245 may output the first output data SB_OA by performing an XOR operation on the first encoding value EN1 and the second encoding value EN2. For example, the third XOR gate 243 may perform an XOR operation on a portion EN1[7:4] of the first encoding value and a portion EN2[7:4] of the second encoding value. The fifth XOR gate 245 may perform an XOR operation on the remaining portion (e.g., the remaining portion) EN1[3:0] of the first encoding value and the remaining portion (e.g., the remaining portion) EN2[3:0] of the second encoding value. In other words, the third XOR gate 243 and the fifth XOR gate 245 may perform an XOR operation on the bits corresponding to the first encoding value EN1 and the second encoding value EN2, respectively. By combining the output value EN1 [7:4] generated by the first encoder 231 a with the output value EN1 [3:0] generated by the first encoder 231 b , the output data EN1 [7:0] may be output.
[0094] The fourth XOR gate 244 and the sixth XOR gate 246 may output the second output data SB_OB by performing an XOR operation on the first inverted code value ~EN1 and the second inverted code value ~EN2. The fourth XOR gate 244 may perform an XOR operation on a portion of the first inverted code value ~EN1[7:4] and a portion of the second inverted code value ~EN2[7:4]. The sixth XOR gate 246 may perform an XOR operation on a portion of the first inverted code value ~EN1[3:0] and a portion of the second inverted code value ~EN2[3:0]. In other words, the fourth XOR gate 244 and the sixth XOR gate 246 may perform an XOR operation on bits corresponding to the first inverted code value ~EN1 and the second inverted code value ~EN2, respectively.
[0095] Fig.10 is a table describing first and second coded values according to exemplary embodiments of the inventive concept.
[0096] Reference Fig.10 , the decoded value DV may be a decoded value input to the first encoder 231a and the first encoder 231b and the second encoder 232a and the second encoder 232b. For example, the row gates (e.g., Fig. 6A RG in) and column gates (e.g., Fig. 6A CG in may receive a decoded value DV in which a bit value of one of indexes 0 to F is 1. For example, a decoded value DV including a bit value of 1 in index 3 may be {0000 0000 0000 1000}.
[0097] When using Fig. 6A The first encoding circuit EC1 implements Fig. 9 The first encoder 231a in the embodiment of the present invention and the use of Figure 6B The second encoding circuit EC2 implements Fig. 9 When the first encoder 231b in Fig.10 The first encoding value EN1[7:0] is shown. In addition, when using Fig. 6A The first encoding circuit EC1 implements Fig. 9 The second encoder 232a in the embodiment of the present invention and using Figure 6B The second encoding circuit EC2 implements Fig. 9 When the second encoder 232b is used, it can be obtained Fig.10The second encoded value EN2[7:0] is shown. For example, the first encoder 231a may output one of the phenotypes (e.g., 3, 6, 9, and C) as a portion EN1[7:4] of the first encoded value, and the first encoder 231b may output one of the phenotypes (e.g., 3, 6, 9, and C) as the remaining portion EN1[3:0] of the first encoded value. The first encoding module 230a may output the first encoded value EN1 by combining the partial data of the first encoded value outputted from the first encoder 231a and the first encoder 231b.
[0098] Fig.11 is a table describing a first combination of phenotypes according to exemplary embodiments of the inventive concept.
[0099] Reference Figure 4 , Fig. 9 and Fig.11 , the first combination set may include a plurality of combinations (first combination 1-1 to twelfth combination 1-12), the first encoders 231, 231a, and 231b may have a phenotype corresponding to one of the first combination 1-1 to twelfth combination 1-12, and the second encoders 232, 232a, and 232b may have a phenotype corresponding to one of the first combination 1-1 to twelfth combination 1-12. The left four phenotypes in each combination may be a range of output values that the first encoders 231, 231a, and 231b may output, and the right four phenotypes in each combination may be a range of output values that the second encoders 232, 232a, and 232b may output.
[0100] For example, when the first encoders 231, 231a and 231b have phenotypes 1, 5, 9 and D, the second encoders 232, 232a and 232b may have phenotypes 3, 5, A and C according to the first combination 1-1, or may have phenotypes 3, 6, 9 and C according to the fifth combination 1-5.
[0101] exist Fig.11 Combinations of the phenotypes described in the table shown can be used to maintain row gates (e.g., Figure 5Load balancing can mean that the average value of the indexes of the multiple input terminals assigned to a specific row of gates is consistent with the average value of the indexes of the multiple input terminals assigned to other row gates. In addition, because each phenotype of the first combination 1-1 to the twelfth combination 1-12 has an average Hamming weight value of 2, side channel attacks can be prevented. The Hamming weight may refer to the number of bit values 1 in a binary bit stream. For example, in the case of the first combination 1-1, since phenotype 1 satisfies the Hamming weight 1, phenotype 5 and phenotype 9 satisfy the Hamming weight 2, and phenotype D satisfies the Hamming weight 3, the average value of the Hamming weight of a part EN1[7:4] of the first encoded value output from the first encoder 231, 231a, and 231b and the Hamming weight of the remaining part EN1[3:0] of the first encoded value can be 2. In addition, since the Hamming weights of all phenotypes 3, 5, A, and C are 2, the average value of the Hamming weight of a portion EN2[7:4] of the second encoded value output from the second encoders 232, 232a, and 232b and the Hamming weight of the remaining portion EN2[3:0] of the second encoded value may be 2. Even if the left four phenotypes and the right four phenotypes are interchanged, they may include the same technical idea.
[0102] Fig.12 is a table describing a second combination set of phenotypes according to exemplary embodiments of the inventive concept.
[0103] Reference Figure 4 , Fig. 9 and Fig.12 , the second combination set may include a plurality of combinations (first combination 2-1 to twelfth combination 2-12), the first encoders 231, 231a, and 231b may have a phenotype corresponding to one of the first combination 2-1 to the twelfth combination 2-12, and the second encoders 232, 232a, and 232b may have a phenotype corresponding to one of the first combination 2-1 to the twelfth combination 2-12. The left four phenotypes in each combination may be a range of output values that the first encoders 231, 231a, and 231b may output, and the right four phenotypes in each combination may be a range of output values that the second encoders 232, 232a, and 232b may output.
[0104] For example, when the first encoders 231, 231a and 231b have phenotypes 5, 6, 8 and B, the second encoders 232, 232a and 232b may have phenotypes 3, 5, A and C according to the third combination 2-3, or may have phenotypes 3, 6, 9 and C according to the seventh combination 2-7.
[0105] exist Fig.12 Combinations of the phenotypes described in the table shown can maintain column gates (e.g., Figure 5CG in ). Load balancing may mean that the average value of the indexes of the multiple input terminals assigned to a specific column gate is consistent with the average value of the indexes of the multiple input terminals assigned to other column gates. In addition, because each phenotype of the first combination 2-1 to the twelfth combination 2-12 has an average Hamming weight value of 2, side channel attacks may be prevented. For example, in the case of the fifth combination 2-5, since phenotype 4 satisfies the Hamming weight 1, phenotype 5 and phenotype 6 satisfy the Hamming weight 2, and phenotype 7 satisfies the Hamming weight 3, the average value of the Hamming weight of a portion EN1[7:4] of the first encoded value output from the first encoder 231, 231a, and 231b and the Hamming weight of the remaining portion EN1[3:0] of the first encoded value may be 2. In addition, since the Hamming weights of all phenotypes 3, 6, 9, and C are 2, the average value of the Hamming weight of a portion EN2[7:4] of the second encoded value output from the second encoders 232, 232a, and 232b and the Hamming weight of the remaining portion EN2[3:0] of the second encoded value may be 2. Even if the left four phenotypes and the right four phenotypes are interchanged, they may include the same technical idea.
[0106] Fig.13 is a table describing a third combination set of phenotypes according to exemplary embodiments of the inventive concept.
[0107] Reference Figure 4 , Fig. 9 and Fig.13 , the third combination set may include a plurality of combinations (first combination 3-1 to sixteenth combination 3-16), the first encoders 231, 231a, and 231b may have a phenotype corresponding to one of the first combination 3-1 to sixteenth combination 3-16, and the second encoders 232, 232a, and 232b may have a phenotype corresponding to one of the first combination 3-1 to sixteenth combination 3-16. The left four phenotypes in each combination may be a range of output values that the first encoders 231, 231a, and 231b may output, and the right four phenotypes in each combination may be a range of output values that the second encoders 232, 232a, and 232b may output.
[0108] For example, when the first encoders 231, 231a and 231b have phenotypes 1, 7, A and C, the second encoders 232, 232a and 232b may have phenotypes 3, 6, 9 and C according to the fifth combination 3-5, or may have phenotypes 3, 4, A and D according to the sixteenth combination 3-16.
[0109] exist Fig.13 The combination of phenotypes described in the table shown can maintain all row gates (e.g., Figure 5 RG in) and column gates (e.g., Figure 5CG in ( ), and thus can be called a good combination. Load balancing can mean that the average value of the indexes of multiple input terminals assigned to a specific row gate and a specific column gate is consistent with the average value of the indexes of multiple input terminals assigned to other row gates and other column gates. In addition, because each phenotype of the first combination 3-1 to the sixteenth combination 3-16 has an average Hamming weight value of 2, side channel attacks can be prevented. For example, in the case of the fifth combination 3-5, since phenotype 1 satisfies Hamming weight 1, the phenotypes of phenotype A and phenotype C satisfy Hamming weight 2, and phenotype 7 satisfies Hamming weight 3, the average value of the Hamming weight of a part EN1[7:4] of the first encoded value output from the first encoder 231, 231a and 231b and the Hamming weight of the remaining part EN1[3:0] of the first encoded value can be 2. In addition, since the Hamming weights of all phenotypes 3, 6, 9, and C are 2, the average value of the Hamming weight of a portion EN2[7:4] of the second encoded value output from the second encoders 232, 232a, and 232b and the Hamming weight of the remaining portion EN2[3:0] of the second encoded value may be 2. Even if the left four phenotypes and the right four phenotypes are interchanged, they may include the same technical idea.
[0110] According to an exemplary embodiment of the inventive concept, as in the first combination 3-1 to the eighth combination 3-8, the second encoders 232, 232a and 232b may have phenotypes 3, 5, A and C, or phenotypes 3, 6, 9 and C. Since each of the phenotypes 3, 5, A and C has a Hamming weight of 2, the third combination set may be good from the perspective of having a consistent Hamming weight. On the other hand, when the second encoders 232, 232a and 232b have phenotypes 3, 5, A and C or phenotypes 3, 6, 9 and C, the first encoders 231, 231a and 231b may have phenotypes different from phenotypes 3, 5, A and C or phenotypes 3, 6, 9 and C.
[0111] Fig.14A and Fig. 14B The exemplary embodiments according to the present invention are described based on Fig.13 The table of output data in which the encoded values of the table type are XORed.
[0112] Reference Figure 4 , Fig. 9 , Fig.14A and Fig. 14B, at least some of the first to sixth XOR gates 241 to 246 may perform an XOR operation on a portion EN1[7:4] of the first encoded value and a portion EN2[7:4] of the second encoded value. In addition, at least some of the first to sixth XOR gates 241 to 246 may perform an XOR operation on the remaining portion EN1[3:0] of the first encoded value and the remaining portion EN2[3:0] of the second encoded value. The XOR operation value may be one of the output data of the S-box 12 (e.g., SB_OA and SB_OB).
[0113] Reference Fig.14A In the first combination 3-1, by performing an XOR operation on the encoded value including C (EN1[7:4] or EN2[7:4]) and the encoded value including C (EN1[3:0] or EN2[3:0]), one of the first to sixth XOR gates 241 to 246 may output data SB_OA representing 0. As another example, referring to Fig. 14B In the ninth combination 3-9, by performing an XOR operation on the encoding value including 6 (EN1[7:4] or EN2[7:4]) and the encoding value including 7 (EN1[3:0] or EN2[3:0]), one of the first to sixth XOR gates 241 to 246 can output data SB_OA representing 0.
[0114] Fig.15 is used to describe an exemplary embodiment according to the inventive concept. Fig.13 A table of the Hamming weights of the first and second coded values of the phenotypes in .
[0115] Reference Fig.15 Each of the first encoder 231 and the second encoder 232 may output a signal having a Fig.13 The first encoded value EN1 and the second encoded value EN2 of the phenotype of the seventh combination 3-7 in the embodiment. The first encoded value EN1 may include one of the phenotypes 3, 5, 8, and E, and the second encoded value EN2 may include one of the phenotypes 3, 6, 9, and C. In other words, when the phenotypes that the output first encoded value EN1 and the second encoded value EN2 may have are combined, the S-box 12 may generate 16 kinds of output data (e.g., SB_OA). In the seventh combination 3-7, the sum of the Hamming weight HW(EN1) of the first encoded value EN1 and the Hamming weight HW(EN2) of the second encoded value EN2 may be 3, 4, or 5. In particular, when the first encoded value EN1 has one of the phenotypes 3, 5, 8, and E, and the second encoded value EN2 has one of the phenotypes 3, 6, 9, and C, the average value of the sum of the Hamming weights (e.g., HW(EN1)+HW(EN2)) may be 4.
[0116] On the other hand, each of the first encoder 231 and the second encoder 232 may output a signal having a Fig.13 The first encoded value EN1 and the second encoded value EN2 of the phenotype of the fifteenth combination 3-15 in the embodiment. When the first encoded value EN1 has one of the phenotypes 3, 5, 8, and E, and the second encoded value EN2 has one of the phenotypes 3, 4, A, and D, the average value of the sum of the Hamming weights (e.g., HW(EN1)+HW(EN2)) may also be 4. Therefore, the S-box 12 may have good security against side channel attacks.
[0117] Fig.16A and Fig. 16B is a digital circuit diagram illustrating an encoder circuit according to an exemplary embodiment of the inventive concept.
[0118] Reference Figure 4 and Fig.16A , the first encoder 231 can be implemented using the third encoding circuit EC3. Figure 4 and Fig. 16B , the second encoder 232 can be implemented using the fourth encoding circuit EC4.
[0119] Reference Fig.16A and Fig. 16B , one of the phenotypes 3, 5, A, and C may be assigned to each of the row gates RG, and one of the phenotypes 3, 5, A, and C may also be assigned to each of the column gates CG. In this case, the encoding value EN may include one of the phenotypes 3, 5, A, and C. For example, the phenotype 3 may be assigned to the first row gate R1 and the fourth column gate C4, the phenotype 5 may be assigned to the second row gate R1 and the second column gate C2, the phenotype A may be assigned to the third row gate R3 and the third column gate C3, and the phenotype C may be assigned to the fourth row gate R4 and the first column gate C1. In response to the row gate RG and the column gate CG outputting a binary number including a bit value 1, the encoder module ( Figure 3 230) in can output the encoded values having the phenotypes respectively assigned to the row gate RG and the column gate CG.
[0120] Reference Fig.16A, the fifth index combination FP5 may be assigned to a plurality of input terminals of the row gate RG. In addition, the sixth index combination FP6 may be assigned to a plurality of input terminals of the column gate CG. The fifth index combination FP5 and the sixth index combination FP6 may include: a first index including "FEDC", a second index including "BA98", a third index including "7654", and a fourth index including "3210". The first index may be assigned to the fourth row gate R4 and the first column gate C1, the second index may be assigned to the third row gate R3 and the third column gate C3, the third index may be assigned to the second row gate R2 and the second column gate C2, and the fourth index may be assigned to the first row gate R1 and the fourth column gate C4. For example, when a decoded value DV including a bit value 1 for index A is received, the third encoding circuit EC3 may output "1010" indicating phenotype A as the encoding value EN.
[0121] Reference Fig. 16B , the seventh index combination FP7 may be assigned to a plurality of input terminals of the row gate RG. In addition, the eighth index combination FP8 may be assigned to a plurality of input terminals of the column gate CG. The seventh index combination FP7 and the eighth index combination FP8 may include: a fifth index including "FB73", a sixth index including "EA62", a seventh index including "D951", and an eighth index including "C840". The fifth index may be assigned to the fourth row gate R4 and the first column gate C1, the sixth index may be assigned to the third row gate R3 and the third column gate C3, the seventh index may be assigned to the second row gate R2 and the second column gate C2, and the eighth index may be assigned to the first row gate R1 and the fourth column gate C4. For example, when a decoded value DV including a bit value 1 for the index D is received, the fourth encoding circuit EC4 may output "0101" indicating phenotype 5 as the encoding value EN.
[0122] The term "module" may refer to software, or hardware components such as field programmable gate arrays (FPGAs) or application specific integrated circuits (ASICs), and a "module" may perform a specific role. However, a "module" is not limited to software or hardware. A "module" may be configured to reside in an addressable storage medium, and may be configured to reproduce one or more processors. Therefore, a "module" may include, for example, a component (such as a software component, an object-oriented software component, a class component, a task component), a process, a function, a procedure, a subroutine, a program code segment, a driver, a firmware, a microcode, a circuit, data, a database, a data structure, a table, an array, or a variable. The functions provided in the components and "modules" may be combined into a smaller number of components and "modules", or may be further separated into additional components and "modules".
[0123] While the inventive concept has been particularly shown and described with reference to exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the inventive concept as set forth in the following claims.
Claims
1. A safety circuit, include: a decoder configured to receive input data and output a decoded signal in response to the input data; A first encoder configured to output, in response to the decoded signal, a first phenotype corresponding to any integer among the N-ary integers in the first phenotype as a first encoding value, wherein N is a natural number of 1 or greater; A second encoder configured to output, in response to the decoded signal, a second table type corresponding to any integer among the N-ary integers in the second table type as a second code value; and a gate module circuit configured to generate output data by performing a logic operation on the first coded value and the second coded value, Wherein, the first encoder comprises a plurality of row gates, One of the first phenotypes is assigned to one of the plurality of row gates, One of the plurality of row gates to which one of the first phenotypes is assigned outputs a first binary number having a bit value of 1, The remaining row gates of the plurality of row gates output a second binary number having a bit value of 0, and The first encoder outputs one of the first phenotypes as the first encoded value in response to the one row gate of the plurality of row gates outputting the first binary number.
2. The safety circuit according to claim 1, further comprising: include: A permutation logic circuit is configured to select one of a plurality of integers based on the decoded signal and output the selected integer as a decoded value to the first encoder and the second encoder.
3. The safety circuit according to claim 1, further comprising: include: a first permutation logic circuit configured to select a first integer among a plurality of integers based on the decoded signal and output the first integer as a first decoded value to the first encoder; as well as A second permutation logic circuit is configured to select a second integer among the plurality of integers based on the decoded signal and output the second integer as a second decoded value to the second encoder.
4. The safety circuit according to claim 1, in, The gate module circuit includes an XOR gate, and The output data is a result of performing an XOR operation on the first encoded value and the second encoded value by using the XOR gate.
5. The safety circuit according to claim 2, in, Each of the plurality of row gates comprises a plurality of first input terminals, and One first input terminal of the plurality of first input terminals receives the decoded value.
6. The safety circuit according to claim 5, in, The second encoder comprises a plurality of column gates, Each of the plurality of column gates comprises a plurality of second input terminals, and One second input terminal of the plurality of second input terminals receives the decoded value.
7. The safety circuit according to claim 1, in, The output data is a combination of a first portion including the first encoded value and a second portion including the second encoded value.
8. The safety circuit according to claim 1, in, The Hamming weight of the first encoded value or the second encoded value is 2.
9. The safety circuit according to claim 8, in, The first phenotype or the second phenotype includes 3, 5, A and C in hexadecimal, or 3, 6, 9 and C in hexadecimal.
10. The safety circuit according to claim 1, in, The sum of the Hamming weight of the first encoded value and the Hamming weight of the second encoded value is 3, 4 or 5.
11. A safety circuit, include: a first permutation logic circuit configured to output a first decoded value; a second permutation logic circuit configured to output a second decoded value; a first encoder including a plurality of first row gates configured to receive the first decoded value, wherein the first encoder is assigned a first table type as an output of the plurality of first row gates based on a specific Hamming weight value, and the first encoder is configured to output one of the first table types assigned to one of the plurality of first row gates as a first encoded value in response to a binary number having a bit value of 1; A second encoder includes a plurality of second row gates configured to receive the second decoded value, wherein the second encoder is assigned a second table type as an output of the plurality of second row gates based on a specific Hamming weight value, and the second encoder is configured to output one of the second table types assigned to one of the plurality of second row gates as a second encoded value in response to a binary number having a bit value of 1.
12. The safety circuit according to claim 11, further comprising: include: The gate module circuit is configured to output first output data by performing an XOR operation on the first code value and the second code value.
13. The safety circuit according to claim 12, in, The gate module circuit outputs second output data by performing an XOR operation on the first inverted code value and the second inverted code value.
14. The safety circuit according to claim 11, in, The first phenotype and the second phenotype are preset so that input data and output data are mapped one-to-one.
15. The safety circuit according to claim 11, in, The first phenotype or the second phenotype is 3, 6, 9 and C in hexadecimal.
16. The safety circuit according to claim 11, in, The first phenotype or the second phenotype is 3, 5, A and C in hexadecimal.
17. The safety circuit according to claim 11, in, At least one of the first phenotype and the second phenotype includes a value with a Hamming weight of 2.
18. An encryption and decryption device, include: an input terminal configured to receive input data from an external device; a replacement box configured to generate output data encoded or decoded from the input data received via the input terminal; as well as an output terminal configured to output the output data, Wherein, the replacement box comprises: a decoder configured to output a decoded signal in response to the input data; a first encoder configured to output, in response to the decoded signal, one of the first tables corresponding to any integer among the N-ary integers as a first encoding value, wherein N is a natural number of 1 or greater; and a second encoder configured to output, in response to the decoded signal, a second representation corresponding to any integer among the N-ary integers in the second representation as a second encoded value, and The output data is a result of performing a logical operation on the first coded value and the second coded value, Wherein, the first encoder comprises a plurality of row gates, One of the first phenotypes is assigned to one of the plurality of row gates, One of the plurality of row gates to which one of the first phenotypes is assigned outputs a first binary number having a bit value of 1, The remaining row gates of the plurality of row gates output a second binary number having a bit value of 0, and The first encoder outputs one of the first phenotypes as the first encoded value in response to the one row gate of the plurality of row gates outputting the first binary number.
Citation Information
Patent Citations
Method and apparatus for compressor
KR1020200023836A
Encryption processing circuit and encryption processing method
US20080212776A1
Encoder and method for encoding thereof
US20150254476A1
Endecryptor preventing side channel attack, driving method thereof and control device having the same
US20160065361A1
