Skinny-C
 All Data Structures Files Functions Variables Groups Pages
Skinny-C on Arduino

The Skinny-C repository contains a cut-down implementation of Skinny-64, Skinny-128, and Mantis-8 for Arduino devices. The source code is under the arduino/libraries/Skinny directory, and uses the framework of Rhys Weatherley's cryptography library for Arduino.

The Arduino version of Skinny-C uses C code for 32-bit ARM platforms and inline assembly for AVR platforms. The plain C version was too slow on AVR to be of practical use.

To install the library, copy the contents of the "arduino/libraries/Skinny" directory to "sketchbook/libraries/Skinny" on your system. You should then be able to load and compile the examples from within the Arudino IDE.

Performance

The following figures are for the AVR-based Arduino Uno running at 16 MHz, compared against the ChaCha20 and Speck implementations from the basic framework:

Encryption AlgorithmEncryption (per byte)Decryption (per byte)Key SetupState Size (bytes)
Skinny-128 (128-bit key, ECB mode)23.09us23.13us150.32us325
Skinny-128 (256-bit key, ECB mode)27.56us27.59us493.86us389
Skinny-128 (384-bit key, ECB mode)32.02us32.06us966.91us453
Skinny-64 (64-bit key, ECB mode)11.73us11.75us122.18us133
Skinny-64 (128-bit key, ECB mode)13.13us13.15us345.72us149
Skinny-64 (192-bit key, ECB mode)14.53us14.55us593.15us165
Mantis-8 (128-bit key, 64-bit tweak, ECB mode)14.76us15.75us12.20us34
ChaCha (20 rounds)14.87us14.88us43.74us132
Speck (128-bit key, ECB mode)9.74us10.12us253.94us275
Speck (256-bit key, ECB mode)10.31us10.71us275.26us275
SpeckTiny (128-bit key, ECB mode)33.93us10.22us35
SpeckTiny (256-bit key, ECB mode)36.46us16.89us35

The following figures are for the ARM-based Arduino Due running at 84 MHz:

Encryption AlgorithmEncryption (per byte)Decryption (per byte)Key SetupState Size (bytes)
Skinny-128 (128-bit key, ECB mode)8.67us9.03us35.01us332
Skinny-128 (256-bit key, ECB mode)10.38us10.81us86.34us396
Skinny-128 (384-bit key, ECB mode)12.09us12.59us152.33us460
Skinny-64 (64-bit key, ECB mode)3.14us3.27us25.12us140
Skinny-64 (128-bit key, ECB mode)3.52us3.66us49.30us156
Skinny-64 (192-bit key, ECB mode)3.90us4.05us78.72us172
Mantis-8 (128-bit key, 64-bit tweak, ECB mode)3.93us3.93us5.54us36
ChaCha (20 rounds)0.87us0.88us4.96us136
Speck (128-bit key, ECB mode)0.97us0.96us36.80us288
Speck (256-bit key, ECB mode)1.03us1.01us39.31us288
SpeckTiny (128-bit key, ECB mode)2.72us1.47us48
SpeckTiny (256-bit key, ECB mode)2.90us1.83us48