Hardware Trojan concealment measurement method and device based on control difficulty analysis

By analyzing the control difficulty of logic gate circuits in the gate-level netlist, the concealment of hardware Trojans is evaluated, which solves the problems of low hardware Trojan detection accuracy and dependence on test incentives in the existing technology, and achieves more accurate hardware Trojan detection.

CN118779933AActive Publication Date: 2024-10-15NAT UNIV OF DEFENSE TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410787633.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-10-15
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

In the existing technology for hardware Trojan detection, methods based on signal flip rate and controllability measurement have the problems of low detection accuracy and dependence on test incentives, and the influence of the difficulty of controlling the clock signal is not fully considered, resulting in the measurement of hidden characteristics of hardware Trojans. distortion.

Method used

Using a method based on control difficulty analysis, by analyzing the logic gate circuits in the gate-level netlist, analyzing the connection relationship of the clock signals, calculating the control difficulty value of each logic gate, and evaluating its concealment based on these values, to reduce the form of hardware Trojans and the impact of clock signals on covertness metrics.

Benefits of technology

It improves the accuracy of hardware Trojan detection, reduces the dependence on test incentives, ensures the accuracy and consistency of hardware Trojan trigger characteristic measurements, and suppresses the impact of hardware Trojan morphology and clock signals on concealment measurements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779933A_ABST
    Figure CN118779933A_ABST
Patent Text Reader

Abstract

The invention discloses a hardware Trojan concealment measurement method and device based on control difficulty analysis. The method comprises the following steps: step S01, analyzing a logic gate circuit in a tested gate-level netlist; s02, judging whether the clock signal is abnormal or not; s03, judging the type of each logic gate circuit, if the logic gate circuit is a combinational logic gate circuit, respectively calculating the control difficulty values C0 and C1 of the corresponding combinational logic gate circuit according to the types of different logic gates, and if the logic gate circuit is a sequential logic gate circuit, calculating the control difficulty values C0 and C1 of the sequential logic circuit according to whether the clock signal is abnormal or not; and S04, calculating a corresponding concealment value according to the C0 and C1 control difficulty values of each logic gate circuit so as to evaluate the concealment degree of each logic gate circuit. According to the method, the dependence on test excitation can be eliminated, and the influence of a hardware Trojan form and a clock signal on concealment measurement is inhibited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of integrated circuit hardware Trojan detection, and in particular to a method and device for measuring the concealment of hardware Trojans based on control difficulty analysis. Background Art

[0002] The measurement of hardware Trojan trigger characteristics is an important step in the process of hardware Trojan detection in integrated circuits. In the prior art, the measurement of hardware Trojan trigger characteristics usually adopts quantitative standards to mark signals with low signal flip rate or difficult controllability as suspected hardware Trojans. Hardware Trojan functions are composed of logic gates. The same functions have different gate-level expressions, so the hardware Trojan forms will show diversity. Traditional gate-level netlist detection methods, such as functional testing methods, usually generate corresponding trigger stimuli based on the circuit structure of the hardware Trojan, calculate the probability of the switch activity of the signal, and use a threshold to divide the signal into normal signals and hardware Trojan signals. However, this type of analysis method based on signal flip rate and coverage requires test stimuli to activate the hardware Trojan, so it is heavily dependent on test stimuli. However, the test stimuli of the circuit to be tested cannot be complete. For example, in the netlist-level hardware Trojan detection process for third-party IP cores, it is usually difficult to obtain test stimuli with high coverage, resulting in a large number of low-activity signals inside the circuit, and low hardware Trojan detection accuracy.

[0003] Traditional digital circuit controllability analysis methods can eliminate test dependencies based on controllability measurement, but the measurement results of signal concealment based on controllability values ​​are inconsistent for different Trojan forms, and thus will be affected by the changes in the hardware Trojan form and cannot be eliminated. Taking a Trojan triggered by four signals as an example, the Trojan can be composed of one four-input AND gate or three two-input AND gates. The controllability values ​​of the two are: when the control is 0, the result is 2 (CC0=2), and when the control is 1, the result is 5 (CC1=5); CC0=3, CC1=7, and the measurement results are biased in the two forms.

