Skip to content

hisoka-io/iSimplePIR

Repository files navigation

raven-isimplepir

Pure-Rust implementation of iSimplePIR (eprint 2026/030 Construction 1) — single-server, client-preprocessing PIR with incremental database updates.

Ported from the simplepir/ Go reference (Henzinger et al., USENIX 2023), extended with typed incremental updates per Theorem 3 of eprint 2026/030.

Features

  • wasm32 compatible client path (params, query, extract) — no AES-NI, no rayon
  • Optional server parallelism via --features server (rayon + AVX2/AVX-512F dispatch)
  • Incremental updates — modify, delete, insert rows while preserving H = D · A exactly
  • Typed errors — every failure path returns a structured IsimplePirError

Usage

[dependencies]
raven-isimplepir = "0.1.0-alpha.0"
use raven_isimplepir::{for_cell, setup, query, respond, extract, SEED_BYTES};
use rand_chacha::ChaCha20Rng;
use rand_core::SeedableRng;

// Build params for 2^20 entries × 32 bytes each.
let params = for_cell(1 << 20, 32)?;

// Server: setup with a random database.
let db: Vec<u32> = vec![0u32; params.l * params.m];
let out = setup(&db, params, None)?;

// Client: query index 42.
let mut rng = ChaCha20Rng::from_entropy();
let (state, q) = query(&mut rng, &out.server.a_seed, &out.server.params, 42)?;

// Server: respond.
let response = respond(&out.server, &q.query)?;

// Client: recover plaintext.
let value = extract(&out.server.params, &out.hint, &state, &response)?;

Parameters

Default parameters follow SimplePIR Table 16 from eprint 2022/949: n = 1024, q = 2^32, σ = 6.4. Use for_cell(entries, entry_bytes) to pick p automatically, or construct LweParams directly for custom setups.

Incremental Updates

use raven_isimplepir::{db_update_modify, state_update_entry};

// Server modifies entry (row=1, col=2) to new_value=7.
let delta = db_update_modify(&mut server_state, 1, 2, 7)?;

// Client applies the matching hint update.
state_update_entry(&mut hint, &a_seed, &params, &delta)?;

Batch updates (db_update_batch / state_update_batch) amortize the A-matrix derivation across mixed modify/delete/insert operations.

Deletion is weak only. A client holding a pre-deletion hint can still recover deleted entries. Strong deletion requires re-running Setup (paper §2.4).

Building

# Native server (rayon + SIMD)
cargo build --release

# wasm32 client only
cargo build --target wasm32-unknown-unknown --no-default-features

Requires Rust ≥ 1.89 (AVX-512F intrinsics stabilized in that release).

License

MIT — see LICENSE.
See UPSTREAM.md for attribution to the Go reference and upstream papers.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors