Caution! This code has not been audited and is for demonstration purposes only. Do not use it for any production purposes!
To run the benchmark comparison:
unzip -q Comparison.zip
cd Comparison
unzip -q ilmx-main.zip
unzip -q lattice-verifiable-mixnet-main.zip
unzip -q ntru_voting_impl-main.zipCompile lattice-verifiable-mixnet:
cd Comparison/lattice-verifiable-mixnet-mainthen:
mkdir -p deps
cd deps
cmake ../NFLlib \
-DCMAKE_BUILD_TYPE=Release \
-DNFL_OPTIMIZED=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
make -j"$(nproc)"
make test
cd ../..Compile ntru_voting_impl:
cd ntru_voting_impl-mainthen:
mkdir -p deps
cd deps
cmake ../NFLlib \
-DCMAKE_BUILD_TYPE=Release \
-DNFL_OPTIMIZED=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
make -j"$(nproc)"
make test
cd ../..No extra source-file setup is required for ilmx. benchmark.py contains the
ILMX benchmark entry point and generates bench_ilmx.c directly in its
temporary build directory for each run.
Ubuntu 26.04 LTS + Rust toolchain + Python 3.12
Dependencies:
matplotlibpkg-configfontconfigcc/g++libflint-devlibgmp-devlibmpfr-devlibmpc-dev
To install dependencies:
sudo apt update
sudo apt install -y \
build-essential \
python3 python3-pip python3-matplotlib \
pkg-config libfontconfig1-dev \
libflint-dev libgmp-dev libmpfr-dev libmpc-devcd Lattice_Shuffle_RustBenchmark:
cargo run --release --bin benchmarkor Customizing:
cargo run --release --bin benchmark -- --start 5 --stop 200 --step 15 --repeat 15Matrix multiplication uses ndarray's pure-Rust matrixmultiply backend.
Rayon parallelism is capped by worker_count (override on the CLI with
--workers N; --workers 0 uses all cores).
The benchmark executes one subset-checking round by default because running
all repetitions is impractical on the target machine. For reported proof-size
estimates, only the repeated proof material is scaled to κ=118 for 80-bit
soundness or κ=189 for 128-bit soundness. Runtime remains the measured
single-round, ideal-parallelization estimate. The JSON fields
proof_kappa_80_bytes and proof_kappa_128_bytes contain those estimates:
scaled proof = proof_one_time_bytes + mean subset-round bytes × target κ
CRS, statement, C_rand and its opening proof, and equal-sums openings are
therefore never multiplied by κ.
Output:
Lattice_Shuffle_Rust/outputs/benchmark_ajtai.jsonLattice_Shuffle_Rust/outputs/benchmark_rlwe.json
Both Ajtai and RLWE run by default and write separate
outputs/benchmark_ajtai.json and outputs/benchmark_rlwe.json files. Use
--skip-rlwe or --skip-ajtai to run only one protocol.
cd ComparisonStart benchmark:
python3 benchmark.pyor Customizing:
python3 benchmark.py --start 5 --stop 200 --step 15Output:
Comparison/outputs/comparison_benchmark.json
Plotting Comparison:
Move benchmark_ajtai.json and benchmark_rlwe.json, which are the Rust benchmarks for the Ajtai shuffle and the RLWE shuffle, into Comparison/outputs, then execute:
python3 plot_comparison.py