Decentralized multi-client inner-product scheme based on the paper "Decentralized Multi-Client Functional Encryption for Inner Product" by Chotard, Dufour Sans, Gay, Phan, and Pointcheval.
More...
Go to the source code of this file.
|
void | cfe_dmcfe_client_init (cfe_dmcfe_client *c, size_t idx) |
|
void | cfe_dmcfe_client_free (cfe_dmcfe_client *c) |
|
void | cfe_dmcfe_set_share (cfe_dmcfe_client *c, ECP_BN254 *pub_keys, size_t num_clients) |
|
void | cfe_dmcfe_encrypt (ECP_BN254 *cipher, cfe_dmcfe_client *c, mpz_t x, char *label, size_t label_len) |
|
void | cfe_dmcfe_fe_key_part_init (cfe_vec_G2 *fe_key_part) |
|
void | cfe_dmcfe_derive_fe_key_part (cfe_vec_G2 *fe_key_part, cfe_dmcfe_client *c, cfe_vec *y) |
|
cfe_error | cfe_dmcfe_decrypt (mpz_t res, ECP_BN254 *ciphers, cfe_vec_G2 *key_shares, char *label, size_t label_len, cfe_vec *y, mpz_t bound) |
|
Decentralized multi-client inner-product scheme based on the paper "Decentralized Multi-Client Functional Encryption for Inner Product" by Chotard, Dufour Sans, Gay, Phan, and Pointcheval.
◆ cfe_dmcfe_client
◆ cfe_dmcfe_client_init()
Configures a new client for the dmcfe scheme.
- Parameters
-
c | A pointer to an uninitialized struct representing the scheme |
idx | Identification value of the client; it is assumed that if there are n clients, their identifications are from [0,n) |
◆ cfe_dmcfe_client_free()
Frees the memory occupied by the struct members. It does not free the memory occupied by the struct itself.
- Parameters
-
◆ cfe_dmcfe_set_share()
void cfe_dmcfe_set_share |
( |
cfe_dmcfe_client * |
c, |
|
|
ECP_BN254 * |
pub_keys, |
|
|
size_t |
num_clients |
|
) |
| |
Sets a secret key share for the client based on the public keys of all the participant. Note that the function assumes that if there are n clients, their identifications are from [0,n).
- Parameters
-
c | A pointer to an initialized struct representing the scheme |
pub_keys | An array of public keys |
num_clients | Number of clients |
◆ cfe_dmcfe_encrypt()
void cfe_dmcfe_encrypt |
( |
ECP_BN254 * |
cipher, |
|
|
cfe_dmcfe_client * |
c, |
|
|
mpz_t |
x, |
|
|
char * |
label, |
|
|
size_t |
label_len |
|
) |
| |
Client c encrypts input value x, a coordinate of a vector. All clients should use the same label to encrypt a vector.
- Parameters
-
cipher | A pointer to ECP_BN254 struct (the resulting ciphertext will be stored here) |
c | A pointer to an instance of the scheme (initialized cfe_dmcfe_client |
x | The input value |
label | A string label of the encrypted vector |
label_len | The length of the label to prevent non NULL terminated strings struct) |
◆ cfe_dmcfe_fe_key_part_init()
void cfe_dmcfe_fe_key_part_init |
( |
cfe_vec_G2 * |
fe_key_part | ) |
|
Configures a new functional encryption key share for the dmcfe scheme.
- Parameters
-
fe_key_part | A pointer to an uninitialized cfe_vec_G2 vec representing the share |
◆ cfe_dmcfe_derive_fe_key_part()
Sets a part of a functional encryption key needed for the decryption of an inner product of encrypted vector and y.
- Parameters
-
fe_key_part | A pointer to initialized cfe_vec_G2 (the key share will be save here) |
c | A pointer to an initialized struct representing the scheme |
y | A pointer to the inner-product vector |
◆ cfe_dmcfe_decrypt()
cfe_error cfe_dmcfe_decrypt |
( |
mpz_t |
res, |
|
|
ECP_BN254 * |
ciphers, |
|
|
cfe_vec_G2 * |
key_shares, |
|
|
char * |
label, |
|
|
size_t |
label_len, |
|
|
cfe_vec * |
y, |
|
|
mpz_t |
bound |
|
) |
| |
Accepts an array of ciphers, i.e. the encrypted vector, an array of key shares for the inner-product, a plaintext vector y, and a bound on the inputs of the encrypted and inner-product vector. The bound is used to improve the computation of the discrete logarithm needed for the decryption. It calculates the inner product of x and 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 encrypted coordinates of the vector |
key_shares | An array of the decryption key shares |
label | A string label of the encrypted value |
label_len | The length of the label to prevent non NULL terminated strings |
y | A pointer to the inner-product vector |
bound | A bound on all the values of the encrypted vector and inner-product vector |
- Returns
- Error code