[0004] At the same time, since the control difficulty of the clock in different situations is not considered when measuring the concealment of the trigger signal based on the controllability value, there will be a problem of distortion in the measurement of the concealment characteristics of the hardware Trojan, resulting in inaccurate measurement of the trigger characteristics of the hardware Trojan, and thus making the range of the detected hardware Trojan inaccurate. For example, when the clock signal does not have control difficulty, such as the clock is only obtained by the system clock through the NOT gate (NOT) or the BUFF gate (BUFF), the concealment of the trigger output should only be related to the concealment of the input signal, and has nothing to do with the clock signal. However, when the concealment of two series-connected triggers (such as FD1 and FD2 in series) is measured based on the controllability value, the influence of the clock will be accumulated, such as the controllability values ​​CC0=3, CC1=3 of the trigger FD1; the controllability values ​​CC0=5, CC1=5 of the trigger FD2, and the concealment measurement results of the two are inconsistent. Summary of the invention

[0005] The technical problem to be solved by the present invention is as follows: In view of the above-mentioned problems in the prior art, a method and device for measuring the concealment of hardware Trojans based on control difficulty analysis are provided, which can accurately measure the concealment of hardware Trojans, eliminate the dependence on test stimuli, and suppress the influence of hardware Trojan morphology and clock signals on concealment measurement, thereby helping to improve the detection accuracy of hardware Trojans.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A method for measuring the concealment of hardware Trojans based on control difficulty analysis, comprising the following steps:

[0008] Step S01. Analyze the logic gate circuit in the gate-level netlist under test;

[0009] Step S02: Analyze whether the clock signal is abnormal according to the connection relationship of the clock signal in the gate-level netlist under test;

[0010] Step S03. Determine the type of each logic gate circuit. If it is a combinational logic gate circuit, calculate the control difficulty values ​​C0 and C1 of the corresponding combinational logic gate circuit according to the type of different logic gates. If it is a sequential logic gate circuit, calculate the control difficulty values ​​C0 and C1 of the sequential logic circuit according to whether the clock signal is abnormal. The control difficulty values ​​C0 and C1 are the difficulty values ​​of controlling the primary input to logic 0 and logic 1 respectively.

[0011] Step S04: Calculate the corresponding concealment value according to the C0 and C1 control difficulty values ​​of each logic gate circuit to evaluate the concealment degree of each logic gate circuit.

[0012] Furthermore, in step S02, if it is determined that the clock signal only passes through a NOT gate or a cache gate, it is determined to be a clock signal generated by a normal clock tree; otherwise, it is determined to be an abnormal clock signal.

[0013] Furthermore, in step S03, if it is a non-sequential logic gate circuit, the controllability values ​​C0 and C1 of the non-sequential logic gate circuit are calculated based on the controllability measurement method, and then the initial value of the controllability value is subtracted to obtain the corresponding control difficulty values ​​C0 and C1.

[0014] Furthermore, the controllability values ​​C0 and C1 of the input and output nodes are used to directly calculate the control difficulty values ​​C0 and C1 of each logic gate unit. If it is an AND gate, C1=C1(a)+C1(b), C0=Min(C0(a), C0(b)), a and b are the two input nodes of the AND gate respectively; if it is an OR gate, C1=Min(C1(a), C1(b)), C0=C0(a)+C0(b), a and b are the two input nodes of the OR gate respectively; if it is a NOT gate, C1=C0(a), C0=C1(a), a is the input node of the NOT gate; if it is a NAND gate, C1=Min(C0(a), C0(b)), C0=C1(a)+C1(b) a and b are the two input nodes of the NAND gate respectively; if it is a NOR gate, C1=C0(a), C0=C1(a), a is the input node of the NOT gate; if it is a NAND gate, C1=Min(C0(a), C0(b)), C0=C1(a)+C1(b) a and b are the two input nodes of the NAND gate respectively; if it is a NOR gate, C 1=C0(a)+C0(b), C0=Min(C1(a), C1(b)), a and b are the two input nodes of the NOR gate respectively; if it is a buffer gate, C1=C1(a); C0=C0(a), a is the input node of the buffer gate; if it is an XOR gate, C1=Min(C0(a)+C1(b), C1(a)+C0(b)), C0=Min(C0(a)+C0(b), C1(a)+C1(b)), a and b are the two input nodes of the XOR gate respectively; if it is an XNOR gate, C1=Min(C0(a)+C0(b), C1(a)+C1(b)), C0=Min(C0(a)+C1(b), C1(a)+C0(b)), a and b are the two input nodes of the XNOR gate respectively.

[0015] Furthermore, in step S03, if it is a sequential logic gate circuit, when the clock signal is a normal signal, the controllability values ​​C0 and C1 of the clock signal are configured to 0, and the controllability values ​​C0 and C1 of the input nodes are directly used to calculate the C0 and C1 control difficulty values ​​of the sequential logic circuit; when the clock signal is an abnormal signal, the controllability values ​​C0 and C1 of the input nodes and the controllability values ​​C0 and C1 of the clock signal are used to respectively calculate the C0 and C1 control difficulty values ​​of the sequential logic circuit.

[0016] Furthermore, when it is a sequential logic circuit and a trigger, if the clock signal clk is a normal signal, C1=C1(D), C0=C0(D), D is the input node of the trigger; if the clock signal clk is an abnormal signal, C1=C1(D)+C0(clk)+C1(clk), C0=C0(D)+C0(clk)+C1(clk), C0(clk) and C1(clk) are the controllability values ​​C0 and C1 of the clock signal, respectively.

[0017] Furthermore, in step S03, the concealment value Con of each logic gate unit is calculated according to the following formula:

[0018]

[0019] Among them, max(c0, c1) represents the maximum value of the control difficulty values ​​C0 and C1, and min(c0, c1) represents the minimum value of the control difficulty values ​​C0 and C1.

[0020] Furthermore, after step S04, the method further includes classifying the one-dimensional data set formed by the concealment value using a classification algorithm to classify the data set into normal signals and suspicious hardware Trojan signals, and finally obtaining a suspicious hardware Trojan list.

[0021] A device for measuring the concealment of hardware Trojans based on control difficulty analysis, comprising:

[0022] A gate-level netlist analysis module, used to analyze the logic gate circuits in the gate-level netlist under test;

[0023] The clock tree analysis module is used to analyze whether the clock signal is abnormal according to the connection relationship of the clock signal in the gate-level netlist under test;

[0024] A control difficulty analysis module is used to determine the type of each logic gate circuit. If it is a combinational logic gate circuit, the control difficulty values ​​C0 and C1 of the corresponding combinational logic gate circuit are calculated according to the type of different logic gates. If it is a sequential logic gate circuit, the control difficulty values ​​C0 and C1 of the sequential logic circuit are calculated according to whether the clock signal is abnormal. The control difficulty values ​​C0 and C1 are the difficulty values ​​of controlling the primary input to logic 0 and logic 1 respectively.

[0025] The concealment evaluation module is used to calculate the corresponding concealment value according to the C0 and C1 control difficulty values ​​of each logic gate circuit, so as to evaluate the concealment degree of the logic gate circuit.

[0026] A computer device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0027] Compared with the prior art, the advantages of the present invention are: the present invention performs control difficulty analysis on each logic gate circuit in the gate-level netlist, calculates the control difficulty value of each logic gate circuit according to the type of logic gate circuit and the abnormal situation of the clock signal, removes the transmission difficulty of the controllability value of the combinational logic gate circuit at each level of logic gate to obtain the control difficulty value, considers the control difficulty value of the clock signal when the clock is abnormal for the sequential logic gate circuit, and then calculates the concealment value based on the control difficulty value, and measures the concealment degree of the hardware Trojan trigger by the concealment value, solves the problem of measuring the trigger characteristics of the hardware Trojan at the netlist level, can not only improve the accuracy of the measurement of the trigger characteristics of the hardware Trojan, but also eliminates the dependence of the netlist-level hardware Trojan detection on the test stimulus, and suppresses the influence of the hardware Trojan morphology and clock signal on the concealment measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 Schematic diagram of the implementation flow of the method for measuring the concealment of hardware Trojans based on control difficulty analysis in this embodiment.

[0029] Figure 2 It is a schematic diagram of the implementation process of hardware Trojan detection based on the control difficulty analysis hardware Trojan concealment measurement method of this embodiment. DETAILED DESCRIPTION

[0030] The controllability metric based method usually uses the corresponding controllability calculation method according to the different types of logic gates to finally obtain the controllability value of each logic gate. Controllability is the difficulty of controlling the logic state of the internal lead from the primary input of the circuit. The difficulty of controlling a lead to logic I / 0 from the primary input is called the I / 0 controllability of the lead. Then the controllability values ​​are classified, and those with larger controllability values ​​are classified as suspicious hardware Trojan signals. The method for calculating the controllability value of each logic gate circuit in the controllability metric based method is shown in Table 1.

[0031] Table 1: Controllability value calculation method

[0032]

