This is the meta repository for the code accompanying the paper Stateless Hash-Based Signatures for Post-Quantum Security Keys. It ties together all scripts and code needed to reproduce the results.
The relevant code is distributed amongst four repositories:
- sphincsplus - The SPHINCS+ C code, with a tool instantiate and test different parameter sets.
- sphincs_wrapper - The Rust wrapper for SPHINCS+
- OpenSK - OpenSK modified to use Sphincs
- FIDO SPHINCS+ Experiments - This meta repository with benchmarking scripts
The dependencies are included as submodules.
Clone the repo with all submodules:
git clone --recurse-submodules https://github.com/rugo/fido-sphincs-experiments
You need the JLink software for the speed and stack benchmarks. A recent Python version is needed for the helper scripts.
To reproduce the results of the paper, you need an nRF52840 development kit. Connect both USB cables to a host computer.
The parameter file needs to have one SPHINCS+ parameter set per line. Each line needs to contain the following, space separated values:
- Signature size: Given in bytes and rows are sorted by this ascending.
- Signing speed: Number of hash calls for signing. The search is limited to < 10^9 calls, which corresponds to roughly < 1 min signing on a modern CPU.
- Verification speed: Number of hash calls for verification.
- Probability for FORS forgery after 2^y signatures.
- The parameter h in SPHINCS+.
- The parameter d in SPHINCS+.
- The parameter b in SPHINCS+.
- The parameter k in SPHINCS+.
- The parameter w in SPHINCS+.
- Security degradation: The value
zsuch that after 2^z signatures, the forgery probability is still < 2^{-112, -128, -192} (for a security target of 128, 192, 256 bits)
Although (3) and (10) are not used by the tooling. This format is compatible to the one used here. `
Run the run_benchmark.py script with a parameter file of your choice.
Like so:
python3 run_benchmarks.py params/128_10.txt 10-sig
The results will be stored in the results/10-sig folder.
Unfortunately you have to press the board's reset button before the FIDO HID benchmark (make/get) starts. Do so once the script says "Configuring device". This is not needed for the stack and speed benchmarks.
To export the results into one file, use the print_results.py script on the result folder:
p3 print_results.py results/10-sig
This will output a csv file.