This code is the implementation of the paper "SALUS: Large-Scale Homomorphic Circuit Synthesis via Logic-Aware LUT Optimization".
To build and run this project, you will need:
gitmakegccorclangrustandcargopython3
This repository uses two third-party dependencies under third_party:
third_party/abc: https://github.com/berkeley-abc/abcthird_party/refined-tfhe-lhe: https://github.com/KAIST-CryptLab/refined-tfhe-lhe
After cloning the repository, initialize the submodules with:
git submodule update --init --recursiveBuild the vendored ABC binary with:
make -C third_party/abcBuild the Rust binaries with:
cargo build --releasecargo run --release --bin generate_circuit -- <input.{v|blif}> <output_dir> [--with-merge]Options:
--with-merge- enable LUT merging for
hybrid/multiexecution
- enable LUT merging for
--max-abc-iters N- limit the number of repeated mapping iterations
Example: generate a preprocessed circuit from testcircuit/c7552.v
make -C third_party/abc
cargo run --release --bin generate_circuit -- testcircuit/c7552.v HomCircuit/c7552 --with-mergecargo run --release --bin execute_circuit -- <preprocessed_dir> [input_bits] [--single-lut-mode|--hybrid-lut-mode|--multi-lut-mode] [--repeat-random N]Execution modes:
--single-lut-mode- only single-output HomLUT
--multi-lut-mode- only multi-output HomLUT
--hybrid-lut-mode- both single-output and multi-output HomLUT
Examples:
cargo run --release --bin execute_circuit -- HomCircuit/c7552 --hybrid-lut-mode --repeat-random 1cargo run --release --bin execute_circuit -- HomCircuit/divisor --hybrid-lut-mode --repeat-random 1cargo run --release --bin generate_circuit -- testcircuit/c7552.v HomCircuit/c7552 --with-merge
cargo run --release --bin execute_circuit -- HomCircuit/c7552 --hybrid-lut-mode --repeat-random 1