# Evaluating the Performance of Lightweight Ciphers in Constrained Environments--The Case of Saturnin
## 3 Evaluating the Performance  
### Methodology--The Testing Environment  
Towards studying the performance of Saturnin in a restricted environment for IoT applications, we utilized an ESP8266 System on a Chip (SoC), the Node MCU 0.9 [11]. The ESP8266's CPU is a Tensilica L106 32-bit micro controller (MCU) which also has an embedded Wi-Fi transceiver. It has eleven GPIO (General Purpose Input/output) pins,and one analog input. Finally, it has one micro-USB port, which is used for power and for communicating with a PC (through serial terminal). The Node MCU is compatible with any Arduino board. Hence, it can be expanded with various modules connected to its GPIO pins, like Bluetooth, cameras, etc. It also has full network capabilities through Wi-Fi and it can operate either as a server or a client. The Tensilica L106 32-bit RISC processor is able to reach clock speeds up to 160 MHz, whereas the maximum RAM for applications is 80 Kbytes. Because of its full network capabilities through WIFI and its limited RAM and CPU speed, it is ideal for studying the performance! of Saturnin in lightweight environments. To program the board, the Arduino framework has been used, which is a standard framework for microcontrollers. Indeed, Arduino has been widely used for testing and evaluating standard cryptographic algorithms, as well as lightweight cryptographic algorithms (see, e.g., [12, 13, 14]), whilst it is also used in projects employing blockchain technology (see, e.g., [15]). It has thousands of libraries, most of them being cross-platform. In our case, we used, for the AES encryption, the so-called \"crypto library\". Its programming language is called \"wiring\" and it is a dialect of C++. For compilation, the framework uses the native C compiler of the board to produce machine code and make the final firmware. Our testing environment consists of two applications:  
1. The desktop application, called \"cipher network client\". It runs on a PC and sends requests to the ESP8266 board. 2. The \"nodemcu\" application called \"esp cryptoserver\". It operates as a server, replying to client requests after performing the necessary encryption. For the desktop (\"client\") application, we used C++ as programming language and the Qt framework [16] for the GUI (graphical user interface). Qt is a cross platform framework, under GPL license, able to be deployed across all major operating systems. For the AES part, we choose an implementation being called \"Tiny AES\" [17], which is a free public portable implementation of the AES in portable C. It supports various modes of operation like ECB, CTR and CBC, whereas this implementation has been verified against the relevant test vectors provided by the NIST. By utilizing this implementation, we avoided using the implementation that the operating system offers, which may implement certain hardware acceleration for AES and, thus, could highly affect the accuracy of our comparative study. Similarly, for the Saturnin algorithm, we used the original implementation in portable C, i.e., the one submitted to the NIST by the Saturnin development team, and not any implementation using hardware-specific commands. A screenshot of the desktop client is shown in Figure 1.  
When the <<connect to server>> button is pressed, the client sends requests with the original message to the server (ESP8266) through Wi-Fi and receives three answers: one with the message in an unencrypted form, one with the message being encrypted with AES and one with the message being encrypted with Saturnin. It measures the total time for each answer and prints it on the screen. The \"nodemcu\" (ESP8266) application operates as a server and it is written in C++ using the Arduino framework. We used Visual Studio Code [18] with the PlatformIO extension [19]. The compilation to machine code, the preparation of the firmware and its uploading to the board have been automatically performed by the IDE. For the AES encryption, we used the \"crypto\" library for the Arduino framework, in AES CTR (CounTeR) mode.