You are on page 1of 3

1350911x, 2022, 5, Downloaded from https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/ell2.12405 by National Medical Library The Director, Wiley Online Library on [18/12/2022].

See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
Design and analysis of hardware Trojans in
approximate circuits
Yuqin Dou,1 Chenghua Wang,1 Chongyan Gu,1,2
Máire O’Neill,2 and Weiqiang Liu1,✉
1
College of Integrated Cricuits, Nanjing University of Aeronautics and
Astronautics, Nanjing, China
2
Centre for Secure Information Technologies (CSIT), Queens University
Belfast, Belfast, UK
✉ Email: liuweiqiang@nuaa.edu.cn

Approximate computing can accept errors in computation systems to


achieve better utilisation of hardware resources. Approximate com-
puting has been successfully developed in integrated circuits, such as
approximate arithemtic circuits and approximate accelerators. Unfor-
tunately, recent works show that approximate circuits also have se-
curity vulnerabilities. Hardware Trojan is one of the biggest threats
to hardware security. However, very limited research has been con-
ducted on hardware Trojans in approximate circuits. In this letter, two Fig. 1 Approximate 4-bit low-part-or-adder (LOA) adder with HT inserted.
types of hardware Trojans, namely Function-destructive Trojans and The function of the Trojan is to flip the output of y0 when a0 = b0 = 1
Information-leaking Trojans, are presented. The Trojans are designed
based on the characteristics of approximate circuits. The effectiveness Table 1. Model description
of the hardware Trojans are analysed using the evaluation metrics for
approximate circuits. Attack model Key features

Tamper approximate Assumption (1) The netlist/RTL of the approximate


Introduction: Approximate computing is considered to be one of the circuit function circuit is a white box; (2) The attack
most effective methods to address the power issues of integrated cir- can occur in the manufacturing or
cuits. It can achieve a new trade-off between power consumption and testing phase;
performance by sacrificing little accuracy [1]. Approximate computing Attack method Use Trojan circuit to flip the output of
has been successfully applied to approximate arithmetic unit, approxi- the circuit;
mate fast Fourier transform (FFT) [2], approximate neural network ac-
celerator, etc. Although approximate circuits has been widely developed,
they also introduce new security issues [3]. This is mainly because the mean squared error (MSE), error probability (EP), and worst case BFE
inherent errors in the approximate circuit may be exploited by malicious (WCBFE), which are also the metric used to test approximate circuits in
attackers [3]. Therefore, the security of approximate circuits should be [7] and [8]. The definition of these metrics can be found in [7].
investigated. Yellu et al.[4] investigated several potential threat models
and countermeasures for approximate circuits. Regazzoniet al.[5] pre- Hardware Trojan: Hardware Trojan (HT) refers to a redundant circuit
sented that the approximate circuit may have the threat of leaking infor- with a certain malicious function that an attacker deliberately inserts in
mation, but no specific design was provided. Dou et al. [6] pointed out the original circuit design for a certain purpose. Generally, HTs can be
that approximate adder circuits may be vulnerable to hardware Trojans divided into Function-destructive Trojan and Information-leakage Tro-
than exact adder circuits. However, it lacks detailed analysis of the hard- jan according to their payload logic.
ware Trojan inserted in the approximate circuit. Hence, the introduction
of approximate computing to hardware circuits not only brings advan- Function-destructive Trojan in approximate circuit: Function-
tages, but also new security issues, which have not been studied in depth. destructive Trojans aim to destroy the function and then affect the
Hardware Trojan is one of the biggest threats to hardware security. The performance of circuits. This is usually achieved by adding or deleting
Trojan attacks to exact circuits is usually achieved by flipping the output the circuit structure. For example, in an exact adder, the logic function
of the circuit. However, the error tolerance of approximate circuits may can be destroyed by tampering the output of the exact adder which
result in non-functional for attacks since some erroneous outputs are ac- changes the original defined truth table. However, an approximate
ceptable by approximate circuits. The effectiveness of hardware Trojans circuit, its computation capability and quality are determined by error
to approximate circuits is worth further investigation. Therefore, a com- metrics. A Function-destructive Trojan inserted into an approximate
prehensive consideration is needed to analyse the vulnerability of the circuit may have a different result while an exact circuit has only
approximate circuit to hardware Trojan insertion. one fixed result. A systematic analysis is essential to understand the
In this letter, two different types of hardware Trojan circuits, namely effectiveness of Function-destructive Trojans to approximate circuits.
Function-destructive Trojan and Information-leakage Trojan, are pro- A low-part-or-adder (LOA)1 based approximate adder proposed by [9]
posed and inserted into approximate circuits. This letter analyses secu- shown in Figure 1 is utilised as an example. Table 1 lists our hypothetical
rity vulnerabilities of approximate circuits to hardware Trojan insertions attack model.
based on the metrics of approximate circuits. It is expected to provide In Figure 1, a 4-bit LOA approximate adder is inserted a Trojan to
instructions for designers to understand the security threats in approx- the least significant bit. The corresponding error metrics are shown in
imate circuits and consider thorough detection techniques in the future Table 2. This work adopts the Type-2 2 Trojan proposed in [10] as an
circuit designs. example. The trigger circuit of the HT is composed of an AND gate, and
the payload circuit is composed of an XOR gate. The attack principle
of this HT is as follows. When the inputs of the approximate circuit are
The error metrics of approximate circuits: In approximate circuits, dif-
ferent approximation methods can introduce different errors into the ap-
proximate circuit. Therefore, unlike exact circuits, approximate circuits 1
The most significant bits of the output are implemented using an
do not have a uniform truth table to describe their functions, so their exact adder design while the least significant bits are computed by
computation capability is determined by error metrics [7]. OR gates.
The commonly used metrics of approximate circuits include error 2
A Type-n Trojan is defined as a combinational hardware Trojan of
magnitude (EM), worst case error (WCE), mean absolute error (MAE), order n and has n trigger inputs

