This U.S. non-provisional application claims priority under 35 USC § 119 to Korean Patent Application Nos. 10-2023-0086099, filed on Jul. 3, 2023 and 10-2023-0113070, field on Aug. 28, 2023, in the Korean Intellectual Property Office, the disclosure of each of which is herein incorporated by reference in their entirety.
Various example embodiments relate to a method and a device for generating random permutations, and a processor including a random permutation generating logic circuit.
Many security technologies use random permutations.
In the field of post-quantum cryptography (PQC), e.g., of cryptography that is or is more likely to be secure even in the presence of quantum computers, there are methods such as lattice-based cryptography and/or code-based cryptography. Such methods include vector operations which enable or help to enable parallel processing. Parallel vector operations implement hiding countermeasures to defend or help defend against side-channel analysis (SCA) attacks. To use hiding countermeasures efficiently, there is a need or a desire for technology to generate random permutations in a manner that ensures or that helps to ensure security.
In the related arts, the Fisher-Yates shuffle has been used as a random permutation generation method of shuffling a plurality of elements included in a sequence. The Fisher-Yates shuffling has factorial complexity, e.g., has complexity that scales factorially. However, the Fisher-Yates shuffle requires a significantly large storage space and is unsuitable for parallel processing. For example, according to Fisher-Yates shuffle, the next round of shuffling is performed based on a result of a previous round of shuffling.
Various example embodiments provide a method and a device for generating random permutations using a manner capable of performing parallel processing while achieving or helping to achieve required complexity.
Alternatively or additionally various example embodiments provide a processor including a logic circuit generating random permutations in a manner capable of performing parallel processing while achieving required complexity.
According to some example embodiments, there is provided a processor including a controller configured to respectively assign different index numbers to a plurality of operations, a shuffling logic configured to perform a bitwise operation on each of the index numbers based on a modular addition operation and a rotation shift operation and to shuffle the index numbers, and an operation logic configured to perform the plurality of operations based on the shuffled index numbers.
Alternatively or additionally according to various example embodiments, an integrated circuit includes a processing logic configured to provide processing data on which an operation is to be performed, to a shuffling logic, and the shuffling logic configured to perform a bitwise operation on at least a portion of the processing data based on a modular addition operation and on a rotation shift operation.
Alternatively or additionally according to various example embodiments, an integrated circuit includes a processing logic configured to provide different pieces of processing data to a plurality of shuffling logics, and the plurality of shuffling logics configured to perform a bitwise operation on at least a portion of the processing data based on a modular addition operation and on a rotation shift operation. Output data of each of the plurality of shuffling logics may set a permutation in which the different pieces of processing data are shuffled.
Alternatively or additionally according to some example embodiments, a method of generating random permutations, performed by a processor of a computing device, includes receiving a plurality of key sets and basic permutation data set by a plurality of numbers, and shuffling numbers of the basic permutation data on each of the numbers of the basic permutation data by performing a bitwise operation based on a modular addition operation and on a rotation shift operation.
The above and other aspects, features, and advantages of the present disclosure will be more clearly understood from the following detailed description, taken in conjunction with the accompanying drawings.
Hereinafter, various example embodiments will be described with reference to the accompanying drawings.
The processor 10 may be or may include, or may be included in, a processor used in a mobile device such as a smartphone and/or a tablet PC. Alternatively or additionally, the processor 10 may be or may include or be included in a processor used in a server device such as one or more of a security server, a data management server, or a cloud server.
The processor 10 may be or include a general-purpose processor such as an application processor (AP) and/or a central processing unit (CPU), or a specific-purpose secure processor performing encryption and decryption. When the processor 10 is a specific-purpose secure processor, the processor 10 may be disposed as a semiconductor chip, separate from an application processor (AP) and a central processing unit (CPU), or may be disposed as a part of a module inside the application processor (AP) and the central processing unit (CPU).
The controller 100 according to various example embodiments may transmit a command for generating random permutations to the shuffling logic 200.
In some example embodiments, the controller 100 may transmit a random permutation generation command to the shuffling logic 200, together with the number of required or expected elements of random permutation. For example, the controller 100 may transmit 6, which is the number of bit digits (or the bit size) of the number of elements of a random permutation including 64=2{circumflex over ( )}6 elements, and the random permutation generation command to the shuffling logic 200.
Alternatively or additionally, the controller 100 may assign index numbers to respective elements included in basic permutation data and transmit the assigned index numbers one by one to the shuffling logic 200. The number of the elements included in the basic permutation data may also be separately provided to the shuffling logic 200. Alternatively or additionally, each index number may be provided to the shuffling logic 200. For example, an index number “1” of the basic permutation data including 64 elements may be transmitted to the shuffling logic 200 as “00 00 01”.
The controller 100 may generate a plurality of keys to be used in the shuffling of the shuffling logic 200, and may provide the generated keys to the shuffling logic 200. A portion of the keys may have a size, different from a size of another portion of the keys. For example, the keys may include an initial key and a round key, and the number of bits in the initial key may be larger than the number of bits in the round key. The round key may include a plurality of key sets in which the same number of keys are included. The controller 100 may include a storage unit, capable of temporarily storing a plurality of keys.
The shuffling logic 200 may include a plurality of shuffling logics. Different shuffling logics or different shuffling logic operations may perform bitwise operations using different keys. A key may be used in a modular addition operation with processing data. The initial key and the round key may be randomly generated.
In some example embodiments, the controller 100 may assign an index number to each of a plurality of operations. The controller 100 may control the shuffling logic 200 such that the index numbers are shuffled to generate random permutations. Then, the operation logic 300 may perform a plurality of operations based on the shuffled index numbers.
For example, referring to
The controller 100 may sequentially reassign the example random permutation such as but not limited to {j, 1, . . . , N, 2, i}, generated by shuffling the N index numbers by the shuffling logic 200, to N operations as new index numbers. The operation logic 300 may perform operations based on the new index numbers. In this case, the operation logic 300 may perform operations serially, e.g., in the order of the new index number, and/or may group a plurality of operations based on the new index numbers and then process the grouped operations in parallel. Accordingly, at least some parallel vector operations of security algorithms may be randomized and performed, so that at least some hiding countermeasures against side-channel analysis (SCA) may be performed.
The shuffling logic 200 according to some example embodiments may perform a bitwise operation based on a modular addition operation and on a rotation shift operation on the processing data to output shuffled data. For example, the shuffling logic 200 may receive an integer i and may perform a bitwise operation based on a bit modular addition operation and a rotation shift operation on i binary bits to output j, where i and j may be different from each other.
The shuffling logic 200 may perform a rotation shift operation on a result of the modular addition operation. When the shuffling logic 200 performs a plurality of modular addition operations, a plurality of rotation shift operations may be performed. When a plurality of rotation shift operations are performed, the number of bits rotated and shifted in some rotation shift operations may be different from each other.
When a random permutation is generated from basic permutation data having N elements, the shuffling logic 200 may independently shuffle binary bits of the N elements. For example, when a random permutation is generated by shuffling the N elements according to a Fisher-Yates shuffle, one element of the random permutation may be determined, and then subsequently another element may be determined. Therefore, the elements of the random permutation may be sequentially determined. However, the shuffling logic 200 according to some example embodiments may independently determine the elements of the random permutation. Accordingly, the elements of the random permutation may be independently determined in the same clock period. For example, the shuffling logic 120 may shuffle each binary bit data of a plurality of pieces of processing data in the same clock period, regardless of other processing data. For example, the shuffling logic 200 may simultaneously and independently shuffle the i binary bits and (i+1) binary bits in the same clock period.
The modular addition operation of the shuffling logic 200 will be described below in more detail with reference to
As described herein, the modular addition operation is represented by a symbol k(t) The modular addition operation symbol
k(t) is defined as (k+t) mod N, and N is defined as 2n for n bits of the processing data t. For example, N may be the number of integers that can be represented with n, the number of bits. In addition, k represents a key. Accordingly, the shuffling logic 200 may perform a modular addition operation on at least a portion of the processing data, provided from the controller 100, and the key.
Referring to
Each bit of the binary digits of the processing data t is added to a bit of a corresponding bit digit of the key IK. Therefore, t[5] is added to IK[5], t[4] is added to IK[4], t[3] is added to IK[3], t[2] is added to IK[2], t[1] is added to IK[1], and t[0] is added to IK[0]. Addition of bits in each digit may generate a carry bit in an upper bit digit. The addition of bits is performed with a carry bit included. A most significant bit C6 of a result of the binary bit addition operation of the processing data t and the key IK is discarded. Thus, the output data t_MA becomes a remainder by N=64.
A rotation shift operation of the shuffling logic 200 will be described below in more detail with reference to
As described herein, the rotation shift operation is represented by a symbol or
. The symbols
and
refer to a rotation shift operation by S bits in a left direction (a more significant direction) and a rotation shift operation by S bits in a right direction (a less significant direction), respectively. Bits, shifted to exceed a most significant bit digit, are sequentially rotated and shifted to a least significant bit digit. Accordingly, when a rotation shift operation is performed on data having n bit digits, the data may return to itself regardless of direction, e.g., after n such rotations.
Referring to
The preprocessing logic 210 may receive input data IN and may provide the shuffling logic 220 with processing data i to be shuffled along with at least one key to be used for a modular addition operation.
In some example embodiments, the input data IN may include processing data i and a key. In this case, the preprocessing logic 210 may include a flip-flop (such as one or more D flip-flops) and may provide the processing data i and the key to the shuffling logic 220 in synchronization with a clock signal.
In some example embodiments, the input data IN may be the number of numbers required or used for random permutation. For example, when a random permutation including 64 numbers is required or used, the preprocessing logic 210 may sequentially provide processing data i including six bits to the shuffling logic 220. Alternatively or additionally, a plurality of pieces of processing data may be provided to the plurality of shuffling logics 220 in parallel, respectively.
According to some example embodiments, the preprocessing logic 210 may include a key generator. The key generator may be a random number generator generating random keys. In this case, the preprocessing logic 210 may generate a plurality of keys, different from each other, and may provide the generated keys to the shuffling logic 220. In some example embodiments, the key generator may be a post-quantum key generator; example embodiments are not limited thereto.
The shuffling logic 220 may receive processing data i including n bits, and may shuffle at least a portion of the n bits and output shuffled data i_shuffled including n bits.
The initial shuffling logic 221 may be provided with an initial key IK. The initial shuffling logic 221 will be described in detail with reference to
The initial shuffling logic 221 may divide a result of shuffling the binary data of the processing data i into a plurality of blocks MSB and LSB_INIT and provide each of the blocks MSB and LSB_INIT to the intermediate shuffling logic 223.
The intermediate shuffling logic 223 may include a plurality of key selectors 223_K1 to 223_KR as well as a plurality of round units 223_R1 to 223_RR.
Each of the plurality of round units 223_R1 to 223_RR may include at least one modular adder and at least one rotation shift operator.
The intermediate shuffling logic 223 may be provided with keys to be used in modular addition operations of a plurality of round units 223_R1 to 223_RR. The keys provided to the intermediate shuffling logic 223 may include a plurality of key sets. The key sets may be referred to as round key sets. Each of the round key sets may include a plurality of round keys. The round keys may be randomly generated keys.
In some example embodiments, the round key set may include a number of keys, such as four round key sets. This will be described in detail with reference to
Each of the key selectors 223_K1 to 223_KR of the intermediate shuffling logic 223 may select a single round key, from among round keys to be used in a modular addition operation, based on a first block MSB among the plurality of blocks MSB and LSB_INIT provided by the initial shuffling logic 221. In some example embodiments, the first block MSB may include most significant 2 bits of a result of shuffling the processing data i by the initial shuffling logic 221.
Each of the plurality of round units 223_R1 to 223_RR of the intermediate shuffling logic 223 may perform a modular addition operation on an output result of a previous round unit and the selected round keys Key_1 to Key_R based on the first block MSB. For example, the first round unit 223_R1 may perform a modular addition operation on the second block LSB_INIT, provided by the initial shuffling logic 221, and the round key Key_1 selected by the first key selector 223_K1. The second block LSB_INIT may include remaining bits excluding the most significant 2 bits from the result of shuffling the processing data i by the initial shuffling logic 221. The first round unit 223_R1 may perform a rotation shift operation on the result of the modular addition operation, and may provide the result to a next round unit.
The final shuffling logic 225 may receive a first block MSB and a second block LSB_INTER from the intermediate shuffling logic 223. The first block MSB, provided to the final shuffling logic 225, is the same as the first block MSB provided to the intermediate shuffling logic 223.
The final shuffling logic 225 is provided with a final key. The final shuffling logic 225 may perform a modular addition operation on the second block LSB_INTER and the final key.
The initial shuffling logic will be described below in detail with reference to
The modular adder 221_MA may perform a modular addition operation on n bits of processing data i and on n bits of initial key IK, and may provide n bits of output i_MA to a rotation shift operator 221_RS. The modular addition operation may be performed as described in
The rotation shift operator 221_RS may perform a rotation shift operation by S bits on the provided i_MA. The number of bit digits S to be rotated and shifted may be randomly determined. The rotation shift operator 221_RS may receive the number of bit digits S from the preprocessing logic 210 and/or from the controller 100. In some example embodiments, the rotation shift operator 221_RS of the initial shuffling logic 221 may perform a rotation shift operation in a left direction (e.g., in a more significant bit direction).
The initial shuffling logic 221 may divide a result of performing the rotation shift operation i_RS into two blocks MSB[2] and LSB_INIT[n-2], and may provide each of the blocks MSB[2] and LSB_INIT[n-2] to the intermediate shuffling logic 223. A first block MSB[2] may include the two most significant bits of a result i_RS of performing the rotation shift operation, and a second block LSB_INIT[n-2] may include a remainder excluding two most significant bits from the result i_RS of performing the rotation shift operation.
The intermediate shuffling logic will be described below in detail with reference to
The intermediate shuffling logic 223 according to some example embodiments may include R round units 223_R1 to 223_RR and R key selectors 223_K1 to 223_KR. Each of the round units 223_R1 to 223_RR may perform a shuffling operation. The shuffling operation may include a modular addition operation using a modular adder and a rotation shift operation using a rotation shift operator.
The intermediate shuffling logic 223 may include a plurality of key selectors 223_K0 to 223_K1 and a plurality of round units 223_R1 to 223_RR. Each of the plurality of round units 223_R1 to 223_RR may include a modular addition operator and a rotation shift operator. For example, a first round unit 223_R1 may include a first modular addition operator 223_MA1 and a first rotation shift operator 223_RS1. A second round unit 223_R2 may include a second modular addition operator 223_MA2 and a second rotation shift operator 223_RS2. A final round unit 223_RR may include an R-th modular addition operator and an R-th rotation shift operator.
The plurality of round units 223_R1 to 223_RR may receive a round key from corresponding key selectors 223_K1 to 223_KR, respectively. Each of the plurality of key selectors 223_K1 to 223_KR may select a round key based on the first block MSB provided from the initial shuffling logic 221. The plurality of key selectors 223_K1 to 223_KR may select a round key based on the same first block MSB. In some example embodiments, the key selectors 223_K1 to 223_KR may select a single round key, among four round keys, based on 2 bits of first block MSB.
The first round unit 223_R1 may perform a modular addition operation on n-2 bits of second block LSB_INIT, provided from the initial shuffling logic 221, and n-2 bits of round key provided from the key selector 223_K1. The first round unit 223_R1 may perform a rotation shift operation on a modular addition operation result MA1, and may provide a rotation shift operation result RS1 to a next round unit.
Round units, subsequent to the first round unit 223_R1, may perform a modular addition operation on a rotation shift operation result of a previous round unit and a round key provided from a corresponding key selector, and may perform a rotation shift operation on a modular addition operation result. A result of performing the rotation shift operation may be provided to a next round unit.
The modular addition operator of each of the plurality of round units 223_R1 to 223_RR may perform a modular addition operation on n-2 bits of processing data, provided from a previous unit, and n-2 bits of round key. Modular addition may be performed on n-2. Therefore, when the processing data i input to the shuffling logic 220 is n=6 bits, most significant 2 bits may be used for round key selection, and the remaining 4 bits may be used for a modular addition operation on 16.
In some example embodiments, a portion of the rotation shift operators 223_RS1 to 223_RR of the plurality of round units 223_R1 to 223_RR may perform a 1-bit rotation shift operation in a left direction, and the remainder may perform a 1-bit (single bit) rotation shift operation in a right direction. For example, among the plurality of round units 223_R1 to 223_RR, first R/2 rotation shift operators may perform a 1-bit rotation shift operation in the left direction, and remaining R/2 rotation shift operators may perform a 1-bit rotation shift operation in the right direction.
The number of shuffling operations performed by the intermediate shuffling logic 223 may be preset based on the number of bit digits and complexity of processing data input to the shuffling logic 220. The complexity may be or may correspond to the degree of complexity required or used for security specifications and/or hiding countermeasures.
For example, the number of shuffling operations performed by the intermediate shuffling logic 223 may be preset as illustrated in Table 1, based on the number of bit digits (bit size) and complexity of the processing data input to the shuffling logic 220.
Referring to Table 1, when the processing data is 6 bits and complexity of 228 is required, a shuffling operation may be performed 8 times in the intermediate shuffling logic 223. Accordingly, the shuffling logic 223 may include eight round units.
The complexity H(X) refers to complexity of computing operation on a random variable X, and may be based on the product of probability of a random variable p(x) and a log scale log(p(x)).
In some example embodiments, the intermediate shuffling logic 223 may only perform half of the number of shuffling operations in Table 1, based on processing data and required complexity. Accordingly, the shuffling logic 223 may include round units corresponding to half the number of shuffling operations in Table 1. In this case, the rotation shift operators of each round unit of the shuffling logic 223 may be operators that only perform a 1-bit rotation shift operation in the left direction. For example, when there is a random permutation having a symmetrical structure, the required complexity may be achieved even when only half of the number of shuffling operations in Table 1 is performed. Accordingly, when a random permutation has a symmetrical structure, desired complexity and/or security may be achieved or may be more likely to be achieved with only a small number of round units of the intermediate shuffling logic 223.
The key selectors 223_K1 to 223_KR according to some example embodiments may select one of a plurality of keys as a round key based on the first block MSB provided by the initial shuffling logic 221.
Referring to
For example, a first round key set Key Set 0 may include R keys {k01, k02 to k0R}. Similarly, a second round key set Key Set 1 may include R keys {k11, k12 to k1R}. A third round key set Key Set 2 and a fourth round key set Key Set 3 may be similar thereto.
Keys included in each of the round key sets Key Set 0, Key Set 1, Key Set 2, and Key Set 3 may be randomly generated. The round key sets Key Set 0, Key Set 1, Key Set 2, and Key Set 3 may be generated by the preprocessing logic 210 and/or the controller 100.
The key selector may select a round key set of one of the four round key sets Key Set 0, Key Set 1, Key Set 2, and Key Set 3, based on most significant 2 bits MSB[2] of the processing data. The key selector may provide a round key corresponding to a round unit, among R keys included in the selected round key set.
For example, a portion of n pieces of processing data may be subjected to a modular addition operation with each of the round keys of the first round key set Key Set 0, based on most significant 2 bits (MSB[2]) “00.” Another portion of n pieces of processing data may be subjected to a modular addition operation with each of the round keys of the second round key set Key Set 1, based on most significant 2 bits (MSB[2]) “01.” Another portion of n pieces of processing data may be subjected to a modular addition operation with each of the round keys of the third round key set Key Set 2, based on most significant 2 bits (MSB[2]) “10.” The remaining portion of n pieces of processing data may be subjected to a modular addition operation with each of the round keys of the fourth round key set Key Set 3, based on most significant 2 bits (MSB[2]) “11.”
Returning to
The intermediate shuffling logic 223 may increase complexity by selecting a round key based on the most significant bits of the processed data.
The final shuffling logic will be described below in detail with reference to
The modular adder 225_MA may perform a modular addition operation on n-2 bits of processing data RSR and n-2 bits of final key provided by the intermediate shuffling logic 223. Similarly to the intermediate shuffling logic 223, one of a plurality of keys k0j, k1j, k2j, and k3j may be selected as the final key, based on the first block MSB[2] provided by the initial shuffling logic 221.
The modular adder 225_MA may provide n-2 bits of output Maj to the rotation shift operator 225_RS. The modular addition operation may be performed as described in
The rotation shift operator 225_RS may configure the provided Maj as lower bits, and may perform an S-bit rotation shift operation on data with the first block MSB[2] configured as most significant bits. For example, the rotation shift operator 225_RS may merge the first block MSB[2] and the provided Maj, and may then perform the rotation shift operation.
The number of bit digits S rotated and shifted may be randomly determined. The rotation shift operator 225_RS may receive the number of bit digits S from the preprocessing logic 210 or the controller 100. In some example embodiments, the rotation shift operator 221_RS of the final shuffling logic 225 may perform a rotation shift operation in a right direction.
The final shuffling logic 225 may output data i_shuffled in which binary bits of the processing data I received by the shuffling logic 220 are shuffled.
The shuffling circuit 200_1, described with reference to
Similarly to the description provided with reference to
In some example embodiments, the input data IN may be the number of numbers required for random permutation. For example, when generation of a random permutation including 64 numbers is requested, each of the preprocessing logics Preprocessing Logic 1 to Preprocessing Logic n of the preprocessing logic unit 210_2 may process 6 bits of data. A plurality of pieces of the processing data {1, . . . , n} may be provided in parallel to corresponding shuffling logics Shuffling Logic 1 to Shuffling Logic n, respectively. Each of the plurality of shuffling logics Shuffling Logic 1 to Shuffling Logic n may independently shuffle binary bits of the input processing data. Each of the plurality of shuffling logics Shuffling Logic 1 to Shuffling Logic n may perform shuffling operations in the same clock period.
Output data of each of the plurality of shuffling logics Shuffling Logic 1 to Shuffling Logic n of the shuffling circuit 200_2 may constitute a random permutation in which the plurality of pieces of the processing data {1, . . . , n} are randomly shuffled.
Accordingly, unlike Fisher-Yates shuffle, random permutations may be generated in a significantly small amount of time. In addition, a plurality of shuffling logics operates independently of each other, so that a large storage space may not be required.
Referring to
Unlike example embodiments of the intermediate shuffling logic 223_1 described with reference to
The key storage unit 223_D may include a plurality of round key sets. Each of the plurality of round key sets may store a plurality of round keys. Each of the plurality of round key sets may store a number of round keys corresponding to a number of rounds (such as a predetermined number of rounds) ROUND.
The key storage unit 223_D may receive a round to be performed ROUND_NO, among the number of rounds ROUND, and may provide corresponding round keys k0r, k1r, k2r, and k3r of each round key set to the key selector 223_K.
The key selector 223_K may select a single round key from among the plurality of keys provided k0r, k1r, k2r, and k3r based on the first block MSB provided to the initial shuffling logic, and may provide the selected round key to the round unit 223_R.
The round unit 223_R may include a multiplexer 223_MU, a modular adder 223_MA, a rotation shift operator 223_RS, and a round controller 223_C.
The round controller 223_C may determine whether to additionally perform a round based on the number of performed rounds, among the number of rounds ROUND. When the number of rounds ROUND is completed, the round controller 223_C may provide an output RS, provided by the rotation shift operator 223_RS, to a final shuffling unit. When the number of rounds ROUND is not completed, the round controller 223_C may provide the output RS, provided by the rotation shift operator 223_RS, to the multiplexer 223_MU.
The multiplexer 223_MU may select either one of a second block LSB, provided by an initial shuffling unit, and an output RS, provided by the rotation shift operator 223_RS, and may provide the selected LSB or RS to the modular adder 223_MA. The multiplexer 223_MU may select one of the second block LSB and the output RS as an input to the modular adder 223_MA based on a select signal SEL provided by the round controller 223_C.
The modular adder 223_MA performs a modular addition operation on one of the second block LSB and the output RS and the round key provided by the key selector 223_K. The modular adder 223_MA may provide a result MA of the modular addition operation to the rotation shift operator 223_RS.
The rotation shift operator 223_RS may receive a direction LEFT or RIGHT of the rotation shift operation, and may perform an S-bit rotation shift operation on the result MA of the modular addition operation. According to some example embodiments, the rotation shift operator 223_RS may perform a 1-bit rotation shift operation. The rotation shift operator 223_RS may provide a result RS of the rotation shift operation to the round controller 223_C.
Accordingly, the intermediate shuffling logic 223_2 according to the example embodiment of
According to some example embodiments, the intermediate shuffling logic 223_2 may be provided in plural, as described in
The method of generating random permutations according to some example embodiments may be performed by the processor of
The shuffling circuit may shuffle a plurality of elements of basic permutation data, to generate a random permutation. The shuffling circuit may process a plurality of numbers, elements of basic permutation data, in parallel independently of each other to shuffle the processed numbers.
Alternatively, the shuffling circuit may sequentially receive a plurality of numbers, elements of basic permutation data, and may shuffle binary bits of each of the numbers to output numbers constituting a random permutation.
In operation S110, the shuffling circuit may receive basic permutation data and a plurality of key sets.
Elements of the basic permutation data may be a plurality of non-overlapping numbers. In this case, the shuffling circuit may generate and shuffle index numbers corresponding to the elements of the basic permutation data.
In some example embodiments, the elements of the basic permutation data may be a sequence of index numbers.
When the basic permutation data is X={x0, x1, x2, . . . , xN-1}, the shuffled and output random permutation may be Y={y0, y1, y2, . . . , yN-1}, where yi and yj are different from each other, and i and j are different from each other.
The shuffling circuit may be provided with a plurality of keys and the number of rounds R.
The shuffling circuit may be provided with the number of rounds R together with the basic permutation data. The number of rounds R is the number of rounds performed in the intermediate shuffling operation described with reference to
The plurality of keys may include a plurality of round keys used for each round. For example, a single key set may be K={k0, k1, . . . , kR} including R round keys, used in R rounds of the intermediate shuffling operation, and a final key used in the final shuffling operation. The key set may be provided in plural.
In operation S120, the shuffling circuit may shuffle the elements of the basic permutation data by performing a modular addition operation and a rotation shift operation on the basic permutation data.
The modular addition operation and rotation shift operation may be bitwise operations, and may be performed on each of the elements of the basic permutation data.
For example, a bitwise operation may be performed on each of the elements of the basic permutation data X={x0, x1, x2, . . . , xN-1}, and a result of performing the bitwise operation on each of the elements may constitute elements of a random permutation.
The modular addition operation may be described as illustrated in
The shuffling circuit may perform an initial shuffling operation, an intermediate shuffling operation, and a final shuffling operation.
In operation S121, the shuffling circuit may perform a modular addition operation on processing data (a single element of the basic permutation data X={x0, x1, x2, . . . , xN-1} and an initial key. The shuffling circuit may perform an S-bit rotation shift operation on a result of the modular addition operation. The S bits may be randomly determined. The initial key may be a randomly generated key of n bits (log N). The shuffling circuit may perform a rotation shift operation in a left direction.
The shuffling circuit may divide a result of the rotation shift operation in operation S121 into two blocks (a first block and a second block), and may provide the two blocks to an intermediate shuffling operation.
In operation S123, the shuffling circuit may perform R round shuffling operations based on the second block. Each round shuffling operation may be performed by a modular addition operation and a rotation shift operation. According to some example embodiments, the shuffling circuit may achieve required complexity with R/2 round shuffling operations.
The round keys of the key set K={k0, k1, . . . , kR}, provided in operation S110, may be used in the modular addition operation of each round shuffling operation.
The round shuffling operation will be described below in detail with reference to
In operation S123a, among a plurality of key sets, a single key set may be selected based on the first block provided in operation S121. Each key set may include R round keys and a final key used in the final shuffling operation.
In operation S123b, a modular addition operation may be performed on a round key corresponding to each round operation, among round keys of the selected key set, and an operation result provided in the previous round operation.
In operation S123c, an S-bit rotation shift operation may be performed on the result of the modular addition operation. According to some example embodiments, a 1-bit rotation shift operation may be performed.
A portion of a total of R round shuffling operations may be a rotation shift operation performed in a left direction, and another portion may be a rotation shift operations performed in a right direction. For example, a rotation shift operation may be performed in a left direction in the first half of the round shuffling operation, and a rotation shift operation may be performed in a right direction in the second half of the round shuffling operation, for a total of R round shuffling operations.
In operation S123d, when the round shuffling operation is performed a number of times (such as a predetermined) number of times, the shuffling circuit may stop the round shuffling operation.
While
Returning to
The shuffling circuit may perform a modular addition operation on an operation result in the intermediate shuffling operation S123 and the final key. The shuffling circuit may perform a rotation shift operation on a result of the modular addition operation. The rotation shift operation in the final shuffling operation S125 may be performed on data obtained by merging the result of the modular addition operation and the first block. The shuffling circuit may perform an S-bit rotation shift operation on a result of the modular addition operation. The S bit may be randomly determined. The shuffling circuit may perform a rotation shift operation in a right direction.
As set forth above, a method and a device for generating random permutations according to some example embodiments may generate random permutations using a manner capable of performing parallel processing while achieving or helping to achieve required or desired complexity.
Alternatively or additionally, a method and a device for generating random permutations according to various example embodiments may process a plurality of operations in parallel based on random permutations generated in a manner capable of performing parallel processing, while achieving or helping to achieve required or desired complexity.
Any of the elements and/or functional blocks disclosed above may include or be implemented in processing circuitry such as hardware including logic circuits; a hardware/software combination such as a processor executing software; or a combination thereof. For example, the processing circuitry more specifically may include, but is not limited to, a central processing unit (CPU), an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a System-on-Chip (SoC), a programmable logic unit, a microprocessor, application-specific integrated circuit (ASIC), etc. The processing circuitry may include electrical components such as at least one of transistors, resistors, capacitors, etc. The processing circuitry may include electrical components such as logic gates including at least one of AND gates, OR gates, NAND gates, NOT gates, etc.
While various example embodiments have been shown and described above, it will be apparent to those of ordinary skill in the art that modifications and variations could be made without departing from the scope of the present inventive concept as defined by the appended claims. Additionally example embodiments are not necessarily mutually exclusive with one another. For example, some example embodiments may include one or more features described with reference to one or more figures, and may also include one or more other features described with reference to one or more other figures.
Number | Date | Country | Kind |
---|---|---|---|
10-2023-0086099 | Jul 2023 | KR | national |
10-2023-0113070 | Aug 2023 | KR | national |