leodec / VeriSimplePIR

Code for VeriSimplePIR, USENIX '24
MIT License
7 stars 0 forks source link

VeriSimplePIR

This library was tested on Ubuntu 20.04.6 LTS on a machine with an Intel i7 core and 32 GB of RAM.

Building the Library

Requirements

To install all requirements on a fresh installation of Ubuntu 20, run the following command:

sudo apt install make clang libssl-dev

Instructions

The library binary will be placed by default in ./bin/lib. The directory ~/VeriSimplePIR/bin/lib should be in your LD_LIBRARY_PATH environment variable, or you should manually place the binary in a directory that's in this variable. If VeriSimplePIR is cloned in your home directory, running this command or adding it to your .bashrc and reloading your terminal will add ~/VeriSimplePIR/bin/lib to your LD_LIBRARY_PATH environment variable.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/VeriSimplePIR/bin/lib

Assuming the requirements are present, the library can be built by simply running make in the top directory.

The executable files are located in the bin/demo directory. To execute a basic test, run ./bin/demo/test/pir_test from the top directory. This will run the following four tests with a 1 MiB database:

  1. Semi-honest PIR (SimplePIR).
  2. VLHE PIR.
  3. VeriSimplePIR without the proof generation. This is functionally equivalent to the first test, but it uses the VeriSimplePIR class.
  4. Full VeriSimplePIR test.

Running the Benchmarks

Compile-time Parameters

There are three compile-time parameters that can be set to alter the performance of the benchmarks. Setting some of these values incorrectly will result in insecure parameters or benchmarks that fail to run.

Computation Benchmarks

The VeriSimplePIR benchmarks are contained in the file src/demo/bench/preproc_pir_bench.cpp. These can be run by building the library and running bin/demo/bench/preproc_pir_bench from the top directory.

Similarly, the VLHE PIR benchmarks are given in src/demo/bench/pir_bench.cpp and the SimplePIR benchmarks are given in src/demo/bench/simplepir_bench.cpp.

Communication Benchmarks

The parameter generation scripts take a database size (parametrized by the number of entries N and the entry bitwidth d) and compute the parameters to optimize the online communication. A script to compute the size of the messages is given in src/demo/scripts/params.cpp. This file contains the full set of flags to toggle between the various protocols as well as to add the honest digest assumption.