ELECTRONICS LETTERS March 2022 Vol. 58 No. 5 wileyonlinelibrary.com/iet-el 197


1350911x, 2022, 5, Downloaded from https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/ell2.12405 by National Medical Library The Director, Wiley Online Library on [18/12/2022]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
Table 2. Approximate circuit error metrics with or without HT in- Table 3. Model description
serted. The trigger condition is a0 = b0 = 1
Attack model Key features
WCE MAE WCBFE EP MSE
Output key Assumption (1) Untrusted foundry can access the
HT-free 6 384 2 0.218 95.75 locked netlist;(2) The location of the
tamper-proof memory can be
HT-FA1 5 320 2 0.218 101.25 determined;(3) The detailed error
analysis report of this circuit can be
HT-FA2 4 384 2 0.1875 95.75
obtained;
HT-FA3 10 480 3 0.218 103.75
Attack method Use Trojan to output key;
HT-FA4 14 704 4 0.218 127.75

Fig. 2 The proposed two Information-leaking Trojans on an approximate 4-


bit adder with a logic lock K: (a) an always-on Trojan is inserted having a
single metric WCE. Knowing the input of a0 and b0 and the output of y0 , it
is easy to reveal the key value K of the key. (b) A Trojan is inserted having
multiple metrics. The Trojan can output the value of K from the main out-
put of y2 when the input satisfies a0 = b0 = a1 = b1 = 1, a2 = b2 = a3 =
b3 = 0 Fig. 3 The effectiveness of the logic lock key introduced in Figure 2

a0 = b0 = 1, the HT will flip the output y. The corresponding metrics