[0033] When measuring controllability according to the controllability measurement method described above, the controllability measurement results are inconsistent for different Trojan forms. Taking a Trojan triggered by 4 signals as an example, the Trojan can be composed of 1 four-input AND gate or 3 two-input AND gates. If the controllability value of the Trojan input is 1, and the output of the Trojan composed of 1 four-input AND gate is 0, the controllability value = 1+1=2; when the output is 1, the controllability value = (1+1+1+1)+1=5, that is, when the control of the Trojan is 0, the result is 2 (CC0=2), and when the control is 1, the result is 5 (CC1=5). When the output of the Trojan consisting of three two-input AND gates is 0, the controllability value = Min((1+1), (1+1))+1=3; when the output is 1, the controllability value = ((1+1)+1)+((1+1)+1)+1=7, CC0=3, CC1=7, that is, there is a deviation in the measurement results under the two forms, resulting in the problem of distortion of the controllability value.

[0034] The present invention is aimed at the problem of measuring the trigger characteristic of a hardware Trojan during the detection of hardware Trojans at the netlist level of an integrated circuit. For the analysis of the control difficulty of a signal taking values ​​of 0 and 1, a control difficulty value is obtained by removing the transmission difficulty of a controllability value at each level of logic gates for a combinational logic gate circuit, and the control difficulty of a clock under different conditions is considered. For a sequential logic gate circuit, the control difficulty values ​​of logic gates 0 and 1 are statically calculated according to whether the clock is abnormal, and then a concealment value is calculated from the control difficulty value. The concealment degree of the hardware Trojan trigger is measured by the concealment value, and the problem of measuring the trigger characteristic of the hardware Trojan at the netlist level is solved. At the same time, the accuracy of the measurement of the trigger characteristic of the hardware Trojan is improved, and the dependence of the netlist level hardware Trojan detection on the test stimulus is eliminated, and the influence of the hardware Trojan morphology and the clock signal on the concealment measurement is suppressed.

[0035] like Figure 1 As shown, the steps of the method for measuring the concealment of hardware Trojans based on control difficulty analysis in this embodiment include:

[0036] Step S01. Gate-level netlist analysis: analyzing the logic gate circuits in the gate-level netlist under test.

[0037] Different process libraries need to call different gate-level units accordingly. This embodiment targets the data file of the gate-level netlist, first parses the logic gate units corresponding to different process nodes, maps them to basic units such as AND, OR, NOT, triggers, etc., and parses to obtain multiple logic gate circuits.

[0038] Step S02. Clock tree analysis: Analyze whether the clock signal is abnormal based on the connection relationship of the clock signal in the gate-level netlist under test.

[0039] Specifically, starting from the clock signal of the netlist, the connection relationship of the clock signal is analyzed. If it is determined that the clock signal only passes through the NOT gate (NOT) or the BUFF gate (BUFF), it is determined to be a clock signal generated by a normal clock tree, otherwise it is determined to be an abnormal clock signal. Subsequently, different methods are used to calculate the control difficulty value of the sequential logic gate according to the abnormal state of the clock signal to consider different clock signal states to ensure that the concealment value is consistent with the concealment analysis result, and avoid distortion in the measurement of the concealment characteristics of hardware Trojans.

[0040] Step S03. Control difficulty analysis: Determine the type of each logic gate circuit. If it is a combinational logic gate circuit, calculate the control difficulty values ​​C0 and C1 of the corresponding combinational logic gate circuit according to the type of different logic gates. If it is a sequential logic gate circuit, calculate the control difficulty values ​​C0 and C1 of the sequential logic circuit according to whether the clock signal is abnormal. The control difficulty values ​​C0 and C1 are the difficulty values ​​of controlling the primary input to logic 0 and logic 1, respectively.

[0041] In order to quickly and accurately display the hidden circuit and determine the scope of the hardware Trojan, this embodiment adopts a concealment measurement method to narrow the detection range for further analysis. When the signal (including abnormal clock signal) propagates between gates, the control difficulty of the signal being 0 or 1 is only related to the corresponding input. This embodiment first calculates the control difficulty values ​​C0 and C1 according to the type of logic gate circuit and whether the clock signal is abnormal according to the controllability values ​​C0 and C1 of the input node. The controllability values ​​C0 and C1 are the difficulty values ​​of controlling a certain lead to logic 0 or 1 from the primary input. It can be expressed by the minimum number of signal assignments required to set the node to logic value 0 or 1. The control difficulty values ​​C0 and C1 are then used to calculate the concealment value to measure the concealment.

[0042] In this embodiment, if it is a non-sequential logic gate circuit, the controllability values ​​C0 and C1 of the combinational logic gate circuit are calculated based on the controllability metric method, and then the initial value of the controllability value is subtracted to obtain the corresponding control difficulty values ​​C0 and C1.

