# The Need for Speed: A Fast Guessing Entropy Calculation for Deep Learning-Based SCA
## 3 Related Works  
Optimizing performance in DL-based profiling SCA has received significant attention in recent years. Due to the expensive trial-and-error cost in the profiling phase, enhancing the performance in DL-based profiling SCA is challenging. In recent years, the SCA community has considered two main alternatives to improve the attack efficiency: (1) by defining small neural network models that are faster to train and easier to tune [8; 9] and (2) by reducing the number of the required profiling traces during training [19]. Both solutions can have severe impacts on the attack or generalization performance. The first approach may result in models that underfit for more noisy leakages or leakages obtained from other devices (portability problem [20]). The second alternative speeds up the process; still, it may result in limited learnability due to the eventually low number of profiling traces. To obtain small neural network models, one needs to use appropriate techniques. [PERSON] et al. [8] and [PERSON] et al. [21] worked on designing methodologies for finding efficient neural network architectures. They both reported state-of-the-art results at the time while using significantly smaller neural networks than related works. [PERSON] et al. [9] and [PERSON] et al. [22] investigated advanced hyperparameter tuning techniques such as reinforcement learning and Bayesian optimization, respectively. The obtained results managed to further reduce the required number of attack traces to reach GE of 1, but with non-negligible computational complexity due to the tuning procedure. [PERSON] et al. showed that even a random search could find very successful neural network models and that ensembles of neural networks can significantly outperform single models [23]. An alternative approach was followed by [PERSON] et al., where the authors pruned neural networks while maintaining good performance [24]. The authors showed it was possible to remove up to 90% of the neurons and maintain the performance. Besides the methods mentioned above, a third alternative uses efficient and reliable validation metrics to evaluate training and implement faster hyperparameter tuning (which can provide faster convergence) with larger models and larger profiling sets. Empirical GE (described in Section 2.1) can be very expensive to compute with larger validation sets, especially if used during training to detect the best training epoch. In a recent publication, [PERSON] et al. proposed a Guessing Entropy Estimation Algorithm (GEEA) to reduce the computational limitation cost of empirical GE for the full attacked key scenarios, which computes faster than empirical GE calculation on separate key bytes [15]. Indeed, empirical GE executes multiple key rank executions over multiple partitions of the dataset \(V\), each containing \(Q\) measurements. GEEA, on the other hand, only requires one execution over the \(Q\) measurements. Let us consider \(s(k_{g},x_{i},d_{i})\) as a score indicating the probability that a measurement \(x_{i}\) process key \(k_{g}\) for a input (i.e., plaintext) \(d_{i}\). The GEEA first requires the calculation of pairwise subtractions of scores concerning the correct key, resulting in mean and variance for each key guess \(k_{g}\in\mathrm{K}\) as follows:  
\[\mu_{k_{g}}=\frac{1}{Q}\sum_{i=0}^{Q-1}[s(k_{g},x_{i},d_{i})-s(k_{c},x_{i},d_{i})] \tag{3}\]  
\[\sigma_{k_{g}}=\sqrt{\frac{1}{Q}\sum_{i=0}^{Q-1}[s(k_{g},x_{i},d_{i})-s(k_{c},x_ {i},d_{i})-\mu_{k_{g}}]^{2}}, \tag{4}\]  
where \(k_{c}\) is the correct key. Then, the guessing entropy value is obtained as:  
\[GE=1+\sum_{k=0,k_{g}\
eq k_{c}}^{|K|}\Phi\bigg{(}\frac{\sqrt{Q}\mu_{k}}{\sigma_ {k}}\bigg{)}, \tag{5}\]  
where \(\Phi()\) is the cumulative density function of a normal Gaussian distribution \(\mathcal{N}(0,1)\). Alternative solutions were proposed as new validation metrics for early stopping, stopping training sooner, and speeding up the process.