YPIR
This is a fork of the YPIR implementation of the YPIR scheme for single-server private information retrieval, introduced in "YPIR: High-Throughput Single-Server PIR with Silent Preprocessing".
This fork has been audited by Zellic. The audit report is available in audits/zellic-audit-report.pdf.
Client-side code is considered frozen in this repository. Server-side code remains open to changes. This is because these changes can only affect performance, they cannot break client privacy. A server-side change could break integrity, as could a malicious server. However, all authentication of data retrieved is not done at the cryptographic layer in YPIR, but instead is an application-layer concern. In our usages within voting and spendability, authentication is explicitly addressed (via merkle path authentication checks against a trusted merkle root, or recursive proofs post-Tachyon).
Running
To build and run this code:
- Ensure you are running on Ubuntu (at least 22.04), and that AVX-512 is available on the CPU (you can run
lscpuand look for theavx512fflag). Our benchmarks were collected using the AWSr6i.16xlargeinstance type, which has all necessary CPU features. - Run
sudo apt-get update && sudo apt-get install -y build-essential libssl-dev pkg-config. - Install Rust using rustup using
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh.
- Select
1) Proceed with installation (default)when prompted - After installation, configure the current shell as instructed by running
source "$HOME/.cargo/env"
- Run
git clone https://github.com/valargroup/ypir.gitandcd ypir. - Run
cargo run --release -- 1073741824to run YPIR on a random database consisting of 1073741824 bits (~134 MB). The first time you run this command, Cargo will download and install the necessary libraries to build the code (~2 minutes); later calls will not take as long. Stability warnings can be safely ignored. See below for details on how to interpret the measurements.
We have tested the above steps on a fresh AWS r6i.16xlarge Ubuntu 22.04 instance and confirmed they work.
Options
To pass arguments, make sure to run cargo run --release -- <ARGS> (the -- is important).
Passing --verbose or setting the environment variable RUST_LOG=debug
will enable detailed logging. All PIR results are checked for correctness.
The full command-line parameters are as follows:
Usage: cargo run --release -- [OPTIONS] <NUM_ITEMS> [ITEM_SIZE_BITS] [NUM_CLIENTS] [TRIALS] [OUT_REPORT_JSON]
Arguments:
<NUM_ITEMS> Number of items in the database
[ITEM_SIZE_BITS] Size of each item in bits (optional, default 1), values over 8 are unsupported
[NUM_CLIENTS] Number of clients (optional, default 1) to perform cross-client batching over
[TRIALS] Number of trials (optional, default 5) to run the YPIR scheme
and average performance measurements over (with one additional warmup trial excluded)
[OUT_REPORT_JSON] Output report file (optional) where results will be written in JSON
Options:
-v, --verbose Verbose mode (optional) if set, the program will print debug logs to stderr
-h, --help Print help
-V, --version Print version
Interpreting measurements
This is an annotated version of the output
of running RUST_LOG=debug cargo run --profile release-with-debug --bin server 8589934592 1
(testing on a 1 GB database),
detailing what each measurement means:
Server & Client
You can run YPIR as a standalone HTTP server using a command like:
Acknowledgements
YPIR is based on DoublePIR, and this implementation uses matrix-vector multiplication routines based on the ones in ahenzinger/simplepir. We also use a fork of spiral-rs for Spiral to handle RLWE ciphertexts.
Citing
Please cite the original work as:
@inproceedings{MW24,
author = {Samir Jordan Menon and David J. Wu},
title = {{YPIR}: High-Throughput Single-Server {PIR} with Silent Preprocessing},
booktitle = {{USENIX} Security Symposium},
year = {2024}
}
This fork is maintained by valargroup.