This repository contains the code used to obtain some of our results in the paper "Efficient MILP modelings for Sboxes and Linear Layers of SPN ciphers."
sboxcontains python (or SageMath) files that are useful for modeling 4-bit Sboxes.impossible_differentialscontains python files that build Gurobi models for searching for impossible differentials for Skinny and the AES.
We have not published the code for 8-bit Sboxes yet but the models of the DDTs used in impossible differential search are given as pickle files.
arbitrary_sbox_gen.pygenerates a pickle file for an arbitrary Sbox DDT (only transitions zero -> non zero are impossible).check_model.sagechecks the correctness of a model of a DDT given by a pickle file.convex_hull.sagegenerates a big set of inequalities with the convex hull technique. Uses the SageMath Sboxes and Polyhedra tools.identity_sbox_gen.pygenerates a pickle file for the identity Sbox DDT.minimize.pyperforms step 2 given a big set of inequalities with greedy or minimization techniques.utilities.pydefines some small useful functions for the other files.
aes_equiv_sbox.pklis the model of the DDT of an affine equivalent AES Sbox.aes.pybuilds and tests the Gurobi model for the AES.arbitrary_sbox_8_8.pklis the model of the DDT of an arbitrary 8-bit Sbox (for testing purposes).identity_sbox_8.pklis the model of the DDT of the identity 8-bit Sbox (testing).main_aes.pylaunches the search for impossible differentials for the AES.main_skinny.pyis the same for Skinny.primitive.pycontains classes and functions common toaes.pyandskinny.py.skinny.pybuilds and tests the Gurobi model for Skinny.skinny_sbox.pklis the model of the DDT of the Skinny 8-bit Sbox.utilities.pydefines small useful functions.