Skip to content

Reference and optimized implementations of the CROSS post-quantum signature algorithm

License

Notifications You must be signed in to change notification settings

CROSS-signature/CROSS-implementation

Repository files navigation

The submission for CROSS contains the following:

• Reference_Implementation

A reference implementation of the asymmetric signature CROSS as a C11
library.
The reference implementation library does not provide a main() function, and is
intended to be compiled and linked to a binary.
The required NIST API is present in
Reference_Implementation/include/api.h,
The implementation may either use libkeccak, if installed and available
in system-wide searched paths (e.g., /usr/local/include for the
headerfiles and /usr/local/lib for the static library), or employ
the provided fallback implementation for systems where libkeccak is not
available.
If the library is not compiled via the supplied Cmake flow, defining
SHA_3_LIBKECCAK during compilation enables compilation of the codebase
against an available libkeccak installation.

• Optimized_Implementation

An AVX2 optimized implementation of the asymmetric signature CROSS.
The library is organized in the same fashion as the reference one.
The implementation may either use libkeccak, if installed and available
in system-wide searched paths (e.g., /usr/local/include for the
headerfiles and /usr/local/lib for the static library), or employ
the provided fallback implementation for systems where libkeccak is not
available.
If the library is not compiled via the supplied Cmake flow, defining
SHA_3_LIBKECCAK during compilation enables compilation of the codebase
against an available libkeccak installation.

• Additional_Implementations

This directory provides Cmake based building facilites to generate
executable files either performing a benchmark of CROSS, performing unit testing
of the underlying arithmetics or generating the Known Answer Test files in the
KAT folder. Furthermore, we provide the Sage scripts employed to estimate
the cost of attacking the instances of RSDP and RSDPG employed in CROSS.

To build the benchmarking binaries, we advise to build-off tree following this
procedure:

1 - Enter Additional_Implementations/Benchmarking
2 - create a "build" directory and enter it
3 - type cmake ../ to generate the makefiles
4 - type make to compile the codebase

By default, the optimized implementation will be compiled (note that it provides
compatibility fallbacks if AVX2 ISA extensions are not available).
To select the reference implementation for building, add -DREFERENCE=1 to the
command in step 3, i.e., run

cmake ../ -DREFERENCE=1

The KAT_Generation directory is organized in the same fashion as the
Benchmarking one.
The same compilation procedure enacted for the benchmarking binary will generate
all the executable files needed to re-generate the Known Answer Tests files.
Specifically,

1 - Enter Additional_Implementations/KAT_Generation
2 - create a "build" directory and enter it
3 - type cmake ../ to generate the makefiles
4 - type make to compile the codebase

By default, the optimized implementation will be compiled.
To select the optimized implementation for building, add -DREFERENCE=1 to the
command in step 3.
A set of binaries, one for each category-optimization corner-underlying problem
triple will be generated in the bin subdirectory of the build directory.
Running each one of these binaries generates the KATs for the triple.

To alleviate the effort of generating all KATs, a commodity script
which generates them all KATs is provided : gen_all_kat.sh
To use it, after following the aforementioned compilation procedure, change one
directory up from build with

cd ..

and run

./gen_all_kat.sh

All KAT files will be generated in the KAT top-level-directory.


• KAT
The directory contains a set of requests/responses to the Known Answer Tests,
obtainable with the code present in Additional_Implementations/KAT_Generation.
The SHA-2-512 digests of all the files are provided in the sha_2_512_sum_KAT_files
file, and can be verified as:
sha512sum -c sha_512_sum_KATs

• Supporting_Documentation

The PDF document describing the CROSS cryptosystem in detail.

• LICENSE.txt

The file containing the public domain license condition for the portion of the
codebase which was authored by the submitter and implementors.

The code which was not directly authored by the submitters and implementors
is the one relative to AES, SHA-2 and SHA-3: the included implementations were released
by the respective authors under public domain, and the submitters and
implementors hereby re-license the present copy under public domain.

• README

This file.

About

Reference and optimized implementations of the CROSS post-quantum signature algorithm

Resources

License

Stars

Watchers

Forks

Packages

No packages published