[0043] Specifically, the initial value of the controllability value in the scoap (Sandia Controllability / Observability Analysis Program) algorithm is 1. Based on the scoap algorithm, this embodiment obtains the corresponding control difficulty values ​​C0 and C1 by subtracting 1 from the controllability values ​​C0 and C1 of each combinational logic gate circuit in the scoap algorithm for different combinational logic gate circuits. That is, for combinational logic gates such as AND, OR, and NOT, when calculating the control difficulty values ​​C0 and C1, it is not considered that 1 is added after each logic gate, so that the concealment values ​​of the same Trojan in different forms are consistent, eliminating the influence of the diversity of Trojan forms.

[0044] In this embodiment, if it is a sequential logic gate circuit, when the clock signal is a normal signal, the controllability values ​​C0 and C1 of the clock signal are configured to 0, and the controllability values ​​C0 and C1 of the input node are directly used to calculate the control difficulty values ​​C0 and C1 of the sequential logic circuit. When the clock signal is an abnormal signal, that is, the clock signal is not obtained from a normal clock tree, the controllability values ​​C0 and C1 of the input node and the controllability values ​​C0 and C1 of the clock signal are used to calculate the control difficulty values ​​C0 and C1 of the sequential logic circuit respectively. That is, for sequential logic gates such as triggers, when the clock signal is obtained from a normal clock tree, the controllability value of the clock signal is configured to 0. When the clock is abnormal, the controllability value of the clock signal needs to be additionally calculated. Finally, the controllability value of the input node and the controllability value of the clock signal are combined to obtain the final control difficulty value of the logic gate circuit, thereby making the concealment value consistent with the concealment analysis result.

[0045] For clocks in different situations, the control difficulty value is calculated in different ways. For a trigger controlled by a normal clock, the difficulty of the output of the trigger being 0 and 1 is determined by the difficulty of the input being 0 and 1. For a trigger controlled by an abnormal clock, the difficulty of the output of the trigger being 0 and 1 is determined by the difficulty of the input being 0 and 1, and is also affected by the control difficulty of the abnormal clock. Therefore, by calculating the control difficulty value according to the abnormal state of the clock, the control difficulty of the sequential logic gate circuit can be described more accurately. The subsequent calculation of the concealment based on the control difficulty value can make it consistent with the result of the signal concealment analysis.

[0046] Specifically, if it is an AND gate, C1=C1(a)+C1(b), C0=Min(C0(a), C0(b)), a and b are the two input nodes of the AND gate respectively; if it is an OR gate, C1=Min(C1(a), C1(b)), C0=C0(a)+C0(b), a and b are the two input nodes of the OR gate respectively; if it is a NOT gate, C1=C0(a), C0=C1(a), a is the input node of the NOT gate; if it is a NAND gate, C1=Min(C0(a), C0(b)), C0=C1(a)+C1(b) a and b are the two input nodes of the NAND gate respectively; if it is a NOR gate, C1=C0(a)+C0(b), C0=Min(C 1(a), C1(b)), a and b are the two input nodes of the NOR gate respectively; if it is a buffer gate, C1=C1(a); C0=C0(a), a is the input node of the buffer gate; if it is an XOR gate, C1=Min(C0(a)+C1(b), C1(a)+C0(b)), C0=Min(C0(a)+C0(b), C1(a)+C1(b)), a and b are the two input nodes of the XOR gate respectively; if it is an XNOR gate, C1=Min(C0(a)+C0(b), C1(a)+C1(b)), C0=Min(C0(a)+C1(b), C1(a)+C0(b)), a and b are the two input nodes of the XNOR gate respectively. When it is a sequential logic circuit and a trigger, if the clock signal clk is a normal signal, C1=C1(D), C0=C0(D), D is the input node of the trigger; if the clock signal clk is an abnormal signal, C1=C1(D)+C0(clk)+C1(clk), C0=C0(D)+C0(clk)+C1(clk), C0(clk) and C1(clk) are the controllability values ​​C0 and C1 of the clock signal, respectively, that is, the control difficulty values ​​of 0 and 1 of the clock signal clk.

[0047] Table 2 Control difficulty value calculation method

[0048]

[0049] As shown in Table 2, the control difficulty values ​​for different logic gates are calculated as follows:

[0050] Primary Input: The primary input signals are set to 0 and the difficulty is set to 1.

[0051] AND gate: out = AND(a, b). out = 1 requires a = 1 and b = 1, so C1(out) = C1(a) + C1(b); out = 0 requires a = 0 or b = 0, so C0(out) = Min(C0(a), C0(b)).

