Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LatticeShuffle_Benchmark

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.zip

Compile lattice-verifiable-mixnet:

cd Comparison/lattice-verifiable-mixnet-main

then:

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-main

then:

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.

Environment

Ubuntu 26.04 LTS + Rust toolchain + Python 3.12

Dependencies:

  • matplotlib
  • pkg-config
  • fontconfig
  • cc / g++
  • libflint-dev
  • libgmp-dev
  • libmpfr-dev
  • libmpc-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-dev

Quick Start with Default setting:

Lattice_Shuffle_Rust

cd Lattice_Shuffle_Rust

Benchmark:

cargo run --release --bin benchmark

or Customizing:

cargo run --release --bin benchmark -- --start 5 --stop 200 --step 15 --repeat 15

Matrix 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.json
  • Lattice_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.

Comparison with other three

cd Comparison

Start benchmark:

python3 benchmark.py

or Customizing:

python3 benchmark.py --start 5 --stop 200 --step 15

Output:

  • 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

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages