// FH-Multi-IPE represents a Function Hiding Multi-client Inner Product Encryption scheme based on the paper by P. Datta, T. Okamoto, and J. Tomida: "Full-Hiding (Unbounded) Multi-Input Inner Product Functional Encryption
from the 𝒌-Linear Assumption". It allows clients to encrypt vectors {x_1,...,x_m} and derive a secret key based on an inner product vectors {y_1,...,y_m} so that a decryptor can decrypt the sum of inner products <x_1,y_1> + ... + <x_m, y_m> without revealing vectors x_i or y_i. The scheme is slightly modified from the original one to achieve a better performance. The difference is in storing the secret master key as matrices B_hat, B_hat_star, instead of matrices of elliptic curve elements g_1^B_hat, g_2^B_hat_star. This replaces elliptic curves operations with matrix multiplications.
More...
Go to the source code of this file.
|
cfe_error | cfe_fh_multi_ipe_init (cfe_fh_multi_ipe *c, size_t sec_level, size_t num_clients, size_t vec_len, mpz_t bound_x, mpz_t bound_y) |
|
void | cfe_fh_multi_ipe_copy (cfe_fh_multi_ipe *res, cfe_fh_multi_ipe *c) |
|
void | cfe_fh_multi_ipe_free (cfe_fh_multi_ipe *c) |
|
void | cfe_fh_multi_ipe_master_key_init (cfe_fh_multi_ipe_sec_key *sec_key, cfe_fh_multi_ipe *c) |
|
void | cfe_fh_multi_ipe_master_key_free (cfe_fh_multi_ipe_sec_key *sec_key) |
|
cfe_error | cfe_fh_multi_ipe_generate_keys (cfe_fh_multi_ipe_sec_key *sec_key, FP12_BN254 *pub_key, cfe_fh_multi_ipe *c) |
|
void | cfe_fh_multi_ipe_fe_key_init (cfe_mat_G2 *fe_key, cfe_fh_multi_ipe *c) |
|
cfe_error | cfe_fh_multi_ipe_derive_fe_key (cfe_mat_G2 *fe_key, cfe_mat *y, cfe_fh_multi_ipe_sec_key *sec_key, cfe_fh_multi_ipe *c) |
|
void | cfe_fh_multi_ipe_ciphertext_init (cfe_vec_G1 *cipher, cfe_fh_multi_ipe *c) |
|
cfe_error | cfe_fh_multi_ipe_encrypt (cfe_vec_G1 *cipher, cfe_vec *x, cfe_mat *part_sec_key, cfe_fh_multi_ipe *c) |
|
cfe_error | cfe_fh_multi_ipe_decrypt (mpz_t res, cfe_vec_G1 *ciphers, cfe_mat_G2 *fe_key, FP12_BN254 *pub_key, cfe_fh_multi_ipe *c) |
|
// FH-Multi-IPE represents a Function Hiding Multi-client Inner Product Encryption scheme based on the paper by P. Datta, T. Okamoto, and J. Tomida: "Full-Hiding (Unbounded) Multi-Input Inner Product Functional Encryption
from the 𝒌-Linear Assumption". It allows clients to encrypt vectors {x_1,...,x_m} and derive a secret key based on an inner product vectors {y_1,...,y_m} so that a decryptor can decrypt the sum of inner products <x_1,y_1> + ... + <x_m, y_m> without revealing vectors x_i or y_i. The scheme is slightly modified from the original one to achieve a better performance. The difference is in storing the secret master key as matrices B_hat, B_hat_star, instead of matrices of elliptic curve elements g_1^B_hat, g_2^B_hat_star. This replaces elliptic curves operations with matrix multiplications.
◆ cfe_fh_multi_ipe
cfe_fh_multi_ipe contains the shared choice for parameters on which the functionality of the scheme depend.
◆ cfe_fh_multi_ipe_sec_key
◆ cfe_fh_multi_ipe_init()
cfe_error cfe_fh_multi_ipe_init |
( |
cfe_fh_multi_ipe * |
c, |
|
|
size_t |
sec_level, |
|
|
size_t |
num_clients, |
|
|
size_t |
vec_len, |
|
|
mpz_t |
bound_x, |
|
|
mpz_t |
bound_y |
|
) |
| |
Configures a new client for the fh_multi_ipe scheme. It returns an error if the bounds and length of vectors are too high.
- Parameters
-
c | A pointer to an uninitialized struct representing the scheme |
sec_level | The parameter defines the security assumption of the scheme, so called k-Lin assumption, where k is the specified sec_level |
num_clients | Number of clients participating in the scheme |
vec_len | Length of the vectors that each client will encrypt |
bound_x | Bound on the inputs of the vectors that will be encrypted |
bound_y | Bound on the inputs of the inner product vectors for which the functional keys will be generated. |
- Returns
- Error code
◆ cfe_fh_multi_ipe_copy()
Reconstructs the scheme with the same configuration parameters from an already existing fh_multi_ipe scheme instance.
- Parameters
-
◆ cfe_fh_multi_ipe_free()
Frees the memory occupied by the struct members. It does not free the memory occupied by the struct itself.
- Parameters
-
◆ cfe_fh_multi_ipe_master_key_init()
Initializes the struct which represents the master secret key in fh_multi_ipe.
- Parameters
-
◆ cfe_fh_multi_ipe_master_key_free()
Frees the memory occupied by the struct members. It does not free the memory occupied by the struct itself.
- Parameters
-
◆ cfe_fh_multi_ipe_generate_keys()
Generates a master secret key and a public key for the scheme. It returns an error if generating one of the parts of the secret key failed.
- Parameters
-
sec_key | A pointer to a cfe_fh_multi_ipe_sec_key struct (the master secret key will be stored here) |
pub_key | A pointer to a FH12_BN256 struct (the public key will be stored here) |
c | A pointer to an instance of the scheme (initialized cfe_fh_multi_ipe struct) |
- Returns
- Error code
◆ cfe_fh_multi_ipe_fe_key_init()
Initializes the struct which represents the functional encryption key in fh_multi_ipe.
- Parameters
-
fe_key | A pointer to an uninitialized cfe_mat_G2 struct |
c | A pointer to an instance of the scheme (initialized cfe_fh_multi_ipe struct) |
◆ cfe_fh_multi_ipe_derive_fe_key()
Takes a master secret key and input matrix y, and derives the functional encryption key. In case the key could not be derived, it returns an error.
- Parameters
-
fe_key | A pointer to a cfe_mat_G2 struct (the functional encryption key will be stored here) |
y | A pointer to the inner product matrix |
sec_key | A pointer to the master secret key |
c | A pointer to an instance of the scheme (initialized cfe_fh_multi_ipe struct) |
- Returns
- Error code
◆ cfe_fh_multi_ipe_ciphertext_init()
Initializes the struct which represents the ciphertext.
- Parameters
-
cipher | A pointer to an uninitialized cfe_vec_G1 struct |
c | A pointer to an instance of the scheme (initialized cfe_fh_multi_ipe struct) |
◆ cfe_fh_multi_ipe_encrypt()
The function is called by a client that encrypts input vector x with the provided part master secret key. It returns a ciphertext struct. If encryption failed, an error is returned.
- Parameters
-
cipher | A pointer to an initialized cfe_vec_G1 struct (the resulting ciphertext will be stored here) |
x | A pointer to the plaintext vector |
part_sec_key | A pointer to a matrix representing a part of the master secret key (i-th client gets i-th matrix in array B_hat) |
c | A pointer to an instance of the scheme (initialized cfe_fh_multi_ipe struct) |
- Returns
- Error code
◆ cfe_fh_multi_ipe_decrypt()
Accepts the encrypted vectors and functional encryption key. It returns the inner product of x and y, i.e. <x_1,y_1> + ... + <x_m, y_m> where x_i is i-th encrypted vector and y_i is i-th inner product vector (i-th row of y). If decryption failed, an error is returned.
- Parameters
-
res | The result of the decryption (the value will be stored here) |
ciphers | An array of the ciphertexts |
fe_key | A pointer to the functional encryption key |
pub_key | A pointer to the public key |
c | A pointer to an instance of the scheme (initialized cfe_fh_multi_ipe struct) |
- Returns
- Error code