Circuit for preventing FPGA configuration code stream from being attacked by DPA and FPGA comprising circuit
By adding random power consumption interference in the decryption process of the FPGA configuration code stream, and using the operation of true random number and pseudo-random number generators and shift registers, the security threat of the FPGA configuration code stream in DPA attacks is solved, and the Effective protection of code streams.
Patent Information
- Application Number
- CN202410879570.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-11
AI Technical Summary
The FPGA configuration code stream is easily intercepted during the configuration process, leading to security threats. Existing encryption methods such as AES or SM4 can still be deciphered by DPA attacks.
During the decryption process of the FPGA configuration code stream, random power consumption interference is generated through a true random number generator and a pseudo-random number generator, and a shift register is used to perform shift operations and clock signal delay operations, adding random strength and random delay power consumption Interference to prevent DPA attacks.
Effectively prevent DPA attacks, improve the security of FPGA configuration code stream, make it difficult for attackers to identify the decryption process based on power consumption, and enhance the protection of the code stream.
Smart Images

Figure CN118761104A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of integrated circuits, and in particular to a circuit for preventing an FPGA configuration code stream from being attacked by DPA and an FPGA including the circuit. Background Art
[0002] Field Programmable Gate Array (FPGA) is a product further developed on the basis of programmable devices such as PAL and GAL. The logic of FPGA is realized by loading programming data into the internal static storage unit. The value stored in the storage unit determines the logical function of the logic unit and the connection between modules or between modules and I / O, which ultimately determines the functions that FPGA can achieve. During use, the FPGA chip needs to be placed on a special development board and the configuration code stream is downloaded to the chip. However, FPGA based on static memory (SRAM) needs to write the code stream from the outside for configuration. During the configuration process, the code stream can be easily intercepted, which poses a great threat to the security of FPGA chips. Therefore, the encryption of FPGA chips has gradually received attention from designers. Even if there are many encryption methods to prevent the code stream from being decrypted, such as AES (Advanced Encryption Standard) or SM4, it can still be decrypted by other means. DPA attack technology has strong aggressiveness and decryption efficiency. Its principle is that when the chip executes different instructions to perform various operations, the corresponding power consumption also changes accordingly. By using special electronic measuring instruments and mathematical statistical techniques to detect and analyze these changes, specific key information in the chip can be obtained.
[0003] This section is intended to provide a background or context to the embodiments of the present application as recited in the claims. The description herein is not admitted to be prior art as disclosed by virtue of its inclusion in this section. Summary of the invention
[0004] The purpose of the present application is to provide a circuit for preventing an FPGA configuration code stream from being attacked by DPA and an FPGA including the anti-attack circuit, and to add various random power consumption interferences during the decryption process of the FPGA configuration code stream to prevent DPA attacks.
[0005] The present application discloses a circuit for preventing FPGA configuration code stream from being attacked by DPA, comprising: a true random number generator, a pseudo random number generator, a shift register and a control circuit;
[0006] The true random number generator is used to generate a seed to the pseudo random number generator and to generate a first random number and a second random number to the shift register respectively;
[0007] The pseudo-random number generator generates a pseudo-random sequence according to the seed and generates power consumption;
[0008] The shift register performs a shift operation, and / or performs a shift operation with a random shift number according to the first random number to generate power consumption with random intensity during the shifting process of the FPGA configuration code stream data, and / or performs a shift operation with a random clock signal delay according to the second random number to generate power consumption with random delay;
[0009] The control circuit is used to control the pseudo-random number generator and the shift register according to a preset configuration.
[0010] In a preferred example, the control circuit includes a configuration register, in which the preset configuration is stored, and the preset configuration includes whether to turn on power consumption interference, whether to turn on power consumption interference before decryption, whether to turn on random intensity power consumption interference, and whether to turn on random delay power consumption interference.
[0011] In a preferred example, when the preset configuration is to turn on the power consumption interference, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation.
[0012] In a preferred example, when the preset configuration is to turn on power consumption interference before decryption, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a random shift operation according to the first random number at a predetermined time before the start of the FPGA configuration code stream decryption process.
[0013] In a preferred example, when the preset configuration is to turn on the random intensity power consumption interference, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation.
[0014] In a preferred example, when the preset configuration is to turn on the random delay power consumption interference, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation with random clock signal delay.
[0015] In a preferred embodiment, the shift register comprises:
[0016] A plurality of triggers are provided, wherein the plurality of triggers perform the shift operation, wherein the number of the triggers is determined according to the power consumption generated during the decryption process of the FPGA configuration code stream data.
[0017] In a preferred example, the shift register includes a clock delay circuit, and the clock delay circuit includes:
[0018] A plurality of buffers connected in sequence, wherein an input end of a first-stage buffer receives a clock signal;
[0019] A multiplexer, wherein an input end of the multiplexer receives the clock signal and an output end of each buffer respectively, and selects an output value according to the second random number.
[0020] The present application also discloses a field programmable gate array (FPGA), comprising:
[0021] Static random access memory, used to receive and store FPGA configuration code stream;
[0022] a decryption module, configured to receive and decrypt the FPGA configuration code stream from the static random access memory and write the decrypted FPGA configuration code stream back to the static random access memory; and
[0023] As described above, the circuit protects the FPGA configuration code stream from being attacked by DPA.
[0024] In the implementation manner of the present application, during the FPGA configuration code stream decryption process, the pseudo-random number generator generates a pseudo-random sequence and generates power consumption, the shift register performs a shift operation with a random shift number according to a first random number to generate power consumption with random intensity during the FPGA configuration code stream data shift process, and performs a shift operation with a random clock signal delay according to a second random number to generate power consumption with random delay, thereby adding various random power consumption interferences during the decryption process to prevent DPA attacks.
[0025] The specification of the present application records a large number of technical features, which are distributed in various technical solutions. If all possible combinations of technical features of the present application (i.e., technical solutions) are to be listed, the specification will be too long. In order to avoid this problem, the various technical features disclosed in the above-mentioned invention content of the present application, the various technical features disclosed in the various embodiments and examples below, and the various technical features disclosed in the accompanying drawings can be freely combined with each other to form various new technical solutions (these technical solutions should all be regarded as having been recorded in this specification), unless the combination of such technical features is technically infeasible. For example, in one example, feature A+B+C is disclosed, and in another example, feature A+B+D+E is disclosed, and features C and D are equivalent technical means that play the same role. Technically, only one can be used, and it is impossible to use them at the same time. Feature E can be combined with feature C technically. Then, the solution of A+B+C+D should not be regarded as having been recorded because it is technically infeasible, and the solution of A+B+C+E should be regarded as having been recorded. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1It is a schematic diagram of the structure of a circuit for preventing an FPGA configuration code stream from being attacked by DPA according to an embodiment of the present application.
[0027] Figure 2 It is a schematic diagram of the structure of a clock delay circuit according to an embodiment of the present application.
[0028] Figure 3 This is a simplified power consumption diagram of the decryption process according to one embodiment of the present application.
[0029] Figure 4 This is a simplified power consumption diagram of PRBS according to an embodiment of the present application.
[0030] Figure 5 and Figure 6 They are respectively simplified power consumption diagrams of PRBS and decryption process superimposed according to an embodiment of the present application.
[0031] Figure 7 This is a simplified power consumption diagram of a random strength PRBS according to an embodiment of the present application.
[0032] Figure 8 This is a simplified power consumption diagram of the random strength PRBS and the decryption process superimposed in one embodiment of the present application.
[0033] Fig. 9 This is a simplified power consumption diagram of a randomly delayed PRBS according to an embodiment of the present application.
[0034] Fig.10 This is a simplified power consumption diagram of the randomly delayed PRBS and the decryption process superimposed in one embodiment of the present application.
[0035] Fig.11 This is a simplified power consumption diagram of random intensity and random delay PRBS superimposed on the decryption process according to an embodiment of the present application.
[0036] Fig.12 This is a comparison of power consumption before and after turning on random intensity and random delay PRBS in an embodiment of the present application.
[0037] In the accompanying drawings, the symbols are as follows:
[0038] 101: Pseudo-random number generator;
[0039] 102: True random number generator;
[0040] 103: control circuit;
[0041] 104: shift register;
[0042] 201-204: Buffer;
[0043] 205: Multiplexer. DETAILED DESCRIPTION
[0044] In the following description, many technical details are provided to help readers better understand the present application. However, those skilled in the art can understand that the technical solution claimed in the present application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0045] Description of some concepts:
[0046] A Field-Programmable Gate Array (FPGA) is an integrated circuit that consists of a large number of programmable logic cells (CLBs) that can be used to implement various logic functions. FPGAs have complex programmable interconnect networks inside them, through which logic cells can be connected to implement the desired circuit functions. FPGAs contain programmable I / O modules for communicating with external devices. FPGAs also contain various types of storage cells, such as RAM, ROM, etc., for storing data and configuration information. The core advantage of FPGAs lies in their programmability. Using hardware description languages (HDLs) such as VHDL or Verilog, designers can define the desired circuit functions. These descriptions are then converted into configuration files that can be implemented on the FPGA through synthesis tools. Once the configuration files are loaded into the FPGA, the FPGA's logic cells and interconnect networks are configured according to the designer's requirements to implement specific circuit functions.
[0047] Differential Power Analysis (DPA) is a side-channel attack technique used to extract secret information (such as encryption keys) from cryptographic devices. DPA attacks use the power consumption information of the device when performing cryptographic operations to infer the key through statistical analysis and mathematical methods. Attackers usually use high-precision power measurement equipment, such as oscilloscopes, to record the power consumption trajectory of the device when processing different input data.
[0048] A pseudo-random binary sequence (PRBS) generator is a digital circuit that generates a pseudo-random sequence and is widely used in communication systems, digital signal processing, and other applications that require random data. PRBS generators usually use a linear feedback shift register (LFSR) to generate pseudo-random sequences. An LFSR is a circuit consisting of a set of flip-flops (i.e. registers) and a feedback network. Each flip-flop holds a bit, and the whole shifts according to a fixed rule. The feedback network combines the outputs of certain flip-flops through an exclusive-OR (XOR) operation and feeds the result back to the input of the LFSR.
[0049] A True Random Number Generator (TRNG) is a hardware device used to generate unpredictable, non-deterministic random numbers. This type of random number generation relies on physical phenomena rather than deterministic algorithms, so it has higher randomness and unpredictability. TRNG uses unpredictable physical phenomena to generate random numbers. Common physical phenomena include thermal noise, radioactive decay, photoelectric effect, and quantum phenomena. The noise source is the core part of TRNG and is used to generate basic random noise signals. For example, thermal noise can be generated by the motion of hot electrons in a resistor, and quantum noise can be generated by the quantum tunneling effect.
[0050] In order to make the objectives, technical solutions and advantages of the present application more clear, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0051] The first embodiment of the present application relates to a circuit for preventing FPGA configuration code stream from being attacked by DPA, and its structure is as follows: Figure 1 As shown, the structure includes: a pseudo random number generator (PRBS) 101, a true random number generator (TRNG) 102, a shift register (shift_reg) 104 and a control circuit 103. The pseudo random number generator 101 is coupled to the control circuit 103 and the true random number generator 102, respectively, and the shift register 104 is coupled to the control circuit 103 and the true random number generator 102, respectively.
[0052] The true random number generator 102 is used to generate a seed to the pseudo-random number generator 101. The pseudo-random number generator 101 generates a pseudo-random sequence according to the seed, and generates power consumption in the process of generating the pseudo-random sequence. The true random number generator 102 is also used to generate a first random number and a second random number to the shift register 104 respectively. The shift register 104 can perform a shift operation, and / or perform a shift operation with a random shift number according to the first random number to generate power consumption with random intensity during the FPGA configuration code stream data shift process, and / or perform a shift operation with a random clock signal delay according to the second random number to generate power consumption with random delay. The operation of the shift register 104 will be described in more detail below. The power consumption generated by the true random number generator 102 and the shift register 104 can add interference to the power consumption generated by the FPGA configuration code stream decryption process, thereby preventing DPA attacks. The control circuit 103 is used to control the pseudo-random number generator 101 and the shift register 104 according to the preset configuration to control different power consumption generation modes.
[0053] In one embodiment, the control circuit 103 includes a configuration register storing preset configurations, including whether to enable power consumption interference, whether to enable power consumption interference before decryption, whether to enable random intensity power consumption interference, and whether to enable random delay power consumption interference.
[0054] In one embodiment, when the preset configuration is to turn on power consumption interference, the control circuit 103 controls the pseudo-random number generator 101 to generate a pseudo-random sequence and controls the shift register 104 to perform a shift operation. It should be understood that the decryption process of the FPGA configuration code stream includes data shifting and data decryption operations, and the data shifting and data decryption processes can, for example, present a periodic cycle process, and the power consumption generated by the data decryption process is much greater than the data shifting process, so that the power consumption of the data shifting and data decryption processes presents a periodic cycle process. The process of the pseudo-random number generator 101 generating a pseudo-random sequence and the process of the shift register 104 performing a shift operation respectively generate power consumption in the data shifting process, and the power consumption generated is equivalent to the power consumption generated in the data decryption process of the FPGA configuration code stream, so that the total power consumption inside the FPGA during the data shifting and data decryption processes of the FPGA configuration code stream is equivalent, making it difficult for a DPA attacker to identify the decryption process based on the power consumption, thereby preventing DPA attacks.
[0055] In one embodiment, when the preset configuration is to enable power consumption interference before decryption, the control circuit 103 controls the pseudo-random number generator 101 to generate a pseudo-random sequence and controls the shift register 104 to perform a shift operation at a predetermined time before the FPGA configuration code stream decryption process begins. The power consumption interference operation is performed some time before the decryption process begins, making it difficult for a DPA attacker to distinguish the time when the decryption process starts, further preventing DPA attacks.
[0056] In one embodiment, the shift register 104 includes a plurality of triggers (e.g., DFF), and the plurality of triggers perform shift operations to generate power consumption. It should be noted that the number of triggers is determined according to the power consumption generated during the data decryption process of the FPGA configuration code stream. Specifically, in order to achieve the purpose of power consumption interference, it is necessary to make the total power consumption generated during the data shifting process by the pseudo-random number generator 101 generating a pseudo-random sequence and the shift register 104 performing a shift operation be equivalent to the power consumption generated during the data decryption process of the FPGA configuration code stream. For a specific FPGA, the power consumption generated by its configuration code stream during the data decryption process is relatively fixed, and the power consumption generated by the pseudo-random number generator 101 is determined according to the type it adopts, so that the shift register can be designed as needed, that is, the number of triggers therein is determined according to the power consumption generated as needed. Among them, the power consumption generated during the data decryption process of the FPGA configuration code stream can be known by measurement.
[0057] In the embodiment of the present application, the power consumption of the two may be equal, or the difference between the two may be within a preset range.
[0058] In one embodiment, when the preset configuration is to enable random intensity power consumption interference, the control circuit 103 controls the pseudo-random number generator 101 to generate a pseudo-random sequence and controls the shift register 104 to perform a shift operation with a random shift number according to a first random number. That is, when the power consumption interference or the power consumption interference before decryption is enabled, the random intensity power consumption interference can be further enabled, that is, when the shift register 104 performs a shift operation, a shift operation with a random shift number is performed according to the first random number, so that the power consumption generated by the shift register 104 has a certain period but the intensity generated each time is random, so that the total power consumption inside the FPGA during the data shifting and data decryption process of the FPGA configuration code stream is not basically maintained unchanged, but the intensity changes randomly, making it more difficult for a DPA attacker to identify the decryption process based on the power consumption, thereby preventing DPA attacks.
[0059] In one embodiment, when the preset configuration is to enable random delay power consumption interference, the control circuit 103 controls the pseudo-random number generator 101 to generate a pseudo-random sequence and controls the shift register 104 to perform a shift operation with a random clock signal delay. That is, when the power consumption interference or the power consumption interference before decryption is enabled, the random delay power consumption interference can be further enabled, that is, when the shift register 104 performs a shift operation, the clock signal is randomly delayed according to the second random number, so that the power consumption generated by the shift register 104 has the same intensity but has no fixed period, so that the total power consumption inside the FPGA during the data shifting and data decryption of the FPGA configuration code stream does not show periodic changes, but randomly changes, making it more difficult for DPA attackers to identify the decryption process based on power consumption, thereby preventing DPA attacks.
[0060] It should be understood that when power consumption interference or pre-decryption power consumption interference is turned on, random intensity power consumption interference and random delay power consumption interference can also be turned on at the same time, so that the total power consumption intensity and time inside the FPGA during the data shifting and data decryption of the FPGA configuration code stream are randomly changed, thereby more completely hiding the time of the data shifting and data decryption operations of the FPGA configuration code stream and preventing DPA attacks.
[0061] In one embodiment, the shift register 104 includes a clock delay circuit, which includes: a plurality of buffers connected in sequence and a multiplexer. The input end of the first-stage buffer in the plurality of buffers connected in sequence receives the clock signal CLK. The input end of the multiplexer receives the clock signal and the output end of each buffer respectively, and selects an output value according to the second random number.
[0062] Figure 2 The schematic diagram of a clock delay circuit in an embodiment is shown, which includes four buffers 201, 202, 203, 204 and a multiplexer 205. The four buffers 201, 202, 203, 204 are connected in stages, and the output end of each of the four buffers 201, 202, 203, 204 is connected to the input of the multiplexer 205. The input end of the first-stage buffer 201 and the input end of the multiplexer 205 are connected to the clock signal CLK. The multiplexer 205 selects the clock signal CLK or the clock signal after any buffer delay according to the second random number to output the delayed clock signal CLK_buff, so as to perform a random shift operation of the clock signal delay and generate random delayed power consumption. It should be noted that the number of buffers is not limited to 4, and it can be set according to actual needs to achieve different clock delays.
[0063] In order to better understand the technical solution of the present application, a specific example is provided below for illustration. The details listed in the example are mainly for ease of understanding and are not intended to limit the scope of protection of the present application.
[0064] The present invention mainly interferes with the power consumption generated during the decryption process through TRNG and PRBS, protecting the customer's design (i.e., the FPGA configuration code stream stored in the SRAM in the FPGA) from being decrypted by attackers, thereby improving security. TRNG provides SEED to PRBS. The specific architecture is as follows Figure 1 shown.
[0065] During the decryption process of the FPGA configuration code stream, there is a significant difference in the power consumption generated during data shifting and data decryption. The power consumption diagram of the decryption process can be simplified as follows: Figure 3 As shown, the power consumption of data shifting process is low, and the power consumption of data decryption process is high. When attacked by DPA, it is easy to be deciphered by the attacker.
[0066] The configuration code stream encryption and decryption adopts AES256 mode, PRBS can adopt PRBS31 parallel structure (not limited to PRBS31), and 64 additional triggers (that is, the number of triggers in the shift register, such as DFF) are added. When the data is shifted, the shift operation is performed, and the shift is performed on the falling edge of the clock, which increases the power consumption when the data is shifted, causing power consumption interference. At this time, the power consumption diagram can be simplified as follows: Figure 4 As shown in the figure below, PRBS refers to the total power consumption generated by PRBS and shift register. The number of DFFs can be matched according to the power consumption during decryption. The superposition of the two can cause power consumption interference. The superimposed power consumption diagram can be simplified as follows: Figure 5 and Figure 6 shown.
[0067] In order to improve security, TRNG is used to generate random numbers x. Using random numbers x, the power consumption generated by PRBS can be randomly processed. At this time, when the data is shifted, the power consumption generated is random intensity, which enhances the interference to the power consumption. At this time, the power consumption diagram can be simplified to Figure 7 After superposition, the power consumption diagram can be simplified to Figure 8 shown.
[0068] Experienced PDA attackers will analyze the power consumption regularly according to the clock cycle used for data decryption, so as to achieve the purpose of decryption. To this end, the present application designs a circuit with random clock delay (such as Figure 2 As shown in the figure, a TRNG is used to generate a random number y. By using the random number y, the randomness of the PRBS power generation time can be increased. At this time, the power consumption diagram generated by the PRBS can be simplified as follows: Fig. 9 After superposition, the power consumption diagram can be simplified to Fig.10 shown.
[0069] At the same time, random intensity and random delay are performed, and the power consumption diagram after superposition can be simplified to Fig.11 The actual effect is shown in Fig.12 shown.
[0070] In addition, before decryption, PRBS has been used to interfere with power consumption, such as Fig.12 As shown in the dotted box, in order to prevent the attacker from determining when to start decryption, control whether PRBS is turned on, and the corresponding options of the PRBS setting register can be set by instructions + registers. The details are shown in Table 1 below:
[0071]
[0072] The embodiments of the present application also disclose a field programmable gate array (FPGA), including: a static random access memory, a decryption module, and a circuit for preventing the FPGA configuration code stream from being attacked by DPA as described above. The static random access memory is used to receive and store the FPGA configuration code stream. The decryption module is used to receive and decrypt the FPGA configuration code stream from the static random access memory and write the decrypted FPGA configuration code stream back to the static random access memory. The decryption process includes data shifting and data decryption operations. The anti-DPA attack circuit is used to generate random power consumption during the data shifting process, making it difficult for a DPA attacker to identify the decryption process based on the power consumption, thereby preventing DPA attacks.
[0073] The first implementation manner is a method implementation manner corresponding to the present implementation manner. The technical details in the first implementation manner can be applied to the present implementation manner, and the technical details in the present implementation manner can also be applied to the first implementation manner.
[0074] It should be noted that in the application documents of this patent, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements. In the application documents of this patent, if it is mentioned that an action is performed according to an element, it means that the action is performed at least according to the element, which includes two situations: performing the action only according to the element, and performing the action according to the element and other elements. Expressions such as multiple, multiple, and multiple include 2, 2 times, 2 kinds, and more than 2, more than 2 times, and more than 2 kinds.
[0075] The term "coupled to" and its derivatives may be used herein. "Coupled" may mean that two or more elements are in direct physical or electrical contact. However, "coupled" may also mean that two or more elements are in indirect contact with each other, but still cooperate or interact with each other, and may mean that one or more other elements are coupled or connected between the elements referred to as being coupled to each other.
[0076] This specification includes combinations of the various embodiments described herein. Individual references to an embodiment (e.g., "one embodiment" or "some embodiments" or "preferred embodiments") do not necessarily refer to the same embodiment; however, these embodiments are not mutually exclusive unless indicated as mutually exclusive or it is clear to a person skilled in the art that they are mutually exclusive. It should be noted that the word "or" is used in this specification in a non-exclusive sense unless the context clearly indicates or requires otherwise.
[0077] All documents mentioned in this specification are considered to be included in the disclosure of this application as a whole, so that they can be used as a basis for modification when necessary. In addition, it should be understood that the above is only a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification should be included in the scope of protection of one or more embodiments of this specification.
Claims
1. A circuit to prevent FPGA configuration code stream from being attacked by DPA, It is characterized in that include: True random number generator, pseudo random number generator, shift register and control circuit; The true random number generator is used to generate a seed to the pseudo random number generator and to generate a first random number and a second random number to the shift register respectively; The pseudo-random number generator generates a pseudo-random sequence according to the seed and generates power consumption; The shift register performs a shift operation, and / or performs a shift operation with a random shift number according to the first random number to generate power consumption with random intensity during the shifting process of the FPGA configuration code stream data, and / or performs a shift operation with a random clock signal delay according to the second random number to generate power consumption with random delay; The control circuit is used to control the pseudo-random number generator and the shift register according to a preset configuration.
2. The circuit as claimed in claim 1, It is characterized in that The control circuit includes a configuration register, in which the preset configuration is stored. The preset configuration includes whether to enable power consumption interference, whether to enable power consumption interference before decryption, whether to enable random intensity power consumption interference, and whether to enable random delay power consumption interference.
3. The circuit as claimed in claim 2, It is characterized in that When the preset configuration is to enable power consumption interference, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation.
4. The circuit as claimed in claim 3, It is characterized in that When the preset configuration is to enable power consumption interference before decryption, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation at a predetermined time before the FPGA configuration code stream decryption process begins.
5. A circuit as claimed in claim 3 or 4, It is characterized in that When the preset configuration is to turn on the random intensity power consumption interference, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation with a random shift number according to the first random number.
6. A circuit as claimed in claim 3 or 4, It is characterized in that When the preset configuration is to enable random delay power consumption interference, the control circuit controls the pseudo-random number generator to generate a pseudo-random sequence and controls the shift register to perform a shift operation with random clock signal delay.
7. The circuit as claimed in claim 1, It is characterized in that The shift register comprises: A plurality of triggers are provided, wherein the plurality of triggers perform the shift operation, wherein the number of the triggers is determined according to the power consumption generated during the decryption process of the FPGA configuration code stream data.
8. The circuit as claimed in claim 1, It is characterized in that The shift register includes a clock delay circuit, and the clock delay circuit includes: A plurality of buffers connected in sequence, wherein an input end of a first-stage buffer receives a clock signal; A multiplexer, wherein an input end of the multiplexer receives the clock signal and an output end of each buffer respectively, and selects an output value according to the second random number.
9. A field programmable gate array (FPGA), It is characterized in that include: Static random access memory, used to receive and store FPGA configuration code stream; A decryption module, used for receiving and decrypting the FPGA configuration code stream from the static random access memory and writing the decrypted FPGA configuration code stream back to the static random access memory; as well as A circuit for preventing an FPGA configuration code stream from being attacked by DPA as claimed in any one of claims 1 to 8.
