# Study About the Performance of Ascon in Arduino Devices
## 5 Performance Analysis of the Ascon Implementation
### Measures in the Encryption/Decryption Operations with Ascon
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Variant**} & \multicolumn{4}{c}{**Number of Cycles and Encryptions in the Decryption Process. Arduino Nano Every**} \\ \cline{2-7}  & **\# Cyc. (1 s)** & **\# Dec. (1 s)** & **\# Cyc. (5 s)** & **\# Dec. (5 s)** & **\# Cyc. (10 s)** & **\# Dec. (10 s)** \\ \hline Ascon-128 & 16,010,816 & 73 & 80,053,568 & 365 & 160,108,736 & 730 \\ Average & 219,326 & — & 219,324 & — & 219,327 & — \\ Ascon-128a & 16,075,200 & 79 & 80,173,568 & 394 & 160,145,664 & 787 \\ Average & 203,483 & — & 203,486 & — & 203,488 & — \\ Ascon-80 pq & 16,195,008 & 72 & 80,027,072 & 356 & 160,043,072 & 712 \\ Average & 224,930 & — & 224,795 & — & 224,779 & — \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Number of cycles (Cyc.) and decryptions (Dec.) in the decryption operation in Arduino Mega2560 for the three versions of Ascon. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Variant**} & \multicolumn{4}{c}{**Number of Cycles and Encryptions in the Decryption Process. Arduino Nano Every**} \\ \cline{2-7}  & **\# Cyc. (1 s)** & **\# Dec. (1 s)** & **\# Cyc. (5 s)** & **\# Dec. (5 s)** & **\# Cyc. (10 s)** & **\# Dec. (10 s)** \\ \hline Ascon-128 & 16,053,696 & 78 & 80,037,120 & 389 & 160,065,600 & 778 \\ Average & 205,816 & — & 206,281 & — & 206,270 & — \\ Ascon-128a & 16,054,656 & 84 & 80,055,168 & 419 & 160,102,592 & 832 \\ Average & 191,126 & — & 191,519 & — & 191,739 & — \\ Ascon-80 pq & 16,029,760 & 76 & 80,122,624 & 380 & 160,025,984 & 759 \\ Average & 210,917 & — & 210,849 & — & 210,837 & — \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Number of cycles (Cyc.) and encryptions (Enc.) in the encryption operation in Arduino Nano Every for the three versions of Ascon. In summary, it can be stated that for the four Arduino devices used and for the three Ascon versions, the number of cycles and the number of encryption and decryption operations for the encryption and decryption processes are similar for each period of time considered. Moreover, for all Arduino devices, the Ascon-128a version presents the lowest values in relation to the number of cycles, on average, and the Ascon-80 pq has the biggest values. Considering Tables 7-10, it can be seen that the number of cycles and the number of encryption and decryption operations in each variant of Ascon are very similar for both Arduino Mega2560 and Arduino Nano Every. This is because they are composed by the ATmega2560 and ATmega4809 microcontrollers, respectively. Both are 8-bit microcontrollers, and their clock speed is 16 MHz for Arduino Mega2560 and 48 MHz for Arduino Nano Every. In addition, the first one has 256 KB of flash memory, whereas the second one has 48 KB. For all these reasons, Arduino Nano Every needs slightly fewer clock cycles, on average, to perform the same operations than Arduino Mega2560. In our work, we wish to compare the computing speed of Ascon and AES on different low-cost IoT boards without the help of the possible implementation of cryptographic chips within the processor. For this reason, we do not analyze how much better or worse an 8-bit or 32-bit processor is. In any case, unlike the 8-bit devices, the two 32-bit Arduinos chosen show, as expected, a much higher average clock cycle rate and a much lower number of encryption and decryption operations (see Tables 5, 6, 11 and 12). The main reason for these results is that these two devices have more powerful processors and larger amounts of memory. Furthermore, when comparing the two 32-bit devices, it can be stated that, for both encryption (Tables 5 and 11) and decryption (Tables 6 and 12) operations, the number of clock cycles of the Arduino Nano ESP32 is, on average, slightly lower than that of the Arduino DUE; while the number of encryptions and decryptions of the former is about four times higher than for the latter. In summary, we can say that, among the four devices used, the Arduino Nano ESP32 is the one that performs the highest number of encryption and decryption operations per second.