ASCON Suite
|
This repository builds a number of useful crytographic primitives around the ASCON permutation.
The idea is that if you want to use ASCON in an embedded application, that you copy the suite and the backend of choice to your platform and you'll get pretty much everything you need for symmetric encryption using ASCON.
One of the key goals for this suite is to keep the code size relatively small on embedded platforms while also providing good performance.
The suite has a number of permutation backends for different CPU configurations, which are detailed on the Porting the ASCON Permutation page.
When porting to a new microcontroller, you will probably also need to provide a TRNG backend to access the random number generator on your CPU.
Patches are welcome to provide new permutation and TRNG backends.
ASCON Suite uses cmake to build, so you will need to have that installed. Here is the simplest method to compile, test, and install the library:
mkdir build cd build cmake .. make make test sudo make install
To build with a cross-compiler, set the CC
and CMAKE_C_FLAGS
variables when invoking cmake:
mkdir build cd build CC="avr-gcc" cmake -DMINIMAL=ON -DCMAKE_C_FLAGS="-mmcu=atmega2560" .. make
Note carefully the placement of environment variables before the "cmake" command name, and the cmake variables specified with "-D" after.
The MINIMAL
option suppresses the compilation of shared libraries, examples, and test programs, which may not compile for embedded microcontrollers due to missing libc functions or other platform constraints. Only the static library libascon_static.a
is built in the minimal configuration.
The core ASCON implementation is based on version 1.2 from the final round submission to the NIST lightweight cryptography competition. The following ASCON primitives are provided:
We also provide incremental versions of ASCON-128, ASCON-128a, and ASCON-80pq for encrypting and decrypting extremely large amounts of data in chunks.
The following higher-level extensions are provided:
Other than ISAP-A-128 and ISAP-A-128A, these extensions have not yet been standardised by a public standards body, but I did try to follow general practice when creating such modes. See the individual pages for the design choices that I made. Feedback welcome.
The functionality in this library was originally prototyped in the LWC Finalists repository. This repository extracts and expands the ASCON-specific parts of the original repository.
For more information on these libraries, to report bugs, or to suggest improvements, please contact the author Rhys Weatherley via email.