randombit / sboxgates

Program for finding low gate count implementations of S-boxes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sboxgates

DOI License: GPL v3

Program for finding low gate count implementations of S-boxes.

The algorithm used is described in Kwan, Matthew: "Reducing the Gate Count of Bitslice DES." IACR Cryptology ePrint Archive 2000 (2000): 51, with improvements from the GitHub project SBOXDiscovery added. In addition to finding logic circuits using standard (NOT, AND, OR, XOR) gates, the program also supports ANDNOT gates and 3-bit LUTs. The latter can be used to find efficient implementations for use on Nvidia GPUs that support the LOP3.LUT instruction, or on FPGAs.

Dependencies

Build

sudo apt-get install libxml2-dev libopenmpi-dev openmpi-bin
mkdir build
cd build
cmake ..
make

Run

The -h command line argument will display a brief list of command line options.

Generate a logic circuit representation of the Rijndael S-box:

./sboxgates -b sboxes/rijndael.txt

Generate a LUT circuit for output bit 0 of the Rijndael S-box:

mpirun ./sboxgates -l -o 0 -b sboxes/rijndael.txt

Visualize a generated circuit with Graphwiz:

./sboxgates -d 1-067-162-3-c32281db.xml | dot -Tpng > 1-067-162-3-c32281db.png

Convert a generated circuit to C/CUDA:

./sboxgates -c 1-067-162-3-c32281db.xml > 1-067-162-3-c32281db.c

License

This project is licensed under the GNU General Public License -- see the LICENSE file for details.

About

Program for finding low gate count implementations of S-boxes.

License:GNU General Public License v3.0


Languages

Language:C 97.7%Language:CMake 1.2%Language:C++ 1.1%