Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Private Information Retrieval for Key-Value Databases #2

Merged
merged 72 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
42fc8b4
Implement Index and IndexMut traits so that we can use `[]` index ope…
itzmeanjan Jan 14, 2025
cca641d
Implement multiplication trait for Matrix struct
itzmeanjan Jan 14, 2025
ae76e83
Add function for generating an identity matrix
itzmeanjan Jan 14, 2025
f26a6ed
Implement partial equality trait for Matrix struct
itzmeanjan Jan 14, 2025
479698c
Use overflowing multiplication in murmur3 hash function
itzmeanjan Jan 14, 2025
9dfeaa0
Add test ensuring that matrix multiplication is implemented correctly
itzmeanjan Jan 14, 2025
70466f1
Sample secret/ error vector from uniform ternary distribution
itzmeanjan Jan 14, 2025
7dd6d2b
Add serde and bincode as dependency for serializing/ deserializing a …
itzmeanjan Jan 14, 2025
778309d
Do not implement partial equality, rather derive its implementation
itzmeanjan Jan 14, 2025
006e8d3
Serialize and deserialize Matrix struct using bincode
itzmeanjan Jan 14, 2025
84681a6
Use reference to matrix struct when serializing
itzmeanjan Jan 14, 2025
eced6e1
Correctly handle number of elements not matching case when deserializ…
itzmeanjan Jan 14, 2025
63601de
Add test ensuring that serialized matrix can be deserialized
itzmeanjan Jan 14, 2025
9621ffd
Explicitly mention that we want to use wrapping addition/ multiplicat…
itzmeanjan Jan 14, 2025
7ec45e6
Implement Add trait for Matrix struct
itzmeanjan Jan 14, 2025
f8268cc
Add server setup function
itzmeanjan Jan 15, 2025
2de0540
First parsed KV database to get column size of public matrix A
itzmeanjan Jan 15, 2025
ee86620
Add server respond function
itzmeanjan Jan 15, 2025
848ff9a
Implement matrix multiplication, which works with reference to operan…
itzmeanjan Jan 16, 2025
c85f2c1
Refactor the owned version of Matrix multiplication to use borrowed v…
itzmeanjan Jan 16, 2025
38da57a
Implement matrix addition s.t. operands are borrowed instances of Mat…
itzmeanjan Jan 16, 2025
05799b9
Prefer using borrowed version of matrix multiplication in server comp…
itzmeanjan Jan 16, 2025
5462f7b
Rename `filter_size` with `db_size`
itzmeanjan Jan 17, 2025
5e85bee
Move common params to different module
itzmeanjan Jan 17, 2025
797a8d4
Implement client setup function
itzmeanjan Jan 17, 2025
81fa1bd
Implement function to prepare query at client-side
itzmeanjan Jan 17, 2025
79ef9c9
Serialize and deserialize binary fuse filter
itzmeanjan Jan 17, 2025
8e7689d
Update server struct, also return filter params as bytes during serve…
itzmeanjan Jan 17, 2025
7d53080
Update client setup function to also accept filter parameters as bytes
itzmeanjan Jan 17, 2025
88ab15f
Update prepare-query function to actually produce a query
itzmeanjan Jan 17, 2025
aaa28e4
Implement function for processing server response at client-side
itzmeanjan Jan 17, 2025
aa2f08c
Unmask row before attempting to deserialize it as (hashed-key, value)…
itzmeanjan Jan 18, 2025
5bcf182
Make function private which does not need to be public
itzmeanjan Jan 18, 2025
800cf16
Update server-respond function to borrow server instance, instead of …
itzmeanjan Jan 18, 2025
953cb73
Fix logic for validating dimension of deseriaized response vector
itzmeanjan Jan 22, 2025
76009a7
Arity is now a constant parameter to filter constructiono function
itzmeanjan Jan 22, 2025
b084835
Prefer wrapping_add over overflowing_add
itzmeanjan Jan 22, 2025
992aae4
Update use sites of binary fuse filter so that arity is passed down c…
itzmeanjan Jan 22, 2025
e737f15
Add test ensuring keyword PIR scheme works well
itzmeanjan Jan 22, 2025
6be7560
Prefer constants to be uppercase
itzmeanjan Jan 22, 2025
2ffcb48
Support calling filter constructor with ARITY of {3,4}
itzmeanjan Jan 22, 2025
8b2b87c
Implement binary fuse filter construction algorithm with arity 4
itzmeanjan Jan 24, 2025
49b18df
Rename function which encodes KV database into a 3 wise XOR filter
itzmeanjan Jan 24, 2025
4348d40
Implement function which encodes KV database using a 4-wise XOR filter
itzmeanjan Jan 24, 2025
20d78ed
Add function for recovering value KV database encoded using a 4-wise …
itzmeanjan Jan 24, 2025
1bad05d
Define public API for ease of encoding KV database using filter of di…
itzmeanjan Jan 24, 2025
4b3622d
Address bug in construction phase of 4-wise xor BFF
itzmeanjan Jan 24, 2025
8f106f8
Test functional correctness of encoding KV database as matrix and rec…
itzmeanjan Jan 24, 2025
10c18a8
Refactor test for PIR -based on 3-wise XOR filter
itzmeanjan Jan 24, 2025
d6bbcd8
Add support for generating query when using arity 4 for underlying BFF
itzmeanjan Jan 24, 2025
02409f8
Compiler hint for denoting whether branch is likely or not
itzmeanjan Jan 24, 2025
e835871
Add compiler hints, denoting which branches are more likely
itzmeanjan Jan 24, 2025
36699c0
Add branch optimization hints to server operations
itzmeanjan Jan 24, 2025
2b09452
Define new profiles for running tests and benchmarks
itzmeanjan Jan 24, 2025
a95b8ff
Run tests with `test-release` profile on CI
itzmeanjan Jan 24, 2025
b73fdbf
Remove fields from server struct, which are not required
itzmeanjan Jan 24, 2025
c2c155c
Add test ensuring functional correctness of keyword PIR, with 4-wise …
itzmeanjan Jan 24, 2025
ca583c3
Reduce number of entries in test PIR KV database
itzmeanjan Jan 24, 2025
bfd43eb
Extract test for encoding KV database using 4-wise xor filter and rec…
itzmeanjan Jan 24, 2025
a950104
Make client and server modules public
itzmeanjan Jan 24, 2025
3c0c5d6
Add optimization hints to matrix funtions
itzmeanjan Jan 24, 2025
be65730
Move internal functions into new directory
itzmeanjan Jan 24, 2025
138a3f0
Utilize common function to generate random KV database with variable …
itzmeanjan Jan 25, 2025
c73306d
Add property based test for matrix addition implementation
itzmeanjan Jan 25, 2025
1559157
Fix typo
itzmeanjan Jan 25, 2025
48eedf1
Prefer LTO "thin" instead of "fat", it is faster
itzmeanjan Jan 25, 2025
91e75e9
Use unsafe bounds unchecked method for accessing matrix elements
itzmeanjan Jan 25, 2025
11b118f
Refactor hash batch function for 4-wise xor filter
itzmeanjan Jan 25, 2025
69721ab
Increase max number of matrix element bit length to 11, in serializat…
itzmeanjan Jan 25, 2025
ce2f8fe
Add function to compute "bits/entry" for Binary Fuse Filter
itzmeanjan Jan 25, 2025
d9e8b05
Add tests validating "bits/entry" for both {3,4}-wise xor filters
itzmeanjan Jan 25, 2025
54deb51
Do not parallelize test run
itzmeanjan Jan 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
- uses: actions/checkout@v4

- name: Build and Test on ${{ matrix.os }}
run: cargo test --lib --release
run: cargo test --profile test-release
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@
name = "chalamet_pir"
version = "0.1.0"
edition = "2021"
resolver = "2"

[dependencies]
sha3 = "=0.10.8"
rand = "=0.8.5"
rand_chacha = "=0.3.1"
serde = { version = "=1.0.217", features = ["derive"] }
bincode = "=1.3.3"

[profile.optimized]
inherits = "release"
codegen-units = 1
lto = "thin"

[profile.test-release]
inherits = "release"
debug = true
debug-assertions = true
overflow-checks = true
314 changes: 0 additions & 314 deletions src/binary_fuse_filter.rs

This file was deleted.

Loading
Loading