Transactions on Cryptographic Hardware and Embedded Systems, Volume 2024
A Tale of Snakes and Horses: Amplifying Correlation Power Analysis on Quadratic Maps
README
Artifact
This artifact contains the source code and the data to reproduce the results as presented in "A Tale of Snakes and Horses: Amplifying Correlation Power Analysis on Quadratic Maps" at TCHES 2024, Issue 1.
1. Structure
The source code is written in C to exploit power traces to perform the Correlation Power Analysis (CPA) attack and the combined CPA, or Snake attack, as described in the paper for the S-box of Xoodoo and Keccak-p. Additional Python scripts are provided to generate the signal reference values.
2. Hardware Power Traces Source Code
The source code to exploit the power traces is in the folder ./src/.
Each program can be compiled with gcc as
gcc -o keccak-snake keccak-snake.c sort.c -Wall -march=native -O3 -lm -fopenmp
gcc -o keccak-cpa keccak-cpa.c sort.c -Wall -march=native -O3 -lm -fopenmp
gcc -o xoodoo-snake xoodoo-snake.c sort.c -Wall -march=native -O3 -lm -fopenmp
gcc -o xoodoo-cpa xoodoo-cpa.c sort.c -Wall -march=native -O3 -lm -fopenmp
We tested this under Arch linux using gcc 12.2.0, where it compiles without error messages.
The following files have been taken from a publicly available implementation of djbsort:
sort.cint32_minmax_x86.cint32_sort.h
3. Additional Resources
Two additional scripts are provided in the folder ./python/:
Sref.pycomputes the signal reference values according to Definition 8;Sref_reduced.pycomputes the reduced signal reference values according to Definition 10.
The scripts were tested with Python 3.10.6.
The command lines are:
Sref.py [-h] n mwith the S-box lengthn in {3, 5}and the number of targeted bitsm in {1, n}(to replacenby its integer value),Sref_reduced.py [-h] nwith the S-box lengthn in {3, 5}.
4. Contact and Support
Please contact Georg Land ([email protected]) or Anna Guinet ([email protected]) if you have any questions or comments.
5. Licensing
Please see LICENSE for further license instructions.