Overview of the Day
The second edition of the Theory of Implementations workshop took place in co-location with Real World Crypto in Zurich on Tuesday the 9th of January 2018, organized by Svetla Nikova and Vincent Rijmen. Contrary to the first edition, only invited talks were scheduled, with speakers from both academic and industrial backgrounds.

The workshop was opened with a talk of Vincent Rijmen, in which an overview of results obtained in the NIST-COSIC project on Cryptography secured against Side-Channel Attacks (SCA) and Fault Attacks (FA) by means of Threshold Implementations (TI) was given. The project covers various aspects, from theoretical insights of securing cryptographic algorithms to the development of verification tools for the correct application of the existing countermeasures to real ciphers. Next, Luis Brandao and Apostol Vasilev from NIST gave an overview of the opportunities and challenges encountered when trying to standardize threshold schemes. For the more academic members of the audience, this talk demonstrated nicely how to bridge academic research and applications in industry.
After a great lunch, where even the brightest minds in the room had forgotten what they had ordered in the morning and where we had the opportunity to discuss at length with colleague researchers (even from Japan and Australia), it was time to listen to Chong Hee Kim from Brightsight. The Brightsight talk was rare in the sense that it focused on things that we should not do. We were shown examples of security evaluation in practice, including the problems and pitfalls they experienced in real products. Next, it was time for a more academic talk, given by Nigel Smart from the University of Bristol and KU Leuven. He introduced CAPA, a new combined countermeasure against SCA and FA, based on the MPC protocol SPDZ as well as a new adversarial model known as the “tile-probe-and-fault model”, which extends the established wire-probing model to cover the presence of both passive and active attackers.
After a coffee break, we heard a talk by Amir Moradi from Ruhr-Universität in Bochum, Germany. He demonstrated how threshold implementations (which are originally meant as a protective technique) can be misused to introduce hardware Trojans in an integrated circuit. In the final talk of the workshop, we returned to the evaluation of side-channel resilience with Emmanuel Prouff from ANSSI in France. In this talk, we learned that one can compute the success rate of a side-channel attack without actually having to perform the attack.
Afterwards, we had one final opportunity to discuss possible collaborations before some people had to run to catch their flight. The rest of us took advantage of being in Zurich and went to have a very filling meal of cheese fondue. Though only one day long, the workshop was a very rich experience with talks touching on numerous aspects of side-channel security from different perspectives. Above all, gatherings like these are always a great opportunity to meet researchers with similar interests.
We will now describe the talk by Amir Moradi in more detail.
Threshold Implementation as a Substrate for Hardware Trojans
Hardware Trojans are intentional alterations made to integrated circuits (ICs) or IP cores to establish a backdoor which compromises the security. The malicious modification is made as such that the activation (or trigger) of the Trojan is rare and its detection is challenging. Once the Trojan is triggered, the circuit functionality defined by the Trojan (or payload) takes over from the regular functionality and a wide range of behaviors can be orchestrated. Backdoors included in the Trojan can lead to for example changes in the read-only memory, the hijacking of a CPU or even the destruction of the whole chip.
We were shown how to implement a Hardware Trojan on FPGA platforms by Amir Moradi. This particular Trojan actually turns an advantage of Threshold Implementations against itself, and resulted in a publication at Asiacrypt 2018 authored by Maik Ender, Samaneh Ghandali, Amir Moradi and Christof Paar.
The idea is as simple as it is brilliant: by delaying certain components of the computation that are not required for correct computation but only for providing side-channel security (known as correction terms), leakage of key information through the power consumption side-channel can be activated by increasing the clock frequency.
How does it work?
Consider a circuit implementing a nonlinear function z = Nonlinear_Function(x,y) operating on secret values x and y. In order to avoid the power consumption of this circuit to reveal information on x and y, we apply a (first-order) threshold implementations masking scheme.
To this end, we first split the secret values x and y in uniform random shares x_i and y_i such that x=x_1+x_2+x_3 and y=y_1+y_2+y_3. We then create so-called component functions z_i that operate on these shares such that z=z_1+z_2+z_3. An extra condition we need to impose is the non-completeness property which states that none of the component functions should depend on all three shares of the inputs. This gives the following three component functions.
z_1 = Nonlinear_ComponentFunction_1(x_1, y_1, x_2, y_2)
z_2 = Nonlinear_ComponentFunction_2(x_2, y_2, x_3, y_3)
z_3 = Nonlinear_ComponentFunction_3(x_3, y_3, x_1, y_1)
If we now want to use the shares z_1, z_2 and z_3 as inputs to another nonlinear function (as we usually do in round-based symmetric crypto), we need to make sure these shares are uniform and randomly distributed, just like we imposed on the shares of x and y. One way of achieving this is through so-called correction terms. This particular way of restoring uniformity is one factor that contributes to the popularity and effectiveness of TI.
Assume that we can fix the uniformity using input shares x_1 and y_2 as follows (note that the non-completeness property is respected):
z_1 = Nonlinear_ComponentFunction_1(x_1, y_1, x_2, y_2) + x_1 + y_2
z_2 = Nonlinear_ComponentFunction_2(x_2, y_2, x_3, y_3) + y_2
z_3 = Nonlinear_ComponentFunction_3(x_3, y_3, x_1, y_1) + x_1
The balanced addition of the shares to the component functions ensures that the relation z=z_1+z_2+z_3 remains true because the correction terms will cancel out, i.e. they do not contribute to the correctness of the function. A popular threshold implementation where such a structure can be found is the PRESENT-TI by Poschmann et al. and has been used as basis for many implementations.
Technical stuff
We now pose as a malicious designer to further clarify the Trojan and its trigger. Figure 1 below shows a rather short wire (highlighted in red) that carries the correction term x_1. After a certain delay it arrives and is added to the component function z_3 to make it uniform. We intentionally reroute this wire to make it (substantially) longer and after minimal effort, we get what is shown in the next figure. Due to the increased delay, it now takes a while longer before output z_3 becomes uniform. With some math and some engineering we can create the scenario shown in Figure 3.

