Expand description
Oblivious Pseudorandom Function (OPRF) implementation.
OPRF allows a client to compute PRF(key, input) where:
- Server holds the secret key
- Client provides the input
- Server learns nothing about the input
- Client learns only PRF(key, input), not the key
Perfect for:
- Private rate limiting (check if user exceeded quota without revealing identity)
- Password-authenticated key exchange
- Anonymous credentials
- Privacy-preserving set membership tests
§Example
use chie_crypto::oprf::{OprfServer, OprfClient};
// Server setup
let server = OprfServer::new();
// Client blind request
let input = b"user@example.com";
let (client, blinded_input) = OprfClient::blind(input);
// Server evaluates on blinded input
let blinded_output = server.evaluate(&blinded_input);
// Client unblinds to get PRF output
let prf_output = client.unblind(&blinded_output);
// Can verify this matches direct evaluation (for testing)
assert_eq!(prf_output, server.evaluate_direct(input));Structs§
- Batch
Oprf Client - Batch OPRF client for multiple inputs.
- Blinded
Input - Blinded input sent from client to server.
- Blinded
Output - Blinded output sent from server to client.
- Oprf
Client - OPRF client state during the protocol.
- Oprf
Output - PRF output after unblinding.
- Oprf
Server - OPRF server holding the secret key.
Enums§
- Oprf
Error - OPRF error types.