with the HT inserted are presented in Table 2. output. In [11], it is assumed that the attacker can obtain the test vec-
Table 2 shows the metric changes when the trigger condition a0 = tor in the test phase, and then the activation vector of the Trojan can
b0 = 1 is satisfied. Note that the smaller the error metric, the higher the be designed to avoid detection in the test phase. However, it is difficult
accuracy of an approximate circuit. As shown in Table 2, it can be seen to ensure that the test vector is easily available. There is no guarantee
that when the Trojan’s payload circuit is inserted to FA1, all the metrics that the output of the key will not affect the desired result of the circuit.
of the approximate circuit except EP are changed. Only the MSE become Approximate circuits which can accept errors may bring new opportu-
larger, which means that the HT is only valid for MSE. When the HT is nities to attackers. Therefore, according to the different test methods of
inserted to FA2, only the WCE and EP are changed, but they have be- the approximate circuit or the application-oriented difference, two cases
come smaller, which means that the HT does not affects the function of are considered: Single Metric WCE and Multi-metric. The Single Metric
the approximate circuit, and at the same time improves the performance WCE means that only WCE metric is considered when the approximate
of the approximate circuit. When the HT is inserted to both FA3 and FA4, circuit is tested. The Multi-metric represents that the approximate circuit
most of the metrics are changed. It shows that the HT is effective to the considers multiple metrics when it is tested. Table 3 shows our hypo-
outputs y2 and y3 . thetical attack model, which does not require the test vector in the test
In summary, when a Function-destructive Trojan is inserted to an ap- phase. In this model, the attacker is assumed to be an untrusted foundry
proximate circuit, the output of the circuit may be changed but the func- and the foundry can obtain the error analysis report and netlist of the
tion of the approximate circuit could not be affected. Interestingly, some approximate circuit. Figure 3 reflects the effectiveness of the logic lock
HTs may even help to improve the accuracy of approximate circuits. key introduced in Figure 2. It can be seen that only the LOA adder can
Therefore, when the approximate circuit is implanted into a Function- produce an expected result, when the input key is correct.
destructive Trojan, the approximate circuit cannot be destroyed by sim-
ply flip the output. It is necessary to introduce the metric of the approxi- Single metric WCE: The WCE metric is one of the most important met-
mate circuit to validate the effectiveness of the Trojan. rics reflecting the performance of an approximate circuit. Therefore, in
many cases when an approximate circuit is used, only the WCE metric
Information-leakage trojans in approximate circuit: An Information- needs to be considered. In this case, the output of the least significant bit
leakage Trojan targets the part of an original circuit with sensitive in- of the approximate circuit is replaced with the proposed hardware Tro-
formation, such as a key in an encrypted circuit. By modifying the rel- jan. In the approximate circuit, the change of the least significant bit will
evant circuit logic, the selected circuit signal is sent to the attacker via not affect the maximum error of the approximate circuit. The proposed
the side channel information or the output channel of the circuit. An at- hardware Trojan inserted in an LOA adder is shown in Figure 2. The
tacker can analyse this type of information to obtain key information, circuit in red is the proposed Trojan, which is an always-on type. The
such as encrypted keys, and thereby obtaining the encrypted informa- gate K is a tamper-proof memory, in which a secret key is loaded by the
tion in the original circuit. The error tolerance of approximate circuits designer after fabrication and test. When the attacker knows the input,
may provide new opportunity for the Information-leaking Trojans. Two a0 , b0 and the output of y0 , the key K could be revealed. The evaluation
Information-leaking Trojans are designed based on the characteristic of metrics of the approximate circuit inserted by the proposed Trojan with
approximate circuits. The proposed Information-leaking Trojans target single metric WCE are shown in Table 4. The WCE of the approximate
at logic locking, which has become a widely accepted hardware obfus- 4-bit adder with the Trojan does not exceed the WCE of the approximate
cation technology. Reference [11] is to output the logic lock key through 4-bit adder without Trojan no matter the key is 1 or 0. It means that the
the main output of the circuit through a Trojan. Once the Trojan is ac- Trojan have no effect on the function of the approximate circuits. The
tivated, a direct tampering attack will leak the key directly to the main circuit can easily pass the test [8] (as long as the result under the test

198 ELECTRONICS LETTERS March 2022 Vol. 58 No. 5 wileyonlinelibrary.com/iet-el


1350911x, 2022, 5, Downloaded from https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/ell2.12405 by National Medical Library The Director, Wiley Online Library on [18/12/2022]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
Table 4. The evaluation metric when the approximate circuit is im- metrics are calculated by traversing all inputs, which must include the
planted in the trojan for a single metric WCE test vector required for the test.

WCE MAE WCBFE EP MSE Conclusion: In this work, we classify the HTs into Function-destructive
HT-free 6 384 2 0.218 95.75 Trojans and Information-leaking Trojans according to their functions,
and then design and implant them into approximate circuits, respec-
k=0 6 512 2 0.3125 83.75 tively. The error metrics of the approximate circuit are used to analyse
k=1 5 352 2 0.4063 107.75 the security vulnerabilities of approximate circuits to HT insertions.
Finally, through analysis, we find that the Function-destructive Trojan
cannot simply change the output to destroy the quality of the approxi-
mate circuit, as the quality of the approximate circuit is determined by
the error metric. Arbitrarily change the output of the approximate circuit
may even improve the accuracy of the approximation circuit, which is
contrary to the purpose of the Trojan destruction function. This means
that the implantation of a Function-destructive Trojan in an approximate
circuit becomes more difficult than an implantation in an accurate
circuit. However, the approximate circuit provides new opportunities for
the Information-leakage Trojan. The work also proposed two methods
for designing Information-leaking Trojans, which can leak keys without
affecting the function of approximate circuits.

Acknowledgement: This work has been funded by NSFC (62022041).

© 2021 The Authors. Electronics Letters published by John Wiley &


Fig. 4 The output results of (a) a exact circuit, and (b) an approximate circuit Sons Ltd on behalf of The Institution of Engineering and Technology
This is an open access article under the terms of the Creative Commons
Table 5. The evaluation metric when the approximate circuit is im- Attribution-NonCommercial-NoDerivs License, which permits use and
planted in the trojan for multiple metrics distribution in any medium, provided the original work is properly cited,
the use is non-commercial and no modifications or adaptations are made.
WCE MAE WCBFE EP MSE
Received: 22 November 2021 Accepted: 29 November 2021
HT-free 6 384 2 0.218 95.75 doi: 10.1049/ell2.12405
k=0 6 384 2 0.218 95.75

k=1 6 380 2 0.218 95.6875 References


1 Camus, V., Cacciotti, M., Schlachter, J., Enz, C.: Design of approximate
circuits by fabrication of false timing paths: the carry cut-back adder.
vector does not exceed the pre-determined WCE value, it is a qualified IEEE Jour. Emer. Select. Top. Circu. Syste. 8, 746–757 (2018)
circuit). 2 Liu, W., Liao, Q., Qiao, F., Xia, W., Wang, C., Lombardi, F.: Approxi-
mate designs for fast fourier transform (FFT) with application to speech
recognition. IEEE Trans. Circuits Syst. I-Regul. Pap. 66, 4727–4739
Multi-metric: According to the results in Table 4, when only a single
(2019)
metric WCE is considered, the proposed Trojan is effective. The next is
3 Liu, W., Gu, C., O’Neill, M.Q.G., Montuschi, P., Lombardi, F.: Se-
to evaluate whether the proposed Trojan is still effective when multiple
curity in approximate computing and approximate computing for se-
metrics are considered in the test. curity: challenges and opportunities. Proc. IEEE 108, 2214–2231
In the design of an approximate circuit, it has an inherent error un- (2020)
der a specific input. As shown in Figure 4(a), for an exact circuit, there 4 Yellu, P., Monjur, M.R., Kammerer, T., Xu, D., Yu, Q.: Security threats
are only two results, one is the correct result (O) by normal operation, and countermeasures for approximate arithmetic computing. Proceed-
and the other is the wrong result (Oe ) after being attacked. These two ings of the Asia and South Pacific Design Automation Conference
results are different. However, an approximate circuit will encounter dif- (ASP-DAC), Beijing, China, January pp. 259–264 (2020)
ferent scenarios. An approximate circuit may produce a wrong result 5 Regazzoni, F., Alippi, C., Polian, I.: Security: the dark side of approxi-
(Oa ) compared to the correct result (O) under a normal operation. How- mate computing? IEEE ACM International Conference on Computer-
ever, this result (Oa ) is acceptable to the approximate circuit. Hence, the Aided Design, Digest of Technical Paper (ICCAD), San Diego, CA,
approximate circuit can be considered as the case of Figure 4(b). One USA, November 5, pp. 1–6 (2018)
is an acceptable result (Oa ) under normal operation, and the other is the 6 Dou, Y., Yu, S., Gu, C., O’Neill, M., Wang, C., Liu, W.: Security analysis
correct result (O) after being attacked. The acceptable result and the cor- of hardware trojans on approximate circuits. Proceedings of the ACM
rect result here are also different. Great Lakes Symposium VLSI (GLSVLSI), Virtual, Online, China,
Based on the characteristics of the approximate circuit, we can use a September 9, pp. 315–320 (2020)
special input as the trigger condition in the design of the Information- 7 Traiola, M., Virazel, A., Girard, P., Barbareschi, M., Bosio, A.: A survey
leakage Trojan, and the corresponding output channel of the accept- of testing techniques for approximate integrated circuits. Proc. IEEE
108, 2178–2194 (2020)
able result as a key output channel (the special channel can be obtained
8 Gebregiorgis, A., Tahoori, M.B.: Test pattern generation for approxi-
from the netlist or error analysis report provided by the designer.). For
mate circuits based on boolean satisfiability. Proceedings of the Design,
example, in the LOA adder as shown in Figure 2(b), when the input
Automation and Test in Europe Conference and Exhibition (DATE), pp.
satisfies a0 = b0 = a1 = b1 = 1, a2 = b2 = a3 = b3 = 0, the output y2
1028–1033 (2019)
must be an acceptable; however, it is an erroneous result. The red cir- 9 Liu, W., Chen, L., Wang, C., O’Neill, M., Lombardi, F.: Design and
cuit in Figure 2(b) is the Trojan we designed. When the input satisfies analysis of inexact floating-point adders. IEEE Trans. Comput. 65, 308–
a0 = b0 = a1 = b1 = 1, a2 = b2 = a3 = b3 = 0, the key is output from 314 (2016)
the multiplexer inserted to the output(y2 ) of FA3. 10 Zhou, Z., Guin, U., Agrawal, V.D.: Modeling and test generation for
The error metrics of the approximate circuit with the proposed Trojan combinational hardware Trojans. Proceedings of the IEEE VLSI Test
are shown in Table 5. It can be seen that it does not affect the error Symposium (VTS), pp. 1–6 (2018)
metrics of the approximate circuit no matter the key is 0 or 1. Therefore, 11 Jain, A., Zhou, Z., Guin, U.: TAAL: Tampering attack on any key-based
this Trojan does not produce unexpected results, even if the Trojan is logic locked circuits. ACM Transact. Des. Automat. Electron. Syst. 26,
activated. Similarly, the Trojan can pass the testing in [8] as these error 1–22 (2021)

ELECTRONICS LETTERS March 2022 Vol. 58 No. 5 wileyonlinelibrary.com/iet-el 199

You might also like