Accompanying repository for Quasi-Optimal Permutation Ranking and Applications to PERK
AFRICACRYPT 2024 paper.
This library contains the implementations in C of ranking/unranking algorithms for permutations in the following flavors.:
- The classic permutation ranking/unranking algorithms in two versions: one using tiny-bignum-c and one GMP for arbitrary-arithmetic precision.
- The Bonet variant permutation ranking/unranking algorithms also implemented with tiny-bignum-c and GMP.
- The quasi-optimal permutation ranking/unranking algorithms which do not require arbitrary-arithmetic precision. In addition, we provide AVX/AVX2 optimizations for certain parameters in PERK v1.1.
Authors:
- Slim Bettaieb
- Alessandro Budroni
- Décio Luiz Gazzoni Filho
- Marco Palumbi
The avx2 code has been optimized for the clang compiler
- standard development tools: CMake, make, git
- clang compiler (instal with:
sudo apt install clang
) - lld linker (instal with:
sudo apt install lld
)
cmake -DCMAKE_INSTALL_PREFIX=./cmake-build/binaries -S. -Bcmake-build -DCMAKE_BUILD_TYPE=Release -DPARAM_N1=79 -DCMAKE_C_COMPILER=clang
make -C cmake-build/
#run
./cmake-build/test_xxx
build and run on STM32F407G-DISC1 evaluation board
- arm-none-eabi-gcc toolchain.
- stlink to flash binaries into the development board. Some distribution have packages for this.
- standard development tools: CMake, make, git
- python and python3 (both command must be present and running on the development machine).
- may be Im missing some....
cmake -DCMAKE_TOOLCHAIN_FILE=arm-none-eabi-libopencm3.toolchain -DCMAKE_INSTALL_PREFIX=./cmake-build/binaries -S. -Bcmake-build -DCMAKE_BUILD_TYPE=Release -DPARAM_N1=79
make -C cmake-build/
#run
st-flash --reset write cmake-build/test_xxx 0x8000000
Call cmake with -DPARAM_N1=NN
to build tests for N1=NN