[0052] OR gate: out=OR(a, b). out=1 requires a=1 or b=1, so C1(out)=Min(C1(a), C1(b)); out=0 requires a=0 and b=0, so C0(out)=C0(a)+C0(b).

[0053] NOT gate: out=NOT(a). out=1 requires a=0, so C1(out)=C0(a); out=0 requires a=1, so C0(out)=C1(a).

[0054] NAND gate: out = NAND(a, b). out = 1 requires a = 0 or b = 0, so C1(out) = Min(C0(a), C0(b)); out = 0 requires a = 1 and b = 1, so C0(out) = C1(a) + C1(b).

[0055] NOR gate: out = NOR(a, b). out = 1 requires a = 0 and b = 0, so C1(out) = C0(a) + C0(b); out = 0 requires a = 1 or b = 1, so C0(out) = Min(C1(a), C1(b)).

[0056] Buffer gate: out = BUFF(a). out = 1 requires a = 1, so C1(out) = C1(a); out = 0 requires a = 0, so C0(out) = C0(a).

[0057] XOR gate: out = XOR(a, b). out = 1 requires (a = 0, b = 1) or (a = 1, b = 0), so C1(out) = Min(C0(a) + C1(b), C1(a) + C0(b)); out = 0 requires (a = 0, b = 0) or (a = 1, b = 1), so C0(out) = Min(C0(a) + C0(b), C1(a) + C1(b)).

[0058] XNOR gate: out = XNOR(a, b). out = 1 requires (a = 0, b = 0) or (a = 1, b = 1), so C1(out) = Min(C0(a) + C0(b), C1(a) + C1(b)); out = 0 requires (a = 0, b = 1) or (a = 1, b = 0), so C0(out) = Min(C0(a) + C1(b), C1(a) + C0(b)).

[0059] Trigger: out=DFF(D,clk). When the clock clk is normal, out=1 must satisfy D=1, so C1(out)=C1(D); out=0 must satisfy D=0, so C0(out)=C0(D). When the clock clk is abnormal, out=1 must satisfy D=1 and the clock jumps from 0 to 1, so C1(out)=C1(D)+C0(clk)+C1(clk); out=0 must satisfy D=0 and the clock jumps from 0 to 1, so C0(out)=C0(D)+C0(clk)+C1(clk).

[0060] Step S04. Concealment analysis: Calculate the corresponding concealment value according to the C0 and C1 control difficulty values ​​of each logic gate circuit to evaluate the concealment degree of the logic gate circuit.

[0061] Specifically, the concealment value Con of each logic gate unit can be calculated according to the following formula:

[0062]

[0063] Among them, max(c0, c1) represents the maximum value of the control difficulty values ​​C0 and C1, and min(c0, c1) represents the minimum value of the control difficulty values ​​C0 and C1.

[0064] In the above formula (1), if the concealment value is closer to 1, the concealment of the gate node is poorer, and correspondingly, if the concealment value is larger, the concealment of the gate node is stronger. It can be understood that, of course, other methods can be used to calculate the concealment value Con based on the control difficulty values ​​C0 and C1 according to actual needs. The key is to use the control difficulty values ​​C0 and C1 to measure concealment.

[0065] In this embodiment, the control difficulty values ​​C0 and C1 do not take into account the control difficulty value of the clock signal when the clock signal is normal. In an abnormal state, the control difficulty value of the clock signal needs to be added, so that the concealment value of the timing logic gates such as the trigger is calculated to additionally consider the control difficulty of the abnormal clock signal. In the process of concealment calculation, the concealment value of each gate is only determined by the concealment of its input, so that the concealment value can be consistent with the concealment analysis result.

[0066] Taking the Trojan triggered by 4 signals as an example, when the Trojan is composed of 1 four-input AND gate, the concealment of the output of 0 = 1 (i.e. C0 = 1), and the concealment of the output of 1 = (1+1+1+1) = 4 (i.e. C1 = 4). When the Trojan is composed of 3 two-input AND gates, the concealment of the output of 0 = Min (1, 1) = 1 (i.e. C0 = 1), and the concealment of the output of 1 = (1+1) + (1+1) = 4 (i.e. C1 = 4), that is, the measurement results are consistent in the two forms.

