## 4 Experiments
### Comparative Analysis of ECDSA and RSA Cipher Suites for the Obtained Results  
The obtained results show huge differences for the same security level when comparing ECC and RSA, being ECC a better alternative, since it presents less energy consumption and higher data throughput values. However, the results also present interesting findings when different implementations and key sizes of the same algorithm are compared.  
Regarding ECC curves, the most interesting finding is the fact that the security level provided by a curve is not always proportional to its performance. With the ESP32-IDF version used for the tests in this article, the secp256r1 curve presented lower energy consumption and higher throughput values than the weakest secp224r1 curve when the SoC is running at 240 MHz. This fact is explained because the software optimizations performed to speed up the mathematical operations of the algorithms involved in the curves are platform and curve dependent. This fact was empirically demonstrated by repeating the same test with the NIST modulo \(p\) optimizations disabled, causing the secp256r1 curve to consume more energy than the secp224r1 curve.  
With respect to the RSA key sizes, the main problem is that, for a 3072-bit key size, it was not possible to use the hardware acceleration for Multi-precision integer (MPI) operations, which would have a great impact on speeding up RSA calculations and, consequently, reducing energy consumption.  
When comparing the general performance of the two tested ciphers suites, it can be concluded that, for the same security level, ECDHE-ECDSA-AES256-GCM-SHA384 always outperforms ECDHE-RSA-AES256-GCM-SHA384 in both energy consumption and throughput.  
When taking into account the SoC frequency, another interesting behavior was discovered: increasing the frequency, instead of increasing the energy consumption (as it may be expected), actually improved energy efficiency in all tested configurations. Similarly, as discussed in Section 4.3, it was observed that the SoC frequency also has a major impact on the time per request required when carrying out HTTPS communications. Therefore, the increase in energy consumption caused by using a higher frequency is compensated with shorter communications times, resulting in a reduction of the total energy consumption. Moreover, the obtained results show the impact of the ECC NIST modulo \(p\) optimizations on different curves and confirmed the platform and curve dependency of this type of  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & \multicolumn{3}{c|}{**RSA Key Sizes**} & \multicolumn{3}{c}{**ECC Curves**} \\ \hline
**Frequency (MHz)** & **RSA 1024** & **RSA 2048** & **RSA 3072** & **prime192v1** & secp224r1 & secp256r1 & secp384r1** \\ \hline
80 & 2.11 & 3.33 & 7.51 & 1.21 & 1.84 & 2.31 & 3.23 \\ \hline
160 & 1.16 & 1.86 & 3.84 & 0.83 & 1.16 & 1.27 & 1.75 \\
240 & 0.89 & 1.21 & 2.63 & 0.55 & 0.99 & 0.88 & 1.20 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Average time per request (seconds) for the tested RSA key sizes, ECC curves and SoC frequency combinations.  
optimizations. Specifically, when running the SoC at 80 MHz, the secp256r1 performed worse than the secp224r1 curve, but when rising the frequency to 240 MHZ the secp256r1 outperformed the weakest secp224r1. This fact, along with the test performed with the NIST modulo \(p\) optimizations disabled, confirmed that the observed behavior was produced by these optimizations.