Expand description
Functional Encryption (FE) primitives
Functional encryption allows a client with a secret key SK_f to learn f(x) from an encryption of x, without learning anything else about x. This is useful for privacy-preserving computation where you want to compute on encrypted data.
This module implements Inner Product Functional Encryption (IPFE), one of the most practical forms of FE, allowing computation of inner products over encrypted vectors.
§Example
use chie_crypto::functional_encryption::*;
// Setup master keys for vectors of length 3
let (msk, mpk) = ipfe_setup(3);
// Encrypt a vector [5, 10, 15]
let plaintext = vec![5, 10, 15];
let ciphertext = ipfe_encrypt(&mpk, &plaintext).unwrap();
// Generate a functional key for computing inner product with [1, 2, 3]
let func_vector = vec![1, 2, 3];
let func_key = ipfe_keygen(&msk, &func_vector).unwrap();
// Decrypt to get the inner product: 5*1 + 10*2 + 15*3 = 70
let result = ipfe_decrypt(&func_key, &ciphertext).unwrap();
assert_eq!(result, 70);Structs§
- Ipfe
Ciphertext - Ciphertext for IPFE
- Ipfe
Functional Key - Functional secret key for computing inner products
- Ipfe
Master Public Key - Master public key for IPFE
- Ipfe
Master Secret Key - Master secret key for IPFE
- Multi
Client Ipfe - Multi-client IPFE setup for privacy-preserving aggregation
Enums§
- Functional
Encryption Error - Functional encryption error types
Functions§
- ipfe_
decrypt - Decrypt a ciphertext using a functional key to compute the inner product
- ipfe_
encrypt - Encrypt a plaintext vector using the master public key
- ipfe_
keygen - Generate a functional secret key for computing inner product with a given vector
- ipfe_
setup - Generate master secret and public keys for IPFE
Type Aliases§
- Functional
Encryption Result - Result type for functional encryption operations