# Study About the Performance of Ascon in Arduino Devices
## 5 Performance Analysis of the Ascon Implementation
### Analysis of the Results  
Once we have seen the clock cycle data, we will proceed to a comparative analysis of the algorithm's performance in terms of speed. To do this, we consider the number of encryption and decryption operations shown in Tables 5-12, 16 and 17. Again, we will compare the performance of each Ascon variant in each of the different Arduino devices. The performance of the three versions of Ascon (see Tables 5 and 6) together with a standard implementation of AES-128 (see Tables 16 and 17) on the Arduino DUE is shown in Figure 5. Clearly, all three Ascon versions perform better than AES-128 on the Arduino DUE (the second most powerful board of the four tested), with the Ascon-128a being the fastest version. This is due to the optimization of this feature in its design. A similar graph is shown comparing the speed performance on the Arduino Mega2560 (see Figure 6). In this case, we have used the values for encryption and decryption operations shown in Tables 7, 8, 16 and 17. It is important to note that AES-128 is more efficient than the three versions of Ascon on the Arduino Mega2560. This may be due to the fact that AES implementations have been developed and optimized over many years. Thus, the AES version is probably designed to perform well on a device with the characteristics of the Arduino Mega2560. Even so, Ascon's performance on a device such as the Arduino Mega2560 is still excellent, since the post-quantum security version, Ascon-80 pq, is capable of performing encryption in as little as 0.013 s. \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline
**Algorithm** & \multicolumn{2}{c}{**DUE**} & \multicolumn{2}{c}{**Mega2560**} & \multicolumn{2}{c}{**Nano Every**} & \multicolumn{2}{c}{**Nano ESP32**} \\ \cline{2-9}  & **Stor.** & **Dyn.** & **Stor.** & **Dyn.** & **Stor.** & **Dyn.** & **Stor.** & **Dyn.** \\ \hline Ascon-128 & 14,708 & — & 11,830 & 343 & 13,476 & 343 & 290,553 & 30,736 \\ Ascon-128a & 15,300 & — & 12,990 & 752 & 14,641 & 343 & 291,289 & 30,736 \\ Ascon-80 pq & 14,980 & — & 12,854 & 694 & 14,508 & 351 & 297,329 & 31,112 \\ AES-128 & 21,200 & — & 11,478 & 4922 & 12,826 & 265 & 293,841 & 30,656 \\ \hline \hline \end{tabular}
\end{table} 
Table 18: Space storage (Stor.) and dynamic memory (Dyn.) (in bytes) for the Arduino devices. Figure 7 shows the corresponding comparison about the speed performance on the Arduino Nano Every considering the values for encryption and decryption operations presented in Tables 9, 10, 16, and 17. We have mentioned that Arduino Nano Every is not able to support the considered AES-128 implementation. However, this fact does not affect its behavior in relation to the three Ascon versions, for which excellent results are observed for the performance of a cryptographic algorithm on such a limited device. As can be seen in Figure 7, the three versions of Ascon have a very similar performance to that offered by the Arduino Mega2560, slightly exceeding it. It is important to see how well Ascon performs on a device as small and limited as the Arduino Nano Every. These data are a clear example that Ascon can be easily implemented in a wide range of IoT devices, thus securing the data they handle. Figure 5: Comparison in terms of speed on Arduino DUE. Figure 6: Comparison in terms of speed on the Arduino Mega2560. Finally, Figure 8 shows a comparison of the speed performance on the Arduino Nano ESP32. For this device, we have to consider the values for encryption and decryption operations shown in Tables 11, 12, 16, and 17. Here, we can see that the three versions of Ascon and AES-128 present similar performances for Arduino Nano ESP32, although the performance for AES-128 is slightly lower than for the three versions of Ascon. The collected performance metrics reveal important practical insights into the deployment of Ascon in resource-constrained environments, particularly within the context of embedded and IoT systems.