[0067] This embodiment does not consider the number of logic gates passed when calculating the control difficulty value of the combinational logic gate circuit, and distinguishes the impact of normal and abnormal clocks on the measurement when calculating the control difficulty value of the sequential logic gate circuit. In the abnormal state, it is necessary to add the control difficulty value of the clock signal, and then use the control difficulty value to calculate the concealment value to evaluate the concealment of the hardware Trojan. The concealment value and the concealment analysis result can be consistent under the same hardware Trojan function, different hardware Trojan gate-level forms and different clock conditions, and the same measurement result can be achieved under the same hardware Trojan and different gate-level expression forms.

[0068] Further, such as Figure 2 As shown, after step S04, the one-dimensional data set formed by the concealment value is classified by a classification algorithm into normal signals and suspicious hardware Trojan signals, and finally a list of suspicious hardware Trojans is obtained, which can quickly and accurately detect hardware Trojans. The classification algorithm can be a k-means algorithm, that is, the concealment value is passed to the k-means algorithm in the form of a one-dimensional data set, where k=2, and the final signal is divided into two categories, one is a normal signal with a smaller concealment value, and the other is a suspicious hardware Trojan signal with a larger concealment value, and finally a list of suspicious hardware Trojans is obtained. The classification algorithm can be selected according to actual needs.

[0069] The hardware Trojan concealment measurement device based on control difficulty analysis in this embodiment includes:

[0070] A gate-level netlist analysis module, used to analyze the logic gate circuits in the gate-level netlist under test;

[0071] The clock tree analysis module is used to analyze whether the clock signal is abnormal according to the connection relationship of the clock signal in the gate-level netlist under test;

[0072] The control difficulty analysis module is used to determine the type of each logic gate circuit. If it is a combinational logic gate circuit, the control difficulty values ​​C0 and C1 of the corresponding combinational logic gate circuit are calculated according to the type of different logic gates. If it is a sequential logic gate circuit, the control difficulty values ​​C0 and C1 of the sequential logic circuit are calculated according to whether the clock signal is abnormal. The control difficulty values ​​C0 and C1 are the difficulty values ​​of controlling the primary input of the logic gate to logic 0 and logic 1 respectively.

[0073] The concealment evaluation module is used to calculate the corresponding concealment value according to the C0 and C1 control difficulty values ​​of each logic gate circuit, so as to evaluate the concealment degree of the logic gate circuit.

[0074] The device for measuring the concealment of a hardware Trojan based on control difficulty analysis in this embodiment corresponds one to one with the method for measuring the concealment of a hardware Trojan based on control difficulty analysis described above, and will not be described in detail here.

[0075] This embodiment further provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0076] It is understandable that the above method of this embodiment can be executed by a single device, such as a computer or server, etc., and can also be applied to a distributed scenario and completed by multiple devices in cooperation with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and multiple devices interact to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., for executing related programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory ROM, a random access memory RAM, a static storage device, and a dynamic storage device. The memory can store an operating system and other applications. When the above method of this embodiment is implemented by software or firmware, the relevant program code is stored in the memory and called and executed by the processor.

[0077] Those skilled in the art will appreciate that the above-mentioned embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. 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, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0078] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for measuring the concealment of hardware Trojans based on control difficulty analysis, characterized in that the steps include: Step S01. Analyze the logic gate circuit in the gate-level netlist under test; Step S02: Analyze whether the clock signal is abnormal according to the connection relationship of the clock signal in the gate-level netlist under test; Step S03. Determine the type of each logic gate circuit. If it is a combinational logic gate circuit, calculate the control difficulty values ​​C0 and C1 of the corresponding combinational logic gate circuit according to the type of different logic gates. If it is a sequential logic gate circuit, calculate the control difficulty values ​​C0 and C1 of the sequential logic circuit according to whether the clock signal is abnormal. The control difficulty values ​​C0 and C1 are the difficulty values ​​of controlling the primary input to logic 0 and logic 1 respectively. Step S04: Calculate the corresponding concealment value according to the C0 and C1 control difficulty values ​​of each logic gate circuit to evaluate the concealment degree of each logic gate circuit.

2. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to claim 1 is characterized in that: In step S02, if it is determined that the clock signal only passes through a NOT gate or a cache gate, it is determined to be a clock signal generated by a normal clock tree; otherwise, it is determined to be an abnormal clock signal.

3. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to claim 1 is characterized in that: In the step S03, if it is a non-sequential logic gate circuit, the controllability values ​​C0 and C1 of the non-sequential logic gate circuit are calculated based on the controllability measurement method, and then the initial value of the controllability value is subtracted to obtain the corresponding control difficulty values ​​C0 and C1.

4. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to claim 3 is characterized in that: Use the controllability values ​​C0 and C1 of the input and output nodes to directly calculate the control difficulty values ​​C0 and C1 of each logic gate unit. If it is an AND gate, C1=C1(a)+C1(b), C0=Min(C0(a), C0(b)), a and b are the two input nodes of the AND gate respectively; if it is an OR gate, C1=Min(C1(a), C1(b)), C0=C0(a)+C0(b), a and b are the two input nodes of the OR gate respectively; if it is a NOT gate, C1=C0(a), C0=C1(a), a is the input node of the NOT gate; if it is a NAND gate, C1=Min(C0(a), C0(b)), C0=C1(a)+C1(b) a and b are the two input nodes of the NAND gate respectively; if it is a NOR gate, C1=C 0(a)+C0(b), C0=Min(C1(a), C1(b)), a and b are the two input nodes of the NOR gate respectively; if it is a buffer gate, C1=C1(a); C0=C0(a), a is the input node of the buffer gate; if it is an XOR gate, C1=Min(C0(a)+C1(b), C1(a)+C0(b)), C0=Min(C0(a)+C0(b), C1(a)+C1(b)), a and b are the two input nodes of the XOR gate respectively; if it is an XNOR gate, C1=Min(C0(a)+C0(b), C1(a)+C0(b)), C0=Min(C0(a)+C1(b), C1(a)+C0(b)), a and b are the two input nodes of the XNOR gate respectively.

5. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to claim 1 is characterized in that: In the step S03, if it is a sequential logic gate circuit, when the clock signal is a normal signal, the controllability values ​​C0 and C1 of the clock signal are configured to 0, and the controllability values ​​C0 and C1 of the input nodes are directly used to calculate the C0 and C1 control difficulty values ​​of the sequential logic circuit; when the clock signal is an abnormal signal, the controllability values ​​C0 and C1 of the input nodes and the controllability values ​​C0 and C1 of the clock signal are used to respectively calculate the C0 and C1 control difficulty values ​​of the sequential logic circuit.

6. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to claim 5 is characterized in that: When it is a sequential logic circuit and a trigger, if the clock signal clk is a normal signal, C1=C1(D), C0=C0(D), D is the input node of the trigger; if the clock signal clk is an abnormal signal, C1=C1(D)+C0(clk)+C1(clk), C0=C0(D)+C0(clk)+C1(clk), C0(clk) and C1(clk) are the controllability values ​​C0 and C1 of the clock signal respectively.

7. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to any one of claims 1 to 6, characterized in that: In step S03, the concealment value Con of each logic gate unit is calculated according to the following formula: Among them, max(c0, c1) represents the maximum value of the control difficulty values ​​C0 and C1, and min(c0, c1) represents the minimum value of the control difficulty values ​​C0 and C1.

8. The method for measuring the concealment of hardware Trojans based on control difficulty analysis according to any one of claims 1 to 6, characterized in that: After step S04, the process also includes classifying the one-dimensional data set formed by the concealment value using a classification algorithm to classify the data set into normal signals and suspicious hardware Trojan signals, and finally obtaining a suspicious hardware Trojan list.

9. A device for measuring the concealment of hardware Trojans based on control difficulty analysis, characterized in that: include: A gate-level netlist analysis module, used to analyze the logic gate circuits in the gate-level netlist under test; The clock tree analysis module is used to analyze whether the clock signal is abnormal according to the connection relationship of the clock signal in the gate-level netlist under test; A control difficulty analysis module is used to determine the type of each logic gate circuit. If it is a combinational logic gate circuit, the control difficulty values ​​C0 and C1 of the corresponding combinational logic gate circuit are calculated according to the type of different logic gates. If it is a sequential logic gate circuit, the control difficulty values ​​C0 and C1 of the sequential logic circuit are calculated according to whether the clock signal is abnormal. The control difficulty values ​​C0 and C1 are the difficulty values ​​of controlling the primary input to logic 0 and logic 1 respectively. The concealment evaluation module is used to calculate the corresponding concealment value according to the C0 and C1 control difficulty values ​​of each logic gate circuit, so as to evaluate the concealment degree of the logic gate circuit.

10. A computer device comprising a processor and a memory, wherein the memory is used to store a computer program, wherein: The processor is configured to execute the computer program to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Trojan infection circuit identification method based on chip netlist characteristics

    CN110287735A

  • System chip hardware Trojan horse detection method and system based on differential amplification controllability

    CN111488629A

  • Integrated circuit hardware Trojan horse detection method, device and equipment and storage medium

    CN116680693A