# Search-Space Reduction for S-Boxes Resilient to Power Attacks
## 3 Our Contributions: Reduction of the S-Boxes Search-Space into a Hamming Weight Class SEARCH-Space
### Experimental Verification That all S-Boxes of a Class Have the Same Resistance to Power Attacks  
SILK is a high level of abstraction simulator that builds a leakage trace based on a source code of an algorithm and several user-defined parameters. As source code, we used the AES cipher, which is executed using a plain text and a key. We also used the default SILK consumption power noise.  
The objective of this experiment was to verify that all the S-boxes of a Hamming weight class have the same resistance to power attacks since they all have the same hypothetical power leakage, according to the Hamming weight leakage model. In particular, it was verified that, with the power leakage traces of an arbitrary S-box \(F_{\alpha}(x)\), the power attack can be performed on all the S-boxes of its class \(<F_{\alpha}>\). The S-box of the AES cryptographic algorithm was selected as S-box \(F_{\alpha}(x)\), taking into account that this S-box is vulnerable to this type of attack. The SILK simulator was used only once to generate the power drain traces of the AES S-box. The proposed HW equivalent relationship theoretically ensure homogeneous DPA resistance within each class. To verify it practically, the following experiment was carried out in two steps:  
Step 1. With the ESboxG algorithm, 1000 S-boxes belonging to the \(<F_{AES}>\) class were generated. The SILK simulator [25] was used to generate the energy leak traces of the AES S-box, using 200 plain texts and the key 00112233445566778899 aabbeccddeeff. We also used the default SILK consumption power noise. Subsequently, the power attack (CPA) was carried out on the 1000 S-boxes, but, in all cases, the energy leakage generated with the SILK Simulator was used for the first S-box.  
It was found that, for each of the 1000 S-boxes generated, the same results were obtained (the correct 16 bytes of the key) as for the first S-box. It is important to note that, in all cases (the 1000 S-boxes), the traces of the first S-box were used. This experimental result confirms that, in practice, HW classes fulfill the theoretically expected property of Section 3.1.  
Step 2. The objective of this second step was to illustrate in practice that Step 1 is not obtained with S-boxes that do not belong to the \(<F_{AES}>\) class. First, 1000 S-boxes not belonging to the \(<F_{AES}>\) class were randomly generated, and the attack was carried out again with the same energy leak traces from step one. Unsurprisingly, no byte was obtained correctly from the key, and the results were different for each S-box.  
Experimental Verification of the Constant Value of Confusion Coefficient Variance CCV within HW Classes  
To experimentally confirm that the CCV metric has a constant value within each HW class, a sample of 4 HW classes were taken: \(<F_{AESCC}>\), \(<F_{SCREAM}>\), \(<F_{AES}>\) and \(<F_{STRIBOG}>\). In each class, 10,000 S-boxes were generated by the ESboxG algorithm, and its CCV value was calculated. The results after experimenting were as expected. For the 10,000 S-boxes, the same constant value of CCV was obtained within the class in each class.  
There are differences between the CCV values of the four analyzed classes.  
* \(CCV(<F_{AESCC}>)=0.149357\);
* \(CCV(<F_{SCREAM}>)=0.121967\);
* \(CCV(<F_{AES}>)=0.111304\); and
* \(CCV(<F_{STRIBOG}>)=0.097765\).  
By decreasing these CCV values, the S-boxes are decreased by their theoretical resistance to power attacks as follows: AESCC, SCREAM, AES and STRING (as in [26]).