This repository contains the code for the paper "On Perfect Linear Approximations and Differentials over Two-Round SPNs". The code is structured into three directories. ciphers contains basic implementations (sboxes and linear layers) of the examined ciphers. linear contains our code for the linear and differential the code for the differential case. main.sage runs all our experiments.
Our code is based on sage.
We also make use of a sage module for linear layers which is not part of sage.
Its original version can be found here.
Further, we use tabulate to generate nice
tables and tqdm as a progress bar.
To install them, run pip install tabulate
and pip install tqdm
inside sage.
Run sage main.sage
to run the experiments.
We used SageMath version 9.6
.
Earlier versions might not work!
Please note: in some cases sage is not good with Gröbner basis computations. Hence, sometimes we generate magma files instead.