Scrambled NTT circuits for post-quantum cryptography with resistance to side-channel attacks
By introducing out-of-order NTT circuits into the post-quantum cryptographic algorithm and using random numbers to adjust the running order of butterfly units, the problem that existing technology cannot effectively resist side-channel attacks is solved, and high security performance is improved.
Patent Information
- Application Number
- CN202410581633.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-05-11
AI Technical Summary
Existing post-quantum cryptographic algorithm processors cannot effectively resist side-channel attacks, especially the log-theoretic transformation (NTT) module that is easily targeted.
A disordered NTT circuit is designed, which adjusts the running order of butterfly units by introducing random numbers, increases the diversity of operation paths, and thereby improves the ability to resist side channel attacks. The circuit includes a control unit, an arithmetic unit and a storage unit, and uses random numbers to control the running sequence of the butterfly unit to achieve disordered NTT operations.
Adjusting the running sequence of butterfly units by random numbers greatly increases the number of possible operation paths, significantly improves the security performance of the system, effectively resists side-channel attacks, and ensures that the system is protected from template attacks.
Smart Images

Figure CN118337366B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of post-quantum information security algorithms, digital signal processing and circuit implementation, and in particular relates to a disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms. Background Art
[0002] In recent years, quantum computers have made rapid progress. To address this issue, in 2016, the National Institute of Standards and Technology (NIST) launched a study on post-quantum cryptography standards and solicited the following two types of post-quantum cryptographic algorithms (Post-Quantum Cryptography, PQC): public key encryption algorithms (including key encapsulation mechanisms) and digital signatures. After three rounds of screening, in July 2022, NIST announced that only four post-quantum cryptographic schemes were successfully shortlisted. Among the collected algorithm categories, lattice-based cryptography (LBC) has advantages in speed and key size. These include three lattice-based post-quantum cryptographic schemes: CRYSTALS-KYBER, CRYSTALS-DILITHIUM (digital signature) and FALCON (digital signature).
[0003] However, physical leakage in practical cryptographic applications, such as timing, power consumption, and electromagnetic radiation, has always been an important concern. Attackers can choose operations related to sensitive data (such as secret keys) as targets. Number Theoretic Transform (NTT) is a basic and common module embedded in CRYSTALS-KYBER, CRYSTALS-DILITHIUM, etc. In addition, secret keys are the input data of NTT-related operations. Therefore, these operations are easily targeted by side channel attacks (SCA).
[0004] In this regard, the present invention provides a random NTT circuit that resists side channel attacks (such as template attacks) by introducing random numbers. Before the NTT circuit works, the random numbers are introduced to scramble the NTT circuit, thereby protecting the NTT circuit. The circuit can bring high security performance improvement by introducing only a small amount of additional hardware resources, and has good application prospects. Summary of the invention
[0005] The technical problem to be solved by the present invention is that, in view of the fact that the existing processors applied to post-quantum cryptographic algorithms cannot effectively resist side channel attacks, a random NTT circuit is provided that can effectively protect against side channel attacks when the post-quantum cryptographic algorithm is operated. The present invention provides a random NTT circuit that resists side channel attacks applied to post-quantum cryptographic algorithms, comprising: a control unit, an operation unit, and a storage unit;
[0006] The storage unit is used to store input data and output data, and transmit the input data and the butterfly unit address to the operation unit;
[0007] The control unit is used to receive a random number, control the storage unit to adjust the operation order of the butterfly unit in the operation unit according to the random number; and control the storage unit to transmit input data to the operation unit;
[0008] The operation unit is used to perform number theory transformation operation on the input data, and transmit the output data to the storage unit, and then use the output data in the storage unit as input data for the next round of number theory transformation operation to perform the next round of number theory transformation operation until all rounds of number theory transformation operation are completed.
[0009] Preferably, the storage unit includes a first memory and a second memory; the input data and the output data are stored in the first memory and the second memory respectively;
[0010] When the input data is stored in the first memory, the output data generated by the input data after a round of number theory transformation operation will be stored in the second memory; the output data in the second memory will be transmitted to the operation unit as the input data for the next round of number theory transformation operation, and the generated output data will be stored in the first memory; this process will be repeated until the operation unit completes all rounds of number theory transformation operations.
[0011] Preferably, the storage unit further includes a third memory, a first selector, a second selector and a third selector; the third memory is used to store butterfly factors and transmit the butterfly factors to the operation unit;
[0012] Among them, the output ends of the first memory and the second memory are connected to the input end of the first selector; the output end of the first selector is connected to the operation unit; the output end of the operation unit is connected to the input ends of the second selector and the third selector; the output ends of the second selector and the third selector are connected to the input ends of the first memory and the second memory; the output end of the third memory is connected to the input end of the operation unit.
[0013] Preferably, the input terminals of the first memory, the second memory, and the third memory are also connected to the control unit for receiving address instructions of the control unit. When the first memory, the second memory, and the third memory transmit the input data and the butterfly factor to the operation unit, the first memory, the second memory, and the third memory also transmit the butterfly unit address data corresponding to the random number to the operation unit to complete the adjustment of the operation order of the butterfly unit in the operation unit.
[0014] Preferably, the selection ends of the first selector, the second selector and the third selector are connected to the control unit, and are used to transmit the input data of the corresponding memory to the operating unit and the output data generated by the operating unit to the corresponding memory according to the selection instruction of the control unit.
[0015] Preferably, the operating unit includes eight rounds of number theory transformers; the operating unit will perform eight rounds of number theory transformer operations to complete a complete operation; the output data of the first round of number theory transformer will become the input data of the second round of number theory transformer; the output data of the second round of number theory transformer will become the input data of the third round of number theory transformer; and this process will be repeated until the operation unit completes a complete operation.
[0016] Preferably, the number theory converter includes 64 groups of butterfly units, each group of butterfly units includes 2 butterfly units; the 128 butterfly units are connected in parallel.
[0017] Preferably, the random number is 10 bits in size, wherein the first 6 bits of the 10-bit random number are used to select an initial group among the 64 groups of butterfly units; the last 4 bits of the 10-bit random number are used to select a butterfly unit that needs to perform calculations in each of 4 groups of 64 groups of butterfly units, starting from the initial group.
[0018] Preferably, the butterfly unit includes a modular multiplier, an adder and a subtractor; the adder input is connected to the storage unit and the modular multiplier output; the subtrahend end of the subtractor is connected to the storage unit, and the subtrahend end is connected to the modular multiplier output; the adder and subtractor outputs are connected to the storage unit; and the modular multiplier input is connected to the storage unit.
[0019] Preferably, the input data includes first input data and second input data; the output data includes first output data and second output data; the adder input is connected to the first input data; the modular multiplier input is connected to the second input data and the butterfly factor; the adder output generates first output data; the subtractor output generates second output data; the first output data generated by this round of number theory transformation operation will be used as the first input data for the next round of number theory transformation operation, and the second output data generated by this round of number theory transformation operation will be used as the second input data for the next round of number theory transformation operation, until eight rounds of number theory transformation operation are completed.
[0020] Implementing the embodiments of the present invention has the following beneficial effects:
[0021] (1) The embodiment of the present invention obtains random numbers through the control unit, and then uses the storage unit to transmit the input data and the butterfly unit address corresponding to the random number to the operation unit, so as to realize the operation of a specific butterfly unit, thereby changing the order of the butterfly units. Finally, the embodiment of the present invention has multiple possibilities after running a complete cycle, thereby achieving resistance to side channel attacks. For example, for 8 rounds of NTT with 256 inputs, there are 2 64*64+3 There are so many possibilities for permutations and combinations, which will greatly improve the security performance of the system and ensure that the system is protected from side channel attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 This is a diagram of the architecture of a random NTT circuit for resisting side channel attacks applied to a post-quantum cryptographic algorithm in the present invention;
[0024] Figure 2 It is a diagram of the operating unit architecture in the disordered NTT circuit for resisting side channel attacks applied to the post-quantum cryptographic algorithm in the present invention;
[0025] Figure 3 This is a diagram of the butterfly unit group architecture in the disordered NTT circuit for resisting side channel attacks applied to the post-quantum cryptographic algorithm in the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0027] like Figure 1 As shown, the embodiment discloses a scrambled NTT circuit for resisting side channel attacks applied to a post-quantum cryptographic algorithm. The scrambled NTT circuit for resisting side channel attacks applied to a post-quantum cryptographic algorithm includes: a control unit 10, an operation unit 30, and a storage unit 20. The storage unit 20 is used to store input data and output data, and transmit the input data and the butterfly unit address to the operation unit 30. The control unit 10 is used to receive a random number (RN), and control the storage unit 20 to adjust the operation order of the butterfly unit in the operation unit 30 according to the random number. The control unit 10 is also used to control the storage unit 20 to transmit the input data to the operation unit 30. The operation unit 30 is used to perform a number theory transformation operation on the input data, and transmit the output data to the storage unit 20, and then use the output data in the storage unit 20 as the input data of the next round of number theory transformation operation to perform the next round of number theory transformation operation until all rounds of number theory transformation operations are completed.
[0028] The control unit 10 has an input connected to the random number, and an output connected to the input of the storage unit 20. The operation unit 30 has an input connected to the output of the storage unit 20, and an output connected to the input of the storage unit 20.
[0029] The storage unit includes a first memory 201, a second memory 202, a third memory 203, a first selector 204, a second selector 205 and a third selector 206. The output ends of the first memory 201 and the second memory 202 are connected to the input end of the first selector 204. The output end of the first selector 204 is connected to the input end of the operation unit 30. The output end of the third memory 203 is connected to the input end of the operation unit 30. The output end of the operation unit 30 is connected to the input end of the second selector 205 and the third selector 206. The output ends of the second selector 205 and the third selector 206 are connected to the input ends of the first memory 201 and the second memory 202. The input ends of the first memory 201, the second memory 202 and the third memory 203 are also connected to the control unit 10. The selection ends of the first selector 204, the second selector 205 and the third selector 206 are connected to the output end of the control unit 10.
[0030] Wherein, the first memory 201 and the second memory 202 are used to store input data and output data. In the disordered NTT circuit for resisting side channel attacks applied to the post-quantum cryptographic algorithm, the output data generated after the first round of number theory transformation operation will be used as the input data of the second round of number theory transformation operation, and so on, until all rounds of number theory transformation operations are completed. Wherein, all input data and output data are stored in the first memory 201 and the second memory 202. The third memory 203 is used to store the butterfly factor (i_wn), and transmit the butterfly factor to the operation unit 30 to operate together with the input data to generate output data. The first selector 204, the second selector 205 and the third selector 206 are used to transmit the input data in the corresponding memory in the first memory 201 and the second memory 202 to the operation unit 30 and the output data generated by the operation unit 30 to the corresponding memory in the first memory 201 and the second memory 202 according to the selection instruction (sel_in, sel_out) of the control unit. Specifically, the first selector 204 is used to select the required data in the first memory 201 and the second memory 202 according to the selection instruction (sel_out) of the control unit 10 and input them into the operation unit 30. The input data includes the first input data (i_a) and the second input data (i_b), and the output data includes the first output data and the second output data. The second selector 205 is used to select the first output data to be transmitted to the first memory 201 or the second memory 202 according to the selection instruction (sel_in) of the control unit 10. The third selector 206 is used to select the second output data to be transmitted to the first memory 201 or the second memory 202 according to the selection instruction (sel_in) of the control unit 10. In the same round of number theory transformation operation, the generated first output data and the second output data will be transmitted to the same memory. Then in the next round of number theory transformation operation, it is selected to the operation unit 30 by the selection instruction (sel_out).
[0031] When the disordered NTT circuit for resisting side channel attacks applied to the post-quantum cryptographic algorithm is running, the control unit 10 will receive a random number (RN) transmitted from the outside, and the control unit will transmit an address instruction (addressbundle) to the first memory 201, the second memory 202, and the third memory 203 in the storage unit 20 according to the random number (RN). The first memory 201 and the second memory 202 will transmit the input data and the butterfly unit address data corresponding to the random number to the first selector 204. The third memory 203 will transmit the butterfly factor (i_wn) to the operation unit 30. The first selector will select the input data in the correct memory according to the selection instruction (sel_out), and transmit the correct input data and the butterfly unit address data corresponding to the random number to the operation unit 30. The butterfly unit address data will cause the butterfly unit corresponding to the random number to run, and complete the adjustment of the running order of the butterfly unit in the operation unit 30. The first output data and the second output data generated by the operation unit 30 will pass through the second selector 205 and the third selector 206 respectively. The second selector 205 and the third selector 206 select the correct memory in the first memory 201 and the second memory 202 according to the selection instruction (sel_in), and store the first output data and the second output data in the memory.
[0032] If the input data in the round of number theory transformation operation is stored in the first memory 201, the output data generated by the input data after one round of number theory transformation operation will be stored in the second memory 202. The output data in the second memory 202 will be transmitted to the operation unit 30 as the input data of the next round of number theory transformation operation to perform the next round of number theory transformation operation, and the generated output data will be stored in the first memory 201. This process is repeated in sequence, and the data output by the operation unit 30 is alternately stored until the operation unit 30 completes all rounds of number theory transformation operations.
[0033] See also Figure 2 , Figure 3In this embodiment, the operation unit 30 includes 8 rounds of number theory transformers 310. The operation unit 30 will perform eight rounds of number theory transformation operations to complete a complete operation. The output data of the first round of number theory transformer 310 will become the input data of the second round of number theory transformer 310, and the output data of the second round of number theory transformer 310 will become the input data of the third round of number theory transformer 310. This process is repeated until the operation unit 30 completes a complete operation. The number theory transformer 310 includes 64 groups of butterfly unit groups 320, and each group of butterfly unit groups 320 includes 2 butterfly units 330. The 128 butterfly units 330 in one round of number theory transformer 310 are connected in parallel and do not affect each other. The random number is 10 bits in size. The first 6 bits of the 10 bits of random number are used to select the initial group of the 64 groups of butterfly units. The first 6 bits of data just cover all options of the 64 butterfly unit groups 320, and the initial group in the 64 butterfly unit groups 320 can be clearly found. The last 4 bits of the 10 bits of random number are used to select the butterfly units that need to be operated in each of the 4 groups of 2 butterfly units 330 in the 64 butterfly unit groups 320, starting from the initial group. The last 4 bits of data are responsible for one group for each 1 bit of data, and the required butterfly unit 330 in each group of 2 butterfly units 330 is selected according to {0,1} in the 1 bit of data, so as to realize the synchronous operation of the 4 butterfly unit groups 320.
[0034] When the one-round number theory transformer 310 is running, the first 10 bits of random number will determine the initial group and the three groups of butterfly unit groups 320 that are postponed, and respectively determine the butterfly unit 330 of each of the four groups. After completing the operation of the four groups of butterfly unit groups 320, the one-round number theory transformer 310 will receive the second 10 bits of random number. The first 6 bits of data of the second 10 bits of random number are the same as the first 6 bits of data of the first 10 bits of random number, and the last 4 bits of data are different. Through the first 6 bits of data of the second 10 bits of random number, the four groups of butterfly unit groups 320 that are postponed from the four groups of butterfly unit groups 320 determined by the first 10 bits of random number will be locked. The last 4 bits of data will select the required butterfly unit 330 in each group of two butterfly units 330, thereby completing the operation of the four groups of butterfly unit groups 320. This process is repeated until all 64 butterfly units 320 have completed their operation and received 16 10-bit random numbers. The starting group is determined by first randomly selecting the first 10-bit random number, and then the next group is selected. The last 4 bits of data of the 16 10-bit random numbers are different to ensure that each group of butterfly units 330 is random. After the eight rounds of number theory transformer 310 are completed, 2 64*64+3There are many possible combinations of permutations. In this case, it is difficult to use template attacks. This greatly improves the security performance of the system, protects the system, and ensures that the system is protected from side channel attacks.
[0035] See also Figure 3 , the butterfly unit 330 includes an adder 301, a subtractor 302 and a modular multiplier 303; the input end of the adder 301 is connected to the storage unit 20 and the output end of the modular multiplier 303, and is used to receive the first input data (i_a) output by the storage unit 20 and the output data of the modular multiplier 303. The subtrahend end of the subtractor 302 is connected to the output end of the storage unit 20, and is used to receive the first input data (i_a) output by the storage unit 20. The subtrahend end of the subtractor 302 is connected to the output end of the modular multiplier 303, and is used to receive the output data of the modular multiplier 303. The output ends of the adder 301 and the subtractor 302 are connected to the storage unit 20. The input end of the modular multiplier 303 is connected to the output end of the storage unit 20, and is used to receive the second input data (i_b) and the butterfly factor (i_wn) output by the storage unit.
[0036] After the butterfly unit 330 is running, the output end of the adder 301 will generate the first output data, i.e., i_a+i_b*i_wn. The output end of the subtractor 302 will generate the second output data, i.e., i_a-i_b*i_wn. The first output data generated by this round of number theory transformation operation will be used as the first input data of the next round of number theory transformation operation, and the second output data generated by this round of number theory transformation operation will be used as the second input data of the next round of number theory transformation operation. This continues until eight rounds of number theory transformation operation are completed, thereby realizing a complete number theory transformation operation.
[0037] In summary, the embodiment of the present invention adjusts the operation order of the butterfly units of the computing unit 30 by introducing random numbers, thereby greatly increasing the number of possible arrangements of the butterfly units of the computing unit 30, thereby achieving resistance to side channel attacks. The additional control resource overhead introduced by the embodiment of the present invention is very small, but it brings a great improvement in security performance, meeting the requirements of low resource overhead and high efficiency.
[0038] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A random NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms, characterized in that: include: Control unit, computing unit and storage unit; The storage unit is used to store input data and output data, and transmit the input data and the butterfly unit address to the operation unit; The control unit is used to receive a random number, control the storage unit to adjust the operation order of the butterfly unit in the operation unit according to the random number; and control the storage unit to transmit input data to the operation unit; The operation unit is used to perform a number theory transformation operation on the input data, and transmit the output data to the storage unit, and then use the output data in the storage unit as input data for the next round of number theory transformation operation to perform the next round of number theory transformation operation until all rounds of number theory transformation operation are completed; The operation unit includes eight rounds of number theory transformers; the operation unit will perform eight rounds of number theory transformer operations after completing a complete operation; the output data of the first round of number theory transformer will become the input data of the second round of number theory transformer; the output data of the second round of number theory transformer will become the input data of the third round of number theory transformer; and this process will be repeated until the operation unit completes a complete operation; The number theory converter includes 64 butterfly unit groups, each butterfly unit group includes 2 butterfly units; 128 butterfly units are connected in parallel; The random number is 10 bits in size, wherein the first 6 bits of the 10 bits of random number are used to select an initial group of the 64 butterfly unit groups; the last 4 bits of the 10 bits of random number are used to select a butterfly unit that needs to perform calculations in each of 2 butterfly units in 4 groups of the 64 butterfly unit groups, starting from the initial group.
2. The disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms according to claim 1 is characterized in that: The storage unit includes a first memory and a second memory; the input data and the output data are stored in the first memory and the second memory respectively; When the input data is stored in the first memory, the output data generated by the input data after a round of number theory transformation operation will be stored in the second memory; the output data in the second memory will be transmitted to the operation unit as the input data for the next round of number theory transformation operation, and the generated output data will be stored in the first memory; this process will be repeated until the operation unit completes all rounds of number theory transformation operations.
3. The disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms according to claim 2 is characterized in that: The storage unit further includes a third memory, a first selector, a second selector and a third selector; the third memory is used to store butterfly factors and transmit the butterfly factors to the operation unit; Among them, the output ends of the first memory and the second memory are connected to the input end of the first selector; the output end of the first selector is connected to the operation unit; the output end of the operation unit is connected to the input ends of the second selector and the third selector; the output ends of the second selector and the third selector are connected to the input ends of the first memory and the second memory; the output end of the third memory is connected to the input end of the operation unit.
4. The disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms according to claim 3 is characterized in that: The input ends of the first memory, the second memory, and the third memory are also connected to the control unit for receiving address instructions from the control unit; when the first memory, the second memory, and the third memory transmit the input data and the butterfly factor to the operation unit, the first memory, the second memory, and the third memory also transmit the butterfly unit address data corresponding to the random number to the operation unit to complete the adjustment of the operating order of the butterfly unit in the operation unit.
5. The disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms according to claim 3 is characterized in that: The selection ends of the first selector, the second selector and the third selector are connected to the control unit, and are used to transmit the input data of the corresponding memory to the operation unit and the output data generated by the operation unit to the corresponding memory according to the selection instruction of the control unit.
6. The disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms according to claim 1, characterized in that: The butterfly unit includes a modular multiplier, an adder and a subtractor; the adder input end is connected to the storage unit and the modular multiplier output end; the subtrahend end of the subtractor is connected to the storage unit, and the subtrahend end is connected to the modular multiplier output end; the adder and subtractor output ends are connected to the storage unit; and the modular multiplier input end is connected to the storage unit.
7. The disordered NTT circuit for resisting side channel attacks applied to post-quantum cryptographic algorithms according to claim 6, characterized in that: The input data includes first input data and second input data; the output data includes first output data and second output data; the adder input is connected to the first input data; the modular multiplier input is connected to the second input data and the butterfly factor; the adder output generates first output data; the subtractor output generates second output data; the first output data generated by this round of number theory transformation operation will be used as the first input data of the next round of number theory transformation operation, and the second output data generated by this round of number theory transformation operation will be used as the second input data of the next round of number theory transformation operation, until eight rounds of number theory transformation operation are completed.
Citation Information
Patent Citations
Low overhead side channel protection for number-theoretical transforms
CN115840936A
