CiFEr
Data Structures | Typedefs | Functions

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.

Data Structures

struct  cfe_dmcfe_client
 

Typedefs

typedef struct cfe_dmcfe_client cfe_dmcfe_client
 

Functions

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)
 

Detailed Description

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.

Typedef Documentation

◆ cfe_dmcfe_client

cfe_dmcfe_client represents a client in a decentralized multi-client scheme.

Function Documentation

◆ cfe_dmcfe_client_init()

void cfe_dmcfe_client_init ( cfe_dmcfe_client c,
size_t  idx 
)

Configures a new client for the dmcfe scheme.

Parameters
cA pointer to an uninitialized struct representing the scheme
idxIdentification value of the client; it is assumed that if there are n clients, their identifications are from [0,n)

◆ cfe_dmcfe_client_free()

void cfe_dmcfe_client_free ( cfe_dmcfe_client c)

Frees the memory occupied by the struct members. It does not free the memory occupied by the struct itself.

Parameters
cA pointer to an instance of the scheme (initialized cfe_dmcfe_client struct)

◆ 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
cA pointer to an initialized struct representing the scheme
pub_keysAn array of public keys
num_clientsNumber 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
cipherA pointer to ECP_BN254 struct (the resulting ciphertext will be stored here)
cA pointer to an instance of the scheme (initialized cfe_dmcfe_client
xThe input value
labelA string label of the encrypted vector
label_lenThe 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_partA pointer to an uninitialized cfe_vec_G2 vec representing the share

◆ cfe_dmcfe_derive_fe_key_part()

void cfe_dmcfe_derive_fe_key_part ( cfe_vec_G2 fe_key_part,
cfe_dmcfe_client c,
cfe_vec y 
)

Sets a part of a functional encryption key needed for the decryption of an inner product of encrypted vector and y.

Parameters
fe_key_partA pointer to initialized cfe_vec_G2 (the key share will be save here)
cA pointer to an initialized struct representing the scheme
yA 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
resThe result of the decryption (the value will be stored here)
ciphersAn array of the encrypted coordinates of the vector
key_sharesAn array of the decryption key shares
labelA string label of the encrypted value
label_lenThe length of the label to prevent non NULL terminated strings
yA pointer to the inner-product vector
boundA bound on all the values of the encrypted vector and inner-product vector
Returns
Error code