Expand description
Private Set Intersection (PSI) for privacy-preserving P2P content discovery.
This module provides protocols for finding common elements between two sets without revealing elements that are not in the intersection.
§Use Cases in CHIE Protocol
- Content Discovery: Peers can find common content without revealing their full catalogs
- Privacy-Preserving Matching: Match chunks/files without exposing complete inventories
- Efficient Peer Selection: Find peers with desired content while maintaining privacy
§Protocol
- Hash-based PSI: Uses keyed hashing for exact intersection
- Bloom Filter PSI: Uses Bloom filters for approximate intersection with better efficiency
§Example
use chie_crypto::psi::{BloomPsiClient, BloomPsiServer};
// Server has a set of content hashes
let server_set = vec![
b"content_1".to_vec(),
b"content_2".to_vec(),
b"content_3".to_vec(),
];
// Client has their own set
let client_set = vec![
b"content_2".to_vec(),
b"content_4".to_vec(),
];
// Server generates Bloom filter PSI
let server = BloomPsiServer::new(10, 0.01);
let bloom_msg = server.encode_set(&server_set);
// Client computes approximate intersection
let client = BloomPsiClient::new();
let intersection = client.compute_intersection(&client_set, &bloom_msg).unwrap();
// Intersection should contain common elements
assert!(intersection.contains(&b"content_2".to_vec()));Structs§
- Bloom
PsiClient - Bloom filter PSI client
- Bloom
PsiMessage - Bloom filter-based PSI for approximate intersection with better efficiency
- Bloom
PsiServer - Bloom filter PSI server
- PsiClient
- PSI client for computing intersections
- PsiServer
- PSI server for encoding sets
- PsiServer
Message - PSI server message containing encoded set elements