A ring oscillator based hardware trojan detection method and related apparatus
By determining the sensing radius and detection area of the ring oscillator, and calculating the number of targets, hardware Trojan detection is performed using the ring oscillator. This solves the problems of low detection accuracy and wasteful overhead in the existing technology, and achieves high-precision and high-efficiency hardware Trojan detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF MICROELECTRONICS CHINESE ACAD OF SCI LTD
- Filing Date
- 2024-11-28
- Publication Date
- 2026-05-29
Smart Images

Figure CN122113099A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of hardware Trojan sidechannel analysis and detection technology, and in particular to a hardware Trojan detection method and related apparatus based on a ring oscillator. Background Technology
[0002] Hardware Trojans are hidden or malicious circuits that are maliciously implanted into electronic devices or systems. They can be activated under certain conditions to steal information or damage system functions.
[0003] A ring oscillator is a feedback loop circuit consisting of an odd number of inverters connected end to end. It achieves self-excited oscillation through positive feedback and can generate a relatively stable frequency and waveform.
[0004] Currently, hardware Trojans in electronic devices, circuits, or systems can be detected using ring oscillators. However, how to achieve high-precision detection of hidden hardware Trojans within circuits using as few ring oscillators as possible has become one of the urgent problems to be solved in the field of hardware Trojan side-channel analysis and detection technology. Summary of the Invention
[0005] To address the aforementioned issues, this application provides a hardware Trojan detection method based on a ring oscillator, which aims to achieve high-precision detection of hidden hardware Trojans installed in circuits using as few ring oscillators as possible.
[0006] The embodiments of this application disclose the following technical solutions:
[0007] The first aspect of this application provides a hardware Trojan detection method based on a ring oscillator, including:
[0008] Determine the sensing radius of the target inverter in the ring oscillator; the target inverter is any one of the N inverters included in the ring oscillator; N is an odd number greater than or equal to 1; the sensing radius indicates the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the inverter in detecting the hardware Trojan is greater than a preset detection accuracy threshold.
[0009] Based on the sensing radius and the number of inverters in the ring oscillator, determine the maximum detection area corresponding to the ring oscillator;
[0010] Based on the maximum detection area and the area to be detected of the target circuit, the number of targets is determined; the number of targets indicates the minimum number of ring oscillators required to perform hardware Trojan detection on the area to be detected.
[0011] The target number of ring oscillators are used to detect hardware Trojans in the target circuit.
[0012] In one alternative implementation, determining the sensing radius of the target inverter in the ring oscillator includes:
[0013] Determine the initial oscillation frequency, initial mean, and initial variance of the ring oscillator; the initial mean and initial variance are the mean and variance corresponding to the initial oscillation frequency satisfying a Gaussian distribution;
[0014] The distance between the target hardware Trojan and the target inverter is changed sequentially. When the distance between the target hardware Trojan and the target inverter is i units, the average oscillation frequency of the ring oscillator is determined as the target average frequency; where i is an integer greater than or equal to 0.
[0015] The sensing radius is determined based on the initial mean, the initial variance, and the mean values of multiple target frequencies.
[0016] In one optional implementation, determining the sensing radius based on the initial mean, the initial variance, and multiple target frequency means includes:
[0017] For each target frequency mean, if the absolute value of the difference between the target frequency mean and the initial mean is greater than or equal to twice the initial variance, then the target frequency mean is taken as the potential target frequency mean.
[0018] The largest i-th unit corresponding to the average frequency of multiple potential targets is taken as the sensing radius.
[0019] In one optional implementation, determining the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator includes:
[0020] The square of twice the sensing radius is taken as the detection area of the target inverter;
[0021] The product of the detection area of the target inverter and the number of inverters in the ring oscillator is taken as the maximum detection area corresponding to the ring oscillator.
[0022] In one optional implementation, the detection of hardware Trojans in the target circuit using the target number of ring oscillators includes:
[0023] Based on a preset target arrangement order, the target number of ring oscillators are deployed in the target circuit to detect hardware Trojans in the target circuit; the target arrangement order indicates the arrangement of all inverters included in the ring oscillator.
[0024] In one alternative implementation, the order of the targets includes:
[0025] M1 inverters are arranged horizontally, and M2 inverters are arranged vertically. The two target squares corresponding to two adjacent inverters arranged in the horizontal and vertical directions are tangent to each other. The target squares are squares with the square of the sensing radius as the side length. M1 and M2 are both integers greater than or equal to 1. The product of M1 and M2 is N.
[0026] In one optional implementation, determining the number of targets based on the maximum detection area and the area to be detected of the target circuit includes:
[0027] Divide the area to be detected by the maximum area to be detected to determine the quotient and the remainder;
[0028] If the remainder is zero, then the quotient is taken as the target number;
[0029] If the remainder is non-zero, then the sum of the quotient and 1 is taken as the target number.
[0030] A second aspect of this application provides a hardware Trojan detection device based on a ring oscillator, comprising:
[0031] The sensing radius determination module is used to determine the sensing radius of the target inverter in the ring oscillator; the target inverter is any one of the N inverters included in the ring oscillator; N is an odd number greater than or equal to 1; the sensing radius indicates the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the inverter in detecting the hardware Trojan is greater than a preset detection accuracy threshold.
[0032] The detection area determination module is used to determine the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator;
[0033] The target number determination module is used to determine the target number based on the maximum detection area and the area to be detected of the target circuit; the target number indicates the minimum number of ring oscillators required to perform hardware Trojan detection on the area to be detected;
[0034] The hardware Trojan detection module is used to detect hardware Trojans in the target circuit by using the number of target ring oscillators.
[0035] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any implementation of the first aspect.
[0036] A fourth aspect of this application provides an electronic device, comprising:
[0037] A memory on which computer programs are stored;
[0038] A processor for executing the computer program in the memory to implement the steps of the method described in any implementation of the first aspect.
[0039] Compared with the prior art, this application has the following advantages:
[0040] This application discloses a method for detecting hardware Trojans using a ring oscillator, comprising: determining the sensing radius of a target inverter in the ring oscillator, i.e., determining the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the target inverter in detecting the hardware Trojan is greater than a preset detection accuracy threshold; determining the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator; determining the minimum number of ring oscillators required to detect hardware Trojans in the target circuit, i.e., the number of targets, based on the maximum detection area and the area to be detected in the target circuit; and detecting the hardware Trojan in the target circuit using the number of ring oscillators required for the target circuit. This achieves the goal of high-precision detection of hidden hardware Trojans installed in a circuit using as few ring oscillators as possible. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 A flowchart illustrating a hardware Trojan detection method based on a ring oscillator provided in this application embodiment;
[0043] Figure 2 A schematic diagram illustrating a target arrangement provided in an embodiment of this application;
[0044] Figure 3 A schematic diagram of a ring oscillation network provided in an embodiment of this application;
[0045] Figure 4 This is a schematic diagram of a hardware Trojan detection device based on a ring oscillator, provided in an embodiment of this application. Detailed Implementation
[0046] Hardware Trojans are hidden or malicious circuits maliciously implanted into electronic devices or systems. They can be activated under specific conditions to steal information or disrupt system functions. With the globalization of integrated circuit design and manufacturing, and the widespread use of outsourced and third-party electronic modules, hardware Trojans have become an increasingly serious security problem.
[0047] A ring oscillator is a feedback loop circuit consisting of an odd number of inverters connected end-to-end. It achieves self-excited oscillation through positive feedback, generating a relatively stable frequency and waveform. The oscillation frequency of a ring oscillator is closely related to the circuit's physical characteristics, such as voltage. If a hardware trojan is implanted during circuit or chip manufacturing, the oscillation frequency of the ring oscillator surrounding the trojan will change when the chip is active. Based on this principle, ring oscillators can be used to detect hardware trojans in electronic devices, circuits, or systems.
[0048] When a ring oscillator network composed of multiple ring oscillators is deployed in a circuit or chip, it can detect hardware trojans implanted in the circuit or chip. However, how to quantify the sensing capability of a single inverter for hardware trojans, and how to achieve high-precision detection of hidden hardware trojans in circuits or chips using as few ring oscillators as possible, has become one of the urgent problems to be solved in the field of hardware trojan side-channel analysis and detection technology.
[0049] To address the aforementioned problems, this application discloses a method for detecting hardware Trojans using a ring oscillator. The method includes: determining the sensing radius of a target inverter in the ring oscillator, i.e., determining the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the target inverter in detecting a hardware Trojan exceeds a preset detection accuracy threshold; determining the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator; determining the minimum number of ring oscillators required to detect hardware Trojans in the target circuit, i.e., the number of targets, based on the maximum detection area and the area to be detected in the target circuit; and detecting the hardware Trojan in the target circuit using the required number of ring oscillators. This achieves the goal of high-precision detection of hidden hardware Trojans installed in a circuit using as few ring oscillators as possible.
[0050] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0051] Figure 1A flowchart illustrating a hardware Trojan detection method based on a ring oscillator, provided as an embodiment of this application. (Combined with...) Figure 1 As shown, the hardware Trojan detection method disclosed in this application includes:
[0052] S101, determine the sensing radius of the target inverter in the ring oscillator.
[0053] The ring oscillator in this application comprises N inverters, each with the same sensing radius. Here, N is an odd number greater than or equal to 1. The target inverter is any one of the inverters in the ring oscillator.
[0054] According to the inverter's gate delay formula, the greater the change in power supply voltage, the greater the impact on the gate delay and the greater the impact on the oscillation frequency of the ring oscillator. A hardware trojan can affect the power supply voltage in its vicinity, thus affecting the gate delay. The larger the area of the hardware trojan, the greater its impact on the surrounding voltage, and this impact weakens with increasing distance. In other words, the change in the inverter's gate delay is determined by both the area of the hardware trojan and the distance between the trojan and the inverter. The larger the area of the hardware trojan and the closer it is to the inverter, the greater the change in the inverter's gate delay. It is known that an inverter has a certain sensing range for hardware trojans, and the inverter's sensing ability for hardware trojans weakens with increasing distance between the inverter and the hardware trojan.
[0055] The gate delay formula for the inverter is shown in formula (1):
[0056]
[0057] Among them, t pd For the propagation delay time, C L For the load capacitance, V dd V is the supply voltage, W / L is the width-to-length ratio of the MOSFET channel, k′ is the process transconductance parameter (related to carrier mobility and oxide capacitance per unit area), and V DSAT It is the drain saturation voltage, V th It is the threshold voltage of the MOSFET.
[0058] In this application, the sensing radius is used to quantify the maximum detection range of a single inverter for detecting hardware Trojans. The sensing radius in this application indicates the maximum distance between the inverter and the hardware Trojan when the inverter's detection accuracy of detecting a hardware Trojan exceeds a preset detection accuracy threshold.
[0059] In one alternative implementation, the sensing radius of the target inverter in the ring oscillator can be determined by the following steps:
[0060] First, determine the initial oscillation frequency, initial mean, and initial variance of the ring oscillator.
[0061] Wherein, the initial mean and the initial variance are the mean and variance corresponding to the initial oscillation frequency satisfying a Gaussian distribution;
[0062] For example, the oscillation frequency of the ring oscillator is f. For a circuit that does not contain a hardware Trojan, f follows a Gaussian distribution with mean u0 and variance σ0, so the initial mean is u0 and the variance is σ0.
[0063] Next, the distance between the target hardware Trojan and the target inverter is changed sequentially. When the distance between the target hardware Trojan and the target inverter is i units, the average oscillation frequency of the ring oscillator is determined as the target average frequency. Here, i is an integer greater than or equal to 0.
[0064] Specifically, a small hardware trojan, i.e., the target hardware trojan, is placed sequentially at a distance of i units from the target inverter (assuming that the other inverters in the ring oscillator are sufficiently far from the target hardware trojan). The average oscillation frequency of the ring oscillator at this point is recorded as the target frequency average, denoted as u. i In this way, the average value of the target frequency can be obtained each time the distance between the target hardware Trojan and the target inverter is changed, that is, each time i is changed.
[0065] Finally, the sensing radius is determined based on the initial mean, the initial variance, and the multiple target frequency mean values.
[0066] For example, after inserting a target hardware Trojan into a circuit, if the measured mean of the target frequency falls outside two standard deviations of the initial mean, i.e., |u i -u0|≥2σ0 indicates that the mean target frequency is outside the 95% confidence interval; at this point, it is a significant change and not caused by randomness. At this point, the sensing radius R of any inverter in the ring vibrator, i.e., the target inverter, can be obtained according to formula (2).
[0067] R = max{i||u i -u0|≥2σ0} (2)
[0068] The meaning of each letter in formula (2) is explained in the previous embodiment and will not be repeated here.
[0069] Formula (2) can be interpreted as: for each target frequency mean u iIf the absolute value of the difference between the target frequency mean and the initial mean is greater than or equal to twice the initial variance, then the target frequency mean is taken as the potential target frequency mean; the largest i units corresponding to multiple potential target frequency means are taken as the sensing radius R.
[0070] S102, based on the sensing radius and the number of inverters in the ring oscillator, determine the maximum detection area corresponding to the ring oscillator.
[0071] In this application, the square of twice the sensing radius is taken as the detection area of the target inverter; the product of the detection area of the target inverter and the number of inverters in the ring oscillator is taken as the maximum detection area corresponding to the ring oscillator.
[0072] That is, 2R in this application 2 As the detection area of the target inverter, the ring oscillator has N inverters, and in this application, 2N R is used. 2 This represents the largest detection area of the ring oscillator.
[0073] S103, based on the maximum detection area and the detection area of the target circuit, determine the number of targets.
[0074] In this application, the target number indicates the minimum number of ring oscillators required to perform hardware Trojan detection on the area to be tested of the target circuit.
[0075] In one alternative implementation, the target number can be determined in the following ways:
[0076] Divide the area to be detected corresponding to the target circuit by the maximum detection area corresponding to the ring oscillator to determine the quotient and the remainder. If the remainder is zero, the quotient is used as the target number. If the remainder is non-zero, the sum of the quotient and 1 is used as the target number.
[0077] S104, The hardware Trojan in the target circuit is detected by the ring oscillator of the target number.
[0078] Specifically, based on a preset target arrangement order, a number of ring oscillators of the target quantity are deployed in the target circuit to detect hardware Trojans in the target circuit.
[0079] The target arrangement order indicates the arrangement of all the inverters included in the ring oscillator.
[0080] Figure 2 This is a schematic diagram of a target arrangement provided in an embodiment of this application. Figure 2The circle with radius R represents the detection range that the inverter in the ring oscillator can cover; the square within the dashed box represents the positive direction of the target, with all four vertices of the target square lying on the boundary of the circle, and the side length of the positive direction of the target is R. 2 The full name of a ring oscillator is Ring Oscillator, and its abbreviation is RO. Figure 2 RO in the diagram is a ring oscillator.
[0081] Figure 2 The inverters in the ring oscillator are arranged vertically. In actual circuits, the arrangement of the inverters can be changed according to the area and shape of the circuit to be tested.
[0082] To achieve a layout without blind spots, the inverters are arranged using the largest square within the sensing range as the unit. That is, the target square is used as the unit, and the target squares are arranged one after another to ensure that the circuit range to be detected is covered without blind spots.
[0083] Combination Figure 2 As shown, the target arrangement order in this application refers to M1 inverters arranged in the horizontal direction and M2 inverters arranged in the vertical direction, and the two target squares corresponding to two adjacent inverters arranged in the horizontal and vertical directions are tangent.
[0084] Wherein, the target square is a square with the square of the sensing radius as its side length; M1 and M2 are both integers greater than or equal to 1; the product of M1 and M2 is N.
[0085] Figure 3 This is a schematic diagram of a ring oscillation network provided in an embodiment of this application. (In conjunction with...) Figure 3 As shown, after calculating the minimum number of ring oscillators required for hardware Trojan detection on the target circuit's area to be detected, i.e., the number of targets, we can proceed according to... Figure 2 The target arrangement shown arranges all the inverters in a single ring oscillator in sequence; then, each directional unit is arranged according to... Figure 3 The arrangement shown in the diagram enables comprehensive detection of hardware trojans in the target circuit. Figure 3 In this context, RO represents a ring oscillator.
[0086] Traditional methods for detecting hardware trojans embedded in circuits or chips using ring oscillators have the following drawbacks: they have low accuracy in detecting hardware trojans that are small in area and outside the detection range of the ring oscillator; they do not quantify the sensing capability of a single inverter for hardware trojans; they cannot quantify the detection area of a single ring oscillator; and they may result in a waste of the cost of ring oscillators when detecting hardware trojans.
[0087] The hardware Trojan detection method based on a ring oscillator disclosed in this application determines the maximum distance between the target inverter and the hardware Trojan when the detection accuracy of the target inverter in the ring oscillator is greater than a preset detection accuracy threshold, i.e., determining the sensing radius of the target inverter in the ring oscillator; based on the sensing radius and the number of inverters in the ring oscillator, determining the maximum detection area corresponding to the ring oscillator; based on the maximum detection area corresponding to the ring oscillator and the area to be detected in the target circuit, determining the minimum number of ring oscillators required, i.e., the target number; and using the target number of ring oscillators, detecting the hardware Trojan in the target circuit.
[0088] The detection method disclosed in this application can detect small-area, highly concealed hardware Trojans in the detection circuit. It can quantify the number of ring vibrators required while satisfying the requirement for comprehensive detection of the detection circuit. It solves the problems of traditional solutions, which use too few ring vibrators to comprehensively detect hardware Trojans in the circuit, or the problems of traditional solutions using too many ring vibrators, resulting in wasted ring vibrator costs. It achieves the goal of high-precision detection of hidden hardware Trojans installed in the circuit with as few ring vibrators as possible.
[0089] Based on the hardware Trojan detection method for ring oscillators disclosed in the foregoing embodiments, this application also discloses a hardware Trojan detection device for ring oscillators. Figure 4 This is a schematic diagram of a hardware Trojan detection device based on a ring oscillator, provided as an embodiment of this application. (Combined with...) Figure 4 As shown, the hardware Trojan detection device 400 disclosed in this application includes:
[0090] The sensing radius determination module 401 is used to determine the sensing radius of the target inverter in the ring oscillator; the target inverter is any one of the N inverters included in the ring oscillator; N is an odd number greater than or equal to 1; the sensing radius indicates the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the inverter in detecting the hardware Trojan is greater than a preset detection accuracy threshold.
[0091] The detection area determination module 402 is used to determine the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator;
[0092] The target number determination module 403 is used to determine the target number based on the maximum detection area and the area to be detected of the target circuit; the target number indicates the minimum number of ring oscillators required to perform hardware Trojan detection on the area to be detected;
[0093] The hardware Trojan detection module 404 is used to detect hardware Trojans in the target circuit by means of the number of target ring oscillators.
[0094] In one alternative implementation, the sensing radius determination module 401 includes:
[0095] The parameter determination unit is used to determine the initial oscillation frequency, initial mean, and initial variance of the ring oscillator; the initial mean and initial variance are the mean and variance corresponding to the initial oscillation frequency satisfying a Gaussian distribution.
[0096] The target frequency average determination unit is used to sequentially change the distance between the target hardware Trojan and the target inverter, and when the distance between the target hardware Trojan and the target inverter is i units, determine the average oscillation frequency of the ring oscillator as the target frequency average; where i is an integer greater than or equal to 0.
[0097] The sensing radius determination unit is used to determine the sensing radius based on the initial mean, the initial variance, and the average values of multiple target frequencies.
[0098] In one alternative implementation, the sensing radius determination unit includes:
[0099] The potential target frequency mean determination subunit is used to determine the target frequency mean as the potential target frequency mean if the absolute value of the difference between the target frequency mean and the initial mean is greater than or equal to twice the initial variance for each target frequency mean.
[0100] The sensing radius determination subunit is used to take the largest i units corresponding to the average frequency of multiple potential targets as the sensing radius.
[0101] In one alternative implementation, the detection area determination module 402 includes:
[0102] The first area determination unit is used to take the square of twice the sensing radius as the detection area of the target inverter;
[0103] The second area determination unit is used to take the product of the detection area of the target inverter and the number of inverters in the ring oscillator as the maximum detection area corresponding to the ring oscillator.
[0104] In one alternative implementation, the hardware Trojan detection module 404 includes:
[0105] The hardware trojan detection submodule is used to deploy the target number of ring oscillators into the target circuit based on a preset target arrangement order, and to detect hardware trojans in the target circuit; the target arrangement order indicates the arrangement of all inverters included in the ring oscillator.
[0106] In one alternative implementation, the target number determination module 403 includes:
[0107] The divisor determination unit is used to divide the area to be detected by the largest detection area to determine the quotient and the remainder.
[0108] The first target number determination unit is used to take the quotient as the target number if the remainder is zero.
[0109] The second target number determination unit is used to take the sum of the quotient and 1 as the target number if the remainder is non-zero.
[0110] Based on the hardware Trojan detection method and apparatus based on a ring oscillator provided in the foregoing embodiments, this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the aforementioned hardware Trojan detection method based on a ring oscillator.
[0111] Based on the hardware Trojan detection method and apparatus based on a ring oscillator provided in the foregoing embodiments, this application also provides an electronic device, including:
[0112] A memory on which computer programs are stored;
[0113] A processor is configured to execute the computer program in the memory to implement some or all of the steps in the hardware Trojan detection method based on a ring oscillator provided in the foregoing embodiments.
[0114] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. The components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment solution according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0115] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A hardware Trojan detection method based on a ring oscillator, characterized in that, The method includes: Determine the sensing radius of the target inverter in the ring oscillator; the target inverter is any one of the N inverters included in the ring oscillator; N is an odd number greater than or equal to 1; the sensing radius indicates the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the inverter in detecting the hardware Trojan is greater than a preset detection accuracy threshold. Based on the sensing radius and the number of inverters in the ring oscillator, determine the maximum detection area corresponding to the ring oscillator; Based on the maximum detection area and the area to be detected of the target circuit, the number of targets is determined; the number of targets indicates the minimum number of ring oscillators required to perform hardware Trojan detection on the area to be detected. The target number of ring oscillators are used to detect hardware Trojans in the target circuit.
2. The method according to claim 1, characterized in that, Determining the sensing radius of the target inverter in the ring oscillator includes: Determine the initial oscillation frequency, initial mean, and initial variance of the ring oscillator; the initial mean and initial variance are the mean and variance corresponding to the initial oscillation frequency satisfying a Gaussian distribution; The distance between the target hardware Trojan and the target inverter is changed sequentially. When the distance between the target hardware Trojan and the target inverter is i units, the average oscillation frequency of the ring oscillator is determined as the target average frequency; where i is an integer greater than or equal to 0. The sensing radius is determined based on the initial mean, the initial variance, and the mean values of multiple target frequencies.
3. The method according to claim 2, characterized in that, Determining the sensing radius based on the initial mean, the initial variance, and multiple target frequency means includes: For each target frequency mean, if the absolute value of the difference between the target frequency mean and the initial mean is greater than or equal to twice the initial variance, then the target frequency mean is taken as the potential target frequency mean. The largest i-th unit corresponding to the average frequency of multiple potential targets is taken as the sensing radius.
4. The method according to claim 1, characterized in that, The determination of the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator includes: The square of twice the sensing radius is taken as the detection area of the target inverter; The product of the detection area of the target inverter and the number of inverters in the ring oscillator is taken as the maximum detection area corresponding to the ring oscillator.
5. The method according to claim 1, characterized in that, The detection of hardware Trojans in the target circuit using the specified number of ring oscillators includes: Based on a preset target arrangement order, the target number of ring oscillators are arranged in the target circuit to detect hardware Trojans in the target circuit; the target arrangement order indicates the arrangement of all inverters in each ring oscillator.
6. The method according to claim 5, characterized in that, The order of the targets includes: M1 inverters are arranged horizontally, and M2 inverters are arranged vertically. The two target squares corresponding to two adjacent inverters arranged in the horizontal and vertical directions are tangent to each other. The target squares are squares with the square of the sensing radius as the side length. M1 and M2 are both integers greater than or equal to 1. The product of M1 and M2 is N.
7. The method according to any one of claims 1-6, characterized in that, Determining the number of targets based on the maximum detection area and the area to be detected of the target circuit includes: Divide the area to be detected by the maximum area to be detected to determine the quotient and the remainder; If the remainder is zero, then the quotient is taken as the target number; If the remainder is non-zero, then the sum of the quotient and 1 is taken as the target number.
8. A hardware Trojan detection device based on a ring oscillator, characterized in that, The device includes: The sensing radius determination module is used to determine the sensing radius of the target inverter in the ring oscillator; the target inverter is any one of the N inverters included in the ring oscillator; N is an odd number greater than or equal to 1; the sensing radius indicates the maximum distance between the inverter and the hardware Trojan when the detection accuracy of the inverter in detecting the hardware Trojan is greater than a preset detection accuracy threshold. The detection area determination module is used to determine the maximum detection area corresponding to the ring oscillator based on the sensing radius and the number of inverters in the ring oscillator; The target number determination module is used to determine the target number based on the maximum detection area and the area to be detected of the target circuit; the target number indicates the minimum number of ring oscillators required to perform hardware Trojan detection on the area to be detected; The hardware Trojan detection module is used to detect hardware Trojans in the target circuit by using the number of target ring oscillators.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-7.