Figure 1: A short, red wire carries a correction term

Figure 2: The red wire is extended and its value arrives substantially later as a result

Figure 3: Different scenarios are obtained for different clock frequencies
With normal (Green) use, the circuit works as expected and is secure against side-channel analysis. When we increase the clock frequency (or equivalently, reduce the clock period), we give the component functions less time to finish their computation. For a certain range of clock frequencies (Yellow) the circuit produces wrong (and rather unpredictable) outputs. Due to our careful design of the Trojan, we can create a region (Grey) where the correction terms arrive late, but the rest of the circuit, including the Nonlinear_ComponentFunction_i‘s arrive on time. The function is thus computed correctly but the correction terms were not added! This means that the TI countermeasure is bypassed and successful side-channel analysis is possible! Note that beyond this Grey zone, we have a Red zone where only wrong outputs are obtained as we never give the circuit enough time to compute.
Implications and Concluding remarks
This particular Trojan has very low overhead and can successfully bypass (first-order) threshold implementations that rely on correction terms to achieve uniformity. Both FPGAs and ICs are vulnerable to this hardware Trojan and as it does not add logic to the design but only modifies wire lengths, it can be challenging to detect. In fact, the only indication of the Trojan’s presence is a reduction in the maximum clock frequency of about 10%, which can easily be attributed to the heuristic nature of the placement and routing algorithms.
What is particularly clever about the trigger mechanism is that during side-channel analysis certification, an evaluator will not attempt to test the chip under faulty conditions (i.e. higher clock frequencies). As a result, the Trojan will not be detected.
A proposed mitigation to this threat is to make sure the clock frequency and supply voltage are internally monitored to avoid the SCA-based Trojans from being activated.
However, it is good news that such a powerful potential Hardware Trojan was discovered and is brought to the attention of designers. This way a deeper understanding is formed and more rigorous detection mechanisms can be investigated.
Thanks to Thomas De Cnudde, Lauren De Meyer and Victor Arribas for writing this blog post!


