Chip protection device and method
Through the combination of control module, excitation generation module and detection module, unpredictable excitation signals are generated for multiple detections, solving the problem of high false alarm rates in the prior art, realizing more accurate error judgments and effective chip protection. Reduced the error rate of protective measures.
Patent Information
- Application Number
- CN202411131470.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-18
- Publication Date
- 2024-12-10
AI Technical Summary
When the detection chip is attacked by micro-detection, the false alarm rate is high and the hardware implementation is unknown, which fails to effectively reduce the error rate of output protection measures.
Using a combination of control module, excitation generation module and detection module, by generating random numbers and data enhancement, unpredictable excitation signals are generated, feedback signals of chip protection lines are detected multiple times, error conditions are recorded, and corresponding outputs are output according to the error conditions. Protective measures directive.
It effectively reduces the error rate of output protection measures, improves the accuracy of judgment errors, and ensures that instructions to self-destruct or destroy internal sensitive information are output only when the accumulated errors reach the threshold, preventing irreversible damage caused by misjudgment.
Smart Images

Figure CN119106456A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a chip protection device and method, belonging to the technical field of chip detection. Background Art
[0002] For chip-level protection, the main focus is on micro-probing attacks, that is, attackers use microscopic needles to probe the internal wires of the chip to obtain important sensitive information inside. At the beginning of chip product design, it is necessary to fully consider the security of internal chip data, protect the chip from attacks to the greatest extent, and have corresponding protection mechanisms when attacked.
[0003] At present, one of the solutions to the above attacks is to add metal wire detection on the top layer. When the chip is attacked by micro-probing, the metal wires on the top layer will be damaged. The protection detection system will detect the damage and issue an alarm of the corresponding level, notifying the chip control module to make an error record of the attack, or perform a shutdown reset, or destroy sensitive information and other protection measures. The false alarm rate is not taken into account and the hardware feasibility is unclear. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a chip protection device and method, which can reduce the error rate of outputting protective measures when detecting chip damage from the perspective of feasibility.
[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions:
[0006] In a first aspect, the present invention provides a chip protection device, including a control module, an excitation generation module and a detection module;
[0007] The excitation generation module is used to generate an excitation signal according to the random number generated by the control module, and transmit the excitation signal to the detection module and multiple protection lines of the chip protection layer respectively;
[0008] The detection module is used to receive the excitation feedback signals output by the multiple protection lines multiple times according to the preset detection times configured by the control module, and compare the excitation feedback signals with the corresponding excitation signals to obtain multiple detection results;
[0009] The control module is used to record error conditions according to multiple detection results, or to record error conditions according to multiple detection results and output corresponding protective measures instructions according to the error conditions.
[0010] In combination with the device of the first aspect, in an optional chip protection device, the excitation generation module is specifically used to: perform data enhancement on the random number generated by the control module to obtain enhanced data; perform data validity detection on the enhanced data: if the data validity detection is qualified, generate an excitation signal using the enhanced data; otherwise, feed back a random number update failure signal to the control module;
[0011] or,
[0012] The incentive generation module is specifically used for:
[0013] The random number generated by the control module is subjected to a random n-bit XOR operation to generate a new random number, and the new random number is subjected to an all-0 detection: if the new random number is a value other than all-0, an excitation signal is generated using the new random number; if the new random number is a value of all-0, a random number update failure signal is fed back to the control module; wherein the random number is a binary number, and the positive integer n is not greater than the length of the binary random number; the random n-bit XOR operation includes: generating a mask with n random positions, wherein the values at the n random positions are 1, and the values at the other positions are 0, and performing an XOR operation on the mask and the random number.
[0014] The excitation signal can be a signal source of random numbers that have been processed by changes. The excitation generation module further processes the received random numbers and outputs an excitation signal with unpredictable changes, which can more accurately detect whether it is under attack. The XOR method makes the generated data more difficult to predict. The value of XOR cannot be all 0 data, so a check for all 0 data is performed, because the data of all 0 data will not change when doing XOR operation, and it is 0.
[0015] The control module updates the random value, which can be updated periodically or in real time. For example, after the detection of the chip protection device of the present invention begins, when the detection module receives the excitation signal transmitted by the excitation generation module, the control module updates the random number and transmits the random number to the excitation generation module.
[0016] In combination with the device of the first aspect, an optional chip protection device, wherein the detection module is specifically used for:
[0017] comparing the excitation feedback signal with the excitation signal after a preset delay, wherein the preset delay is the longest transmission time of the excitation signal through each protection line;
[0018] The preset delay is configured or reconfigured by the control module, and the timing method includes chip working clock counting delay.
[0019] In combination with the device of the first aspect or the third device described above, in an optional chip protection device, the detection module is specifically used for:
[0020] If the excitation feedback signal is the same as the excitation signal, the detection result is correct; if the excitation feedback signal is different from the excitation signal, the detection result is wrong, in response to the detection result being wrong, the error degree is determined, the next detection is performed or the detection is stopped according to the error degree, and the error condition is fed back to the control module; wherein the error condition includes the error content and the number of errors;
[0021] The performing the next detection or stopping the detection according to the error degree includes:
[0022] Determine whether the current number of detections has reached the preset number of detections: if the current number of detections has not reached the preset number of detections, perform the next detection; if the current number of detections has reached the preset number of detections, stop the detection and determine whether the current cumulative number of errors has reached the preset error threshold;
[0023] or,
[0024] The next detection or stopping the detection according to the error degree includes:
[0025] Determine whether the current number of detections has reached the preset number of detections. If the current number of detections has not reached the preset number of detections, determine whether the current cumulative number of errors has reached the preset error threshold. If the current cumulative number of errors has not reached the error threshold, perform the next detection. If the current cumulative number of errors has reached the error threshold or the current number of detections has reached the preset number of detections, stop the detection.
[0026] In combination with the fourth device described above, an optional chip protection device is provided.
[0027] The determining whether the current number of detections reaches the preset number of detections includes:
[0028] Obtain a test result, subtract 1 from the preset test number, and determine whether the preset test number is 0. If it is 0, it is determined that the preset test number has been reached; if not, it is determined that the preset test number has not been reached;
[0029] The step of determining whether the current cumulative number of errors reaches a preset error threshold comprises:
[0030] The initial value of the number of errors is 0, the detection result is wrong, and a detection failure pre-alarm signal is generated as the error content. The number of errors is increased by 1. If the number of errors is greater than the error threshold, the detection is judged to have failed, and a detection failure signal is generated as the error content.
[0031] In combination with the fourth device described above, an optional chip protection device, the control module is configured as a chip control module, or the control module is configured to communicate with the chip control module; the protection measures instructions include executing shutdown instructions, reset instructions, error shielding instructions and self-destruct chip or destroy internal sensitive information instructions; the error shielding instructions include: working state jump failure shielding, random number update failure shielding, detection failure pre-alarm shielding and detection failure shielding;
[0032] The error condition also includes a protection circuit where an error in the detection result occurs;
[0033] The control module outputs corresponding protective measures instructions according to the error situation, including:
[0034] The only error situation is: when the error content is detection failure, the control module outputs a self-destruct chip or destroys internal sensitive information instruction.
[0035] In combination with the device of the first aspect, an optional chip protection device further includes:
[0036] An interface configuration module, used to receive configuration information of the control module, output the configuration information to the state control module, receive output information of the state control module, and feed back the output information of the state control module to the control module;
[0037] The state control module is used to receive the configuration information output by the interface configuration module, output the corresponding configuration information to the stimulus generation module and the detection module respectively, receive the output information of the detection module, and feed back the output information of the detection module to the interface configuration module.
[0038] In combination with the device of the first aspect, optionally, a chip protection device, the excitation generation module includes an excitation signal output terminal, the excitation signal output terminal is used to output the excitation signal generated by the excitation generation module, the detection module includes an excitation signal receiving terminal, the excitation signal receiving terminal is used to receive the excitation signal output by the excitation generation module, and the excitation signal output terminal is connected to the excitation signal receiving terminal during layout wiring;
[0039] The protection lines are arranged in parallel and looped back to cover the entire area in an S-shaped wiring manner. When the line length exceeds the standard or encounters a chip boundary, a BUFFER is inserted into the bottom layer of the chip.
[0040] Inserting the BUFFER can ensure the driving capability of the excitation signal transmission. The line length standard is determined according to the simulation situation. If the line length exceeds the line length standard determined by the simulation situation, it is regarded as exceeding the standard.
[0041] In combination with the aforementioned fourth device, an optional chip protection device, the detection module adopts state machine control to realize the detection and proofreading function, and the detection module also feeds back module working status information to the control module, and the module working status information is used to indicate the current working status of the state machine; the error content includes a working status jump failure, and when the state machine working status jump fails, the detection module outputs a working status jump failure signal to the control module.
[0042] In a second aspect, the present invention provides a chip protection method based on the chip protection device of the first aspect, comprising:
[0043] generating an excitation signal according to the received random number, and sending the excitation signal to a plurality of protection lines of the chip protection layer;
[0044] According to a preconfigured preset number of detections, multiple times of receiving the excitation feedback signals output by the multiple protection lines, and comparing the excitation feedback signals with the corresponding excitation signals to obtain multiple detection results;
[0045] The error conditions are recorded according to multiple detection results, or the error conditions are recorded according to multiple detection results and corresponding protective measures instructions are output according to the error conditions.
[0046] Beneficial effects:
[0047] The present invention is provided with a control module, an excitation generation module and a detection module. The control module determines whether to output a protective measure instruction according to multiple detection results of the detection module, thereby effectively reducing the error rate of outputting protective measures.
[0048] The excitation generation module of the present invention receives the random number output by the control module, and transmits the excitation signal generated by the random number to the detection module and multiple protection circuits. The detection module receives the excitation feedback signals output by the multiple protection circuits, and compares the multiple excitation feedback signals with the excitation signal respectively, obtains multiple detection results, and feeds back the detection results to the control module. The control module receives the multiple detection results of the detection module and decides whether to make only the error condition record, or to make the error condition record and output the corresponding protection measure instruction according to the error condition record.
[0049] The excitation signal can be a signal source of random numbers that have been processed by changes. The excitation generation module further processes the received random numbers and outputs an excitation signal with unpredictable changes, which can more accurately detect whether it is under attack. The control module configures the detection time and the preset number of detections. The detection module determines the degree of error based on multiple detection results, effectively improving the accuracy of judging the degree of error.
[0050] Judging the error degree includes judging the range of the current detection times and the current cumulative error times. When a detection error occurs, it means that the chip may be damaged. Only when the cumulative error times reach the preset error threshold can it be determined that the chip is damaged. Therefore, the error degree can reflect the degree of damage to the chip caused by the attack.
[0051] During the detection process, the detection module can obtain the error situation consisting of the error content and the number of errors, as well as the module working status information of the detection module itself. The detection module feeds back the error situation and the module working status information to the control module, so that the control module can make a timely record of the error situation, which is the error content and the number of errors. The control module can timely and accurately understand the detection situation and working status of the detection module through the feedback information of the detection module.
[0052] The degree of error can reflect the degree of attack and damage to the chip. Different degrees of attack and damage correspond to different protective measures, that is, different degrees of error correspond to different protective measures. Only when the error degree reaches the level that determines that the chip is damaged, the control module outputs instructions to self-destruct the chip or destroy internal sensitive information. This effectively prevents the control module from misjudging and causing irreversible damage to the chip.
[0053] When an error situation requires the output of protective measures, the control module can output a variety of protective measures instructions corresponding to different error situations. The protective measures instructions configured by the control module can select one or more of shutdown instructions, reset instructions, error shielding instructions, and self-destruction chips or internal sensitive information destruction instructions.
[0054] The error condition also includes the error occurrence location of the detection result, and the control module can read the error occurrence protection circuit location, error content and configuration information. The present invention combines software and hardware, takes layout implementation into consideration, and improves the chip protection strength without increasing the complexity and difficulty of the original chip protected circuit design, increases the difficulty of physical layer attack on the chip, and can be actually applied and implemented in chip design engineering.
[0055] The chip protection provided by the present invention has a whole process of specific monitoring, detection, resistance and response, so that the initial working value can be configured, the working status can be queried, and in the face of different abnormal situations, there are a variety of abnormal situation software and hardware processing processes to choose from; using a relatively economical and reliable method, the chip protection function is effectively and simply achieved, and the protection of the chip at the physical level is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is an overall framework diagram of a chip protection device in one embodiment of the present invention;
[0057] Figure 2 is a schematic diagram of an interface configuration module in an embodiment of the present invention;
[0058] Figure 3 is a schematic diagram of a state control module in an embodiment of the present invention;
[0059] Figure 4 is a schematic diagram of the stimulus generation and detection process in one embodiment of the present invention;
[0060] Figure 5 is a schematic diagram of a detection module state jump in an embodiment of the present invention;
[0061] Figure 6 It is a schematic diagram of a layout implementation of the present invention in one embodiment. DETAILED DESCRIPTION
[0062] It should be noted that: the technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.
[0063] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0064] Embodiment 1:
[0065] Figure 1 This is an overall framework diagram of an embodiment of the chip protection device of the present invention. This flowchart only shows the logical sequence of the method described in this embodiment. Under the premise of no conflict, in other possible embodiments of the present invention, different Figure 1 The steps shown or described are accomplished in the order shown.
[0066] refer to Figure 1 As shown, this embodiment introduces a chip protection device, including a control module, an excitation generation module and a detection module;
[0067] The excitation generation module is used to generate an excitation signal according to the random number generated by the control module, and transmit the excitation signal to the detection module and multiple protection lines of the chip protection layer respectively;
[0068] The detection module is used to receive the excitation feedback signals output by the multiple protection lines multiple times according to the preset detection times configured by the control module, and compare the excitation feedback signals with the corresponding excitation signals to obtain multiple detection results;
[0069] The control module is used to record error conditions according to multiple detection results, or to record error conditions according to multiple detection results and output corresponding protective measures instructions according to the error conditions.
[0070] This embodiment sets up a control module, an excitation generation module and a detection module. The control module decides whether to output a protection measure instruction according to multiple detection results of the detection module, thereby effectively reducing the error rate of outputting protection measures when detecting whether the chip is attacked.
[0071] Embodiment 2
[0072] This embodiment is based on the inventive concept of the first embodiment, and uses a modular design concept to further refine the implementation conditions of the invention in the actual engineering field of software and hardware, including: control module configuration information to the implementation form of each module, module specific functions and layout implementation status.
[0073] 1. Implementation of control module configuration information to each module
[0074] The chip protection device also includes an interface configuration module and a state control module, refer to Figure 1 As shown:
[0075] An interface configuration module, used to receive configuration information of the control module, output the configuration information to the state control module, receive output information of the state control module, and feed back the output information of the state control module to the control module;
[0076] The state control module is used to receive the configuration information output by the interface configuration module, output the corresponding configuration information to the stimulus generation module and the detection module respectively, receive the output information of the detection module, and feed back the output information of the detection module to the interface configuration module.
[0077] The control module configures, queries or receives information through the interface configuration module. The interface configuration module transmits the configuration information to the state control module and receives feedback information from the state control module. The state control module classifies the received configuration information and transmits it to the stimulus generation module and the detection module respectively, and receives feedback information from the detection module.
[0078] 2. Module Specific Functions
[0079] 1. Interface configuration module
[0080] In some embodiments, the information configured, queried or received by the control module is the initialization and output information of the chip protection device. The initialization information is the configuration information transmitted by the control module to each module, and the output information is the error condition and module working status information. When using the interface configuration module to realize the transmission of this information, refer to Figure 2 As shown, the interface configuration module needs to store relevant information content, wherein the optional work initialization information content refers to Table 1 below, and the optional output information content refers to Table 2 below. All reference configurations in the table can be read or written by the control module. The configuration information content in Tables 1 and 2 below is only an implementation form of the present invention and should not be regarded as a limitation of the present invention. In specific implementation, part or all of the information in the table can be selected or related information can be added according to engineering needs.
[0081] Table 1 Interface configuration module initialization information
[0082]
[0083] In Table 1, signal 1 is the i_en module enable signal, which is used to control the enable of the module. The reference configuration is 1 or 0. When the i_en output is 1, it means that the module is in operation. At this time, signals 2-4 and 6 in the table operate according to the existing configuration; when the i_en output is 0, it means that the module is not in operation. At this time, signals 2-6 in the table can change the configuration information.
[0084] Signal 2 is the i_wait_time preset delay signal, which is used to configure the preset delay. The counting delay method is adopted, and the chip working clock counting delay or the program instruction cycle counting delay can be adopted. Table 1 adopts the chip working clock counting delay. The specific configuration value can be set after calculation according to the selected chip working frequency. When the i_wait_time configuration value remains unchanged, when the chip working frequency is high, the preset delay is short; when the chip working frequency is low, the preset delay is long. The appropriate i_wait_time value can be configured according to actual needs, so that the preset delay is the transmission time of the signal through the chip protection layer. When the chip protection layer contains multiple protection lines, the preset delay is the longest transmission time of the signal through each of the protection lines.
[0085] Signal 3 is the i_comp_time preset detection times signal, which is used to configure the preset detection times, indicating the preset total detection times. Completing one excitation comparison is considered as completing one detection. The specific configuration of the preset detection times can be changed by the control module according to the actual needs of the project. In one embodiment, the i_comp_time preset detection times is preset to 1000.
[0086] Signal 4 is the i_mis_thld error threshold signal, which is used to configure the error threshold, which is used to determine the range of the cumulative number of errors. The specific configuration of the error threshold can be changed by the control module according to the actual needs of the project. In one embodiment, the i_mis_thld error threshold is preset to 100.
[0087] Signal 5 is the i_lfsr random number update signal, which is used to transmit the random number updated by the control module. The configuration signal of this signal is not affected by the signal 1 enable signal and can be configured at any time according to the instruction of the control module.
[0088] Signal 6 is i_irq_mask[3:0], which is a mask error signal. It has four working modes and is used to execute the mask error instruction of the control module. Different mask contents are executed according to different configuration information of the control module. When the configuration information is 1, masking is executed, and when the configuration information is 0, masking is not executed. Specifically, working mode 1 is IRQ_MSK[0], which is used to configure the working state jump failure shield. When the shielding of this working mode is executed, if a working state jump failure signal is received, the failure signal is ignored and the operation continues; working mode 2 is IRQ_MSK[1], which is used to configure the random number update failure shield. When the shielding of this working mode is executed, if a random number update failure signal is received, the failure signal is ignored and the operation continues; working mode 3 is IRQ_MSK[2], which is used to configure the detection failure pre-alarm shield. When the shielding of this working mode is executed, if a detection failure pre-alarm signal is received, the pre-alarm signal is ignored and the operation continues; working mode 4 is IRQ_MSK[3], which is used to configure the detection failure shield. When the shielding of this working mode is executed, if a detection failure signal is received, the failure signal is ignored and the operation continues.
[0089] Signal 6 shielding error signal is generally used for device system debugging. Setting different working modes is convenient for checking the debugging effect. These 4 shielding working modes are executed independently. You can perform shielding of one working mode or several working modes at the same time. However, the detection failure signal is generally not shielded, so the reference configuration information of working mode 4 detection failure shielding is 0.
[0090] Table 2 Interface configuration module output information
[0091]
[0092] The error conditions and module working status information of the present invention are displayed through the signals in Table 2, wherein signal 1 represents the module working status information, and signals 2-7 represent error conditions, the error conditions include error content and error times, the error content includes working status jump failure, random number update failure, detection failure pre-alarm, and detection failure, and the error conditions can be displayed as one or more contents of signals 2-7 according to the control module requirements and actual detection conditions.
[0093] In Table 2, signal 1 is the o_state module working state information signal, which is used to display the module working state information, and is convenient for debugging and monitoring the device according to the working state of the module. When the detection module adopts state machine control to realize the detection and proofreading function, the module working state information output is the current working state of the state machine, and the state machine can set different serial numbers for each working state, and o_state is displayed as the serial number of the current working state of the state machine.
[0094] Signal 2 is the o_fsm_err working state jump failure signal. When the detection module adopts state machine control to realize the detection and proofreading function, and the state machine working state jump fails, it is used to output the working state jump failure signal.
[0095] Signal 3 is the o_lfsr_err random number update failure signal, which is used to indicate that the random number update has failed. This signal is output when the updated random number fails the test.
[0096] Signal 4 is the o_mismatch detection failure pre-alarm signal, which is used to indicate a detection failure pre-alarm. This signal is output when an error occurs in the detection result. It is generally used to indicate that an error occurs in the detection result but the detection has not yet failed.
[0097] Signal 5 is the o_mis_cnt error count signal, which is used to indicate the current cumulative error count. The initial value of the error count is 0. If the detection result is wrong, the error count increases by 1.
[0098] Signal 6 is the o_fail detection failure signal, which is used to indicate detection failure. When the detection result error reaches the detection failure standard, this signal is output.
[0099] Signal 7 is the o_mismatch_ind detection result error occurrence location signal, which is used to indicate the detection result error location. The detection result error location is the protection circuit where the detection result error occurs. When there are multiple chips and multiple protection circuits, a unique number is set for each protection circuit. The detection result error occurrence location signal can be displayed as the protection circuit number where the detection result error occurs.
[0100] 2. State control module
[0101] refer to Figure 1 As shown, the state control module receives the configuration information of the interface configuration module and transmits the configuration information to the stimulus generation module and the detection module respectively. Figure 3 In one embodiment shown, the output information of the detection module received by the state control module includes seven signals, and three signals are fed back to the interface configuration module, but it does not mean that each state control module needs to receive seven signals each time it transmits. When three signals are transmitted, the corresponding receiving program can be executed according to the instructions of the control module. Figure 3 Among the output signals in the output, o_err and o_fail are signals of output error conditions. Figure 3 When seven signals are shown, the o_err signal may include five signal contents except the o_fail and o_state signals, and may also output one or more signal contents of the five signals according to the control module instruction.
[0102] 3. Incentive generation module
[0103] Combination Figure 1 and Figure 4 As shown, the excitation generation module receives the configuration information of the state control module to update the random number signal, receives the random number output by the control module, and generates an excitation signal according to the received random number. The excitation generation module is specifically used to: perform data enhancement on the random number generated by the control module to obtain enhanced data; perform data validity detection on the enhanced data: if the data validity detection is qualified, generate an excitation signal using the enhanced data; otherwise, feed back a random number update failure signal to the control module;
[0104] or,
[0105] The incentive generation module is specifically used for:
[0106] The random number generated by the control module is subjected to a random n-bit XOR operation to generate a new random number, and the new random number is subjected to an all-0 detection: if the new random number is a value other than all-0, an excitation signal is generated using the new random number; if the new random number is a value of all-0, a random number update failure signal is fed back to the control module; wherein the random number is a binary number, and the positive integer n is not greater than the length of the binary random number; the random n-bit XOR operation includes: generating a mask with n random positions, wherein the values at the n random positions are 1, and the values at the other positions are 0, and performing an XOR operation on the mask and the random number.
[0107] Feedback of the random number update failure signal to the control module can be achieved by transmitting the signal to the detection module, the detection module outputs the signal to the state control module, the state control module outputs the signal to the interface configuration module, and the interface configuration module feeds the signal back to the control module.
[0108] The excitation signal composed of random numbers is as follows Figure 4 As shown, there are two transmission paths for transmitting to the detection module: the excitation signal is directly transmitted to the detection module and the excitation feedback signal is output to the detection module through the protection layer. Figure 1 and Figure 4 There are five protection lines shown. In actual engineering, the specific number of protection lines can be set as needed.
[0109] 4. Detection module
[0110] Combination Figure 1 and 4 As shown, the detection module receives the configuration information of the state control module and the output information of the excitation generation module, and outputs the error situation and the module working state information to the state control module. After the preset delay, when the detection module does not receive the excitation feedback signal, the default information is output to replace the excitation feedback signal and compare it with the excitation signal. At this time, the excitation signal is an excitation signal generated by a random number, and the default information is set to information different from the random number. The default information can be set to x or z.
[0111] The detection module uses state machine control to realize the detection and calibration function, refer to Figure 5 As shown, the state machine includes module enable, excitation preparation, waiting, detection, judgment and error states. These six states can be set to 6 different serial numbers. The module working state information o_state signal indicates the current working stage of the module, which can be displayed as the current working state serial number of the state machine. Different serial numbers correspond to different working states. When the working state jump fails, the state machine outputs the working state jump failure o_fsm_err signal.
[0112] For the process of how the stimulus generation module and the detection module cooperate to generate a detection failure signal, refer to Figure 5 As shown:
[0113] The detection module receives the signal i_en=0. In this signal mode, the module can be configured with the initialization value in Table 1 above. When the signal i_en=1 is received, the module is enabled.
[0114] After the module is enabled, the state machine jumps to the excitation preparation state. In this state, the excitation generation module prepares the excitation signal, which is to generate an excitation signal composed of random numbers;
[0115] After the excitation preparation state is completed, when the excitation signal input protection layer starts, the state machine jumps to the waiting state. In this state, the preset delay starts counting the delay from the configured count value, and the i_wait_time minus 1 operation is executed until i_wait_time-1=0, and the preset delay ends; in one embodiment, i_wait_time is preset to 200, and the i_wait_time minus 1 operation is executed 200 times until i_wait_time-1=0, and one preset delay ends.
[0116] After the waiting state is completed, the state machine jumps to the detection state. In this state, the detection module compares the excitation signal and the excitation feedback signal. If the excitation feedback signal is the same as the excitation signal, the detection result is correct; if the excitation feedback signal is different from the excitation signal, the detection result is wrong. After obtaining the detection result, the preset detection times i_comp_time is reduced by 1. If the detection result is wrong, the error times o_mis_cnt is increased by 1.
[0117] After the detection state is completed, the state machine jumps to the judgment state. In this state, the error degree is judged, and the next detection is performed or the detection is stopped according to the error degree.
[0118] The performing of the next detection or stopping the detection according to the error degree includes: determining whether the current detection number reaches the preset detection number; if the current detection number does not reach the preset detection number, performing the next detection; if the current detection number reaches the preset detection number, stopping the detection and determining whether the current cumulative error number reaches the preset error threshold;
[0119] or,
[0120] The step of performing the next detection or stopping the detection according to the error degree includes: determining whether the current number of detections reaches the preset number of detections; if the current number of detections does not reach the preset number of detections, determining whether the current cumulative number of errors reaches the preset error threshold; if the current cumulative number of errors does not reach the error threshold, performing the next detection; if the current cumulative number of errors reaches the error threshold or the current number of detections reaches the preset number of detections, stopping the detection.
[0121] The preset detection times and error threshold are preset values configured by the control module.
[0122] The determining whether the current detection times have reached the preset detection times comprises: obtaining a detection result, subtracting 1 from the preset detection times i_comp_time, determining whether the preset detection times i_comp_time is 0, determining that the preset detection times have been reached if it is 0, or determining that the preset detection times have not been reached if it is not 0;
[0123] The determining whether the current cumulative number of errors reaches a preset error threshold comprises: the initial value of the number of errors o_mis_cnt is 0, the detection result is wrong, the o_mismatch detection failure pre-alarm signal is generated, the number of errors o_mis_cnt is increased by 1, if the number of errors o_mis_cnt is greater than the error threshold i_mis_thld, the detection is judged to have failed, and the o_fail detection failure signal is generated;
[0124] The error condition also includes a protection circuit where an error in the detection result occurs. Figure 1There are five protection lines, which are numbered det0-4 respectively. When the detection result of the protection line det0 is wrong, the o_mismatch_ind signal output of the detection result error position indicates the number of the protection line det0 where the detection result error occurs.
[0125] After the judgment state is completed, the state machine jumps to the error state. According to the different error degrees, the error situation and module working status information are fed back to the control module. When it is judged that the current cumulative number of errors is greater than the error threshold, that is, o_mis_cnt>i_mis_thld, the error state outputs the o_fail detection failure signal.
[0126] refer to Figure 1 The detection module feeds back the error situation and module working status information to the control module, and can output information to the state control module, the state control module outputs information to the interface configuration module, and the interface configuration module feeds back the information to the control module.
[0127] 5. Control module
[0128] The control module is configured as a chip control module, or the control module is configured to be communicatively connected with the chip control module;
[0129] The protective measures instructions include executing shutdown instructions, reset instructions, error shielding instructions, and self-destruction chip or internal sensitive information destruction instructions; the error shielding instructions include: working state jump failure shielding, random number update failure shielding, detection failure pre-alarm shielding, and detection failure shielding;
[0130] The control module outputs corresponding protective measures instructions according to the error situation, including:
[0131] The only error situation is: when the error content is detection failure, the control module outputs a self-destruct chip or destroys internal sensitive information instruction.
[0132] The error contents of the present invention include: working state jump failure o_fsm_err, random number update failure o_lfsr_err, detection failure pre-alarm o_lfsr_err and detection failure o_fail; they can be divided into two categories: system error and detection error. The control module selects the corresponding processing method according to different error contents and different requirements.
[0133] The degree of error can reflect the degree of attack and damage to the chip. Different degrees of attack and damage correspond to different protective measures, that is, different degrees of error correspond to different protective measures. Only when the error degree reaches the level that determines that the chip is damaged, the control module outputs instructions to self-destruct the chip or destroy internal sensitive information. This effectively prevents the control module from misjudging and causing irreversible damage to the chip.
[0134] Among them, the failure to jump to the working state and the failure to update the random number are system errors, which are errors caused by abnormal working of the module. When such errors occur, you can execute the shutdown command or the reset command to check whether such errors still occur. If the error is not eliminated after multiple shutdown or reset commands, it means that the circuit inside the module is abnormal; the detection failure pre-alarm and the detection failure are detection errors, which need to be checked to confirm whether they are actually attacked. When the detection failure pre-alarm occurs, it means that the detection result is wrong but the detection has not yet failed. The error at this time may also be caused by the line length or the circuit is abnormal. Observe; when the detection failure occurs, it can be determined that the chip protection layer is physically damaged. The degree of error at this time is the degree that cannot be solved by resetting and restarting. At this time, the control module outputs the instruction to self-destruct the chip or destroy internal sensitive information.
[0135] 3. Layout Implementation
[0136] The excitation generation module includes an excitation signal output terminal, which is used to output the excitation signal generated by the excitation generation module. The detection module includes an excitation signal receiving terminal, which is used to receive the excitation signal output by the excitation generation module. The excitation signal output terminal and the excitation signal receiving terminal are connected during layout wiring.
[0137] refer to Figure 6 As shown, the protection circuits are arranged in parallel and looped back to cover the entire area in an S-shaped wiring manner. When the line length exceeds the standard or encounters the chip boundary, a BUFFER is inserted into the bottom layer of the chip to ensure the driving capability. The line length standard is determined according to the simulation situation. The triangle icon is a schematic diagram of the BUFFER. The BUFFER can optimize the circuit performance by enhancing the driving capability, reducing the number of loads, reducing the connection load, and copying and converting the clock signal. When the present invention is implemented in the actual layout, the protection circuit should be spread over the entire protection area as much as possible. The preset delay is the longest transmission time of the excitation signal through each protection circuit. In order to reduce the error, each protection circuit should be as long as possible during the layout. The present invention is arranged below the protection circuit to avoid the output end and the receiving end of the excitation signal of the present invention being directly physically short-circuited and damaged. When the chip design is specifically implemented, the safe area and the non-safe area are divided, and the circuit related to the important sensitive information to be protected is placed in the safe area, and the chip protection device of the present invention is set. The protection device is connected to the protection circuit, and the protection circuit is arranged above the safe area to shield the physical structure below and fill the blank area.
[0138] Embodiment 3
[0139] Based on the same inventive concept as the first embodiment, this embodiment introduces a chip protection method, including:
[0140] generating an excitation signal according to the received random number, and sending the excitation signal to a plurality of protection lines of the chip protection layer;
[0141] According to a preconfigured preset number of detections, multiple times of receiving the excitation feedback signals output by the multiple protection lines, and comparing the excitation feedback signals with the corresponding excitation signals to obtain multiple detection results;
[0142] The error conditions are recorded according to multiple detection results, or the error conditions are recorded according to multiple detection results and corresponding protective measures instructions are output according to the error conditions.
[0143] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0144] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0147] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A chip protection device, characterized in that: It includes a control module, an excitation generation module and a detection module; The excitation generation module is used to generate an excitation signal according to the random number generated by the control module, and transmit the excitation signal to the detection module and multiple protection lines of the chip protection layer respectively; The detection module is used to receive the excitation feedback signals output by the multiple protection lines multiple times according to the preset detection times configured by the control module, and compare the excitation feedback signals with the corresponding excitation signals to obtain multiple detection results; The control module is used to record error conditions according to multiple detection results, or to record error conditions according to multiple detection results and output corresponding protective measures instructions according to the error conditions.
2. The chip protection device according to claim 1, characterized in that: The incentive generation module is specifically used for: Performing data enhancement on the random number generated by the control module to obtain enhanced data; performing data validity detection on the enhanced data: if the data validity detection is qualified, using the enhanced data to generate an excitation signal; otherwise, feeding back a random number update failure signal to the control module; or, The incentive generation module is specifically used for: The random number generated by the control module is subjected to a random n-bit XOR operation to generate a new random number, and the new random number is subjected to an all-0 detection: if the new random number is a value other than all-0, an excitation signal is generated using the new random number; if the new random number is a value of all-0, a random number update failure signal is fed back to the control module; wherein the random number is a binary number, and the positive integer n is not greater than the length of the binary random number; the random n-bit XOR operation includes: generating a mask with n random positions, wherein the values at the n random positions are 1, and the values at the other positions are 0, and performing an XOR operation on the mask and the random number.
3. The chip protection device according to claim 1, characterized in that: The detection module is specifically used for: comparing the excitation feedback signal with the excitation signal after a preset delay, wherein the preset delay is the longest transmission time of the excitation signal through each protection line; The preset delay is configured or reconfigured by the control module, and the timing method includes chip working clock counting delay.
4. The chip protection device according to claim 1 or 3, characterized in that: The detection module is specifically used for: If the excitation feedback signal is the same as the excitation signal, the detection result is correct; If the excitation feedback signal is different from the excitation signal, the detection result is an error. In response to the detection result being an error, the error degree is determined, and the next detection is performed or the detection is stopped according to the error degree, and the error condition is fed back to the control module; wherein the error condition includes the error content and the number of errors; The performing the next detection or stopping the detection according to the error degree includes: Determine whether the current number of detections has reached the preset number of detections: if the current number of detections has not reached the preset number of detections, perform the next detection; if the current number of detections has reached the preset number of detections, stop the detection and determine whether the current cumulative number of errors has reached the preset error threshold; or, The next detection or stopping the detection according to the error degree includes: Determine whether the current number of detections has reached the preset number of detections. If the current number of detections has not reached the preset number of detections, determine whether the current cumulative number of errors has reached the preset error threshold. If the current cumulative number of errors has not reached the error threshold, perform the next detection. If the current cumulative number of errors has reached the error threshold or the current number of detections has reached the preset number of detections, stop the detection.
5. The chip protection device according to claim 4, characterized in that: The determining whether the current number of detections reaches the preset number of detections includes: Obtain a test result, subtract 1 from the preset test number, and determine whether the preset test number is 0. If it is 0, it is determined that the preset test number has been reached; if not, it is determined that the preset test number has not been reached; The step of determining whether the current cumulative number of errors reaches a preset error threshold comprises: The initial value of the number of errors is 0, the detection result is wrong, and a detection failure pre-alarm signal is generated as the error content. The number of errors is increased by 1. If the number of errors is greater than the error threshold, the detection is judged to have failed, and a detection failure signal is generated as the error content.
6. The chip protection device according to claim 4, characterized in that: The control module is configured as a chip control module, or the control module is configured to be communicatively connected with a chip control module; The protective measures instructions include executing shutdown instructions, reset instructions, error shielding instructions, and self-destruction chips or internal sensitive information destruction instructions; The error shielding instructions include: working state jump failure shielding, random number update failure shielding, detection failure pre-alarm shielding and detection failure shielding; The error condition also includes a protection circuit where an error in the detection result occurs; The control module outputs corresponding protective measures instructions according to the error situation, including: The only error situation is: when the error content is detection failure, the control module outputs a self-destruct chip or destroys internal sensitive information instruction.
7. The chip protection device according to claim 1, characterized in that include: An interface configuration module, used to receive configuration information of the control module, output the configuration information to the state control module, receive output information of the state control module, and feed back the output information of the state control module to the control module; The state control module is used to receive the configuration information output by the interface configuration module, output the corresponding configuration information to the stimulus generation module and the detection module respectively, receive the output information of the detection module, and feed back the output information of the detection module to the interface configuration module.
8. The chip protection device according to claim 1, characterized in that: The excitation generation module comprises an excitation signal output terminal, the excitation signal output terminal is used to output the excitation signal generated by the excitation generation module, the detection module comprises an excitation signal receiving terminal, the excitation signal receiving terminal is used to receive the excitation signal output by the excitation generation module, and the excitation signal output terminal is connected to the excitation signal receiving terminal during layout wiring; The protection lines are arranged in parallel and looped back to cover the entire area in an S-shaped wiring manner. When the line length exceeds the standard or encounters a chip boundary, a BUFFER is inserted into the bottom layer of the chip.
9. The chip protection device according to claim 4, characterized in that: The detection module uses state machine control to realize the detection function. The detection module also feeds back module working status information to the control module. The module working status information is used to indicate the current working status of the state machine. The error content includes a working status jump failure. When the state machine working status jump fails, the detection module outputs a working status jump failure signal to the control module.
10. A chip protection method based on the chip protection device according to any one of claims 1 to 9, characterized in that: include: generating an excitation signal according to the received random number, and sending the excitation signal to a plurality of protection lines of the chip protection layer; According to a preconfigured preset number of detections, multiple times of receiving the excitation feedback signals output by the multiple protection lines, and comparing the excitation feedback signals with the corresponding excitation signals to obtain multiple detection results; The error conditions are recorded according to multiple detection results, or the error conditions are recorded according to multiple detection results and corresponding protective measures instructions are output according to the error conditions.
