This repository contains the Rust implementation of NTPIR, a silent-preprocessing PIR scheme that uses NTRU ciphertexts as the second-layer intermediate ciphertexts in the Double PIR paradigm.
The implementation includes the following components:
- LWE-to-RLWE packing using InspiRING and RLWE-to-NTRU conversion
- encrypted unit queries and Split-Point Picking
- the plaintext z-tree and PackRLWEs
- base-31 digit decomposition and response extraction
- FFT-based polynomial arithmetic and approximate gadget decomposition
- the Rust nightly toolchain specified in
rust-toolchain.toml - Linux on an x86-64 processor with AVX-512 support
Build the library and the included executables from the repository root:
RUSTFLAGS="-C target-cpu=native" cargo build --release --binsRun the complete correctness verification with:
./scripts/verify_correctness.shThe script verifies NTRU key generation, encryption and decryption, key switching, automorphisms, encrypted unit queries, PackRLWEs, Split-Point Picking, digit decomposition, and response extraction. It also checks the complete Stage 2--4 computation for all supported split configurations.
An optional argument specifies the number of repeated end-to-end trials. For example, the following command runs one repeated trial after checking all supported configurations:
./scripts/verify_correctness.sh 1src/fft.rsimplements negacyclic polynomial multiplication.src/pir_fft/contains the protocol implementation.src/bin/verify_*.rscontains the correctness verification programs.scripts/verify_correctness.shruns the complete verification procedure.
Apache-2.0