CiFEr
Data Structures | Typedefs | Functions
damgard_dec_multi.h File Reference

Damgard style decentralized multi input scheme. The decentralization is based on paper by Abdalla, Benhamouda, Kohlweiss, and Waldner: "Decentralizing Inner-Product Functional Encryption". The participants in the scheme are clients without a central authority. They interactively generate private keys for each client so that client i can encrypt vector x_i. The scheme allows the clients to interactively generate a key_Y, depending on a matrix Y with rows y_i, so that given key_Y and the ciphertexts the decryptor can compute value Σ_i <x_i, y_i> (sum of dot products). More...

Go to the source code of this file.

Data Structures

struct  cfe_damgard_dec_multi_client
 
struct  cfe_damgard_dec_multi_dec
 
struct  cfe_damgard_dec_multi_sec_key
 
struct  cfe_damgard_dec_multi_fe_key_part
 

Typedefs

typedef struct cfe_damgard_dec_multi_client cfe_damgard_dec_multi_client
 
typedef struct cfe_damgard_dec_multi_dec cfe_damgard_dec_multi_dec
 
typedef struct cfe_damgard_dec_multi_sec_key cfe_damgard_dec_multi_sec_key
 
typedef struct cfe_damgard_dec_multi_fe_key_part cfe_damgard_dec_multi_fe_key_part
 

Functions

void cfe_damgard_dec_multi_client_init (cfe_damgard_dec_multi_client *c, cfe_damgard_multi *damgard_multi, size_t idx)
 
void cfe_damgard_dec_multi_client_free (cfe_damgard_dec_multi_client *c)
 
void cfe_damgard_dec_multi_client_set_share (cfe_damgard_dec_multi_client *c, mpz_t *pub_keys)
 
void cfe_damgard_dec_multi_sec_key_init (cfe_damgard_dec_multi_sec_key *sec_key, cfe_damgard_dec_multi_client *c)
 
void cfe_damgard_dec_multi_sec_key_free (cfe_damgard_dec_multi_sec_key *sec_key)
 
void cfe_damgard_dec_multi_generate_keys (cfe_damgard_dec_multi_sec_key *sec_key, cfe_damgard_dec_multi_client *c)
 
void cfe_damgard_dec_multi_ciphertext_init (cfe_vec *ciphertext, cfe_damgard_dec_multi_client *c)
 
cfe_error cfe_damgard_dec_multi_encrypt (cfe_vec *cipher, cfe_vec *x, cfe_damgard_dec_multi_sec_key *sec_key, cfe_damgard_dec_multi_client *c)
 
void cfe_damgard_dec_multi_fe_key_share_init (cfe_damgard_dec_multi_fe_key_part *fe_key_part)
 
void cfe_damgard_dec_multi_fe_key_free (cfe_damgard_dec_multi_fe_key_part *fe_key_part)
 
cfe_error cfe_damgard_dec_multi_client_derive_fe_key_part (cfe_damgard_dec_multi_fe_key_part *fe_key_part, cfe_mat *y, cfe_damgard_dec_multi_sec_key *sec_key, cfe_damgard_dec_multi_client *c)
 
void cfe_damgard_dec_multi_dec_init (cfe_damgard_dec_multi_dec *d, cfe_damgard_multi *damgard_multi)
 
void cfe_damgard_dec_multi_dec_free (cfe_damgard_dec_multi_dec *d)
 
cfe_error cfe_damgard_dec_multi_decrypt (mpz_t res, cfe_vec *ciphers, cfe_damgard_dec_multi_fe_key_part *fe_key_parts, cfe_mat *y, cfe_damgard_dec_multi_dec *d)
 

Detailed Description

Damgard style decentralized multi input scheme. The decentralization is based on paper by Abdalla, Benhamouda, Kohlweiss, and Waldner: "Decentralizing Inner-Product Functional Encryption". The participants in the scheme are clients without a central authority. They interactively generate private keys for each client so that client i can encrypt vector x_i. The scheme allows the clients to interactively generate a key_Y, depending on a matrix Y with rows y_i, so that given key_Y and the ciphertexts the decryptor can compute value Σ_i <x_i, y_i> (sum of dot products).

Typedef Documentation

◆ cfe_damgard_dec_multi_client

cfe_damgard_dec_multi_client represents a client in a decentralized multi input variant of the underlying Damgard scheme. Each client has an identification idx, a Diffie-Hellman type of public and secret key and a secret share. It is implicitly assumed that if there are n clients, their idxs are in [0,n).

◆ cfe_damgard_dec_multi_dec

cfe_damgard_dec_multi_dec represents a decryptor in a decentralized multi input Damgard style scheme.

◆ cfe_damgard_dec_multi_sec_key

cfe_damgard_dec_multi_sec_key represents a secret key that each client posses and is needed for encryption, and derivation of functional encryption keys. This key should be different for each new encryption.

◆ cfe_damgard_dec_multi_fe_key_part

cfe_damgard_dec_multi_fe_key_part represents a functional encryption key needed for the decryption.

Function Documentation

◆ cfe_damgard_dec_multi_client_init()

void cfe_damgard_dec_multi_client_init ( cfe_damgard_dec_multi_client c,
cfe_damgard_multi damgard_multi,
size_t  idx 
)

Configures a new client for the cfe_damgard_dec_multi scheme.

Parameters
cA pointer to an uninitialized struct representing the scheme
damgard_multiA pointer to a damgard_multi scheme on top of which the decentralized scheme is based.
idxIdentification value of the client; it is assumed that if there are n clients, their identifications are from [0,n)

◆ cfe_damgard_dec_multi_client_free()

void cfe_damgard_dec_multi_client_free ( cfe_damgard_dec_multi_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_damgard_dec_multi_client struct)

◆ cfe_damgard_dec_multi_client_set_share()

void cfe_damgard_dec_multi_client_set_share ( cfe_damgard_dec_multi_client c,
mpz_t *  pub_keys 
)

Sets a secret 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) and their public keys are given by an array in the corresponding order.

Parameters
cA pointer to an initialized struct representing the scheme
pub_keysAn array of public keys

◆ cfe_damgard_dec_multi_sec_key_init()

void cfe_damgard_dec_multi_sec_key_init ( cfe_damgard_dec_multi_sec_key sec_key,
cfe_damgard_dec_multi_client c 
)

Initializes the structs which represent the secret key of each client, needed for the encryption and derivation of functional key.

Parameters
sec_keyA pointer to an uninitialized cfe_damgard_dec_multi_sec_key struct
cA pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct)

◆ cfe_damgard_dec_multi_sec_key_free()

void cfe_damgard_dec_multi_sec_key_free ( cfe_damgard_dec_multi_sec_key sec_key)

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

Parameters
sec_keyA pointer to an instance of the secret key (initialized cfe_damgard_dec_multi_sec_key struct)

◆ cfe_damgard_dec_multi_generate_keys()

void cfe_damgard_dec_multi_generate_keys ( cfe_damgard_dec_multi_sec_key sec_key,
cfe_damgard_dec_multi_client c 
)

Generates a secret key for a client.

Parameters
sec_keyA pointer to an instance of the secret key (initialized cfe_damgard_dec_multi_sec_key struct)
cA pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct)

◆ cfe_damgard_dec_multi_ciphertext_init()

void cfe_damgard_dec_multi_ciphertext_init ( cfe_vec ciphertext,
cfe_damgard_dec_multi_client c 
)

Initializes the struct which represents the ciphertext of each client.

Parameters
ciphertextA pointer to an uninitialized cfe_vec struct
cA pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct)

◆ cfe_damgard_dec_multi_encrypt()

cfe_error cfe_damgard_dec_multi_encrypt ( cfe_vec cipher,
cfe_vec x,
cfe_damgard_dec_multi_sec_key sec_key,
cfe_damgard_dec_multi_client c 
)

Each client encrypts an input vector x using its secret key.

Parameters
cipherA pointer to cfe_vec struct (the resulting ciphertext will be stored here)
xThe input value
sec_keyA pointer to client's secret key
cA pointer to a struct representing a client (initialized cfe_damgard_dec_multi_client)
Returns
Error code

◆ cfe_damgard_dec_multi_fe_key_share_init()

void cfe_damgard_dec_multi_fe_key_share_init ( cfe_damgard_dec_multi_fe_key_part fe_key_part)

Initializes the structs which represent a part of functional encryption key.

Parameters
fe_key_partA pointer to an uninitialized cfe_damgard_dec_multi_fe_key_part struct

◆ cfe_damgard_dec_multi_fe_key_free()

void cfe_damgard_dec_multi_fe_key_free ( cfe_damgard_dec_multi_fe_key_part fe_key_part)

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

Parameters
fe_key_partA pointer to an instance of the functional encryption key.(initialized cfe_damgard_dec_multi_client struct)

◆ cfe_damgard_dec_multi_client_derive_fe_key_part()

cfe_error cfe_damgard_dec_multi_client_derive_fe_key_part ( cfe_damgard_dec_multi_fe_key_part fe_key_part,
cfe_mat y,
cfe_damgard_dec_multi_sec_key sec_key,
cfe_damgard_dec_multi_client c 
)

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

Parameters
fe_key_partA pointer to initialized cfe_damgard_dec_multi_fe_key_part (the key part will be save here)
yA pointer to the inner-product matrix, i.e. decryption of Σ_i <x_i, y_i> will be possible where y_i is a row of y.
sec_keyA client's secret key
cA pointer to an initialized struct representing the scheme
Returns
Error code

◆ cfe_damgard_dec_multi_dec_init()

void cfe_damgard_dec_multi_dec_init ( cfe_damgard_dec_multi_dec d,
cfe_damgard_multi damgard_multi 
)

Initializes the struct which represents a decryptor in a in a decentralized multi input Damgard style scheme.

Parameters
dA pointer to an uninitialized cfe_damgard_dec_multi_dec struct
damgard_multiA pointer to the underlying damgard_multi scheme on which the decentralization is based

◆ cfe_damgard_dec_multi_dec_free()

void cfe_damgard_dec_multi_dec_free ( cfe_damgard_dec_multi_dec d)

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

Parameters
dA pointer to an instance of the decryptor.(initialized cfe_damgard_dec_multi_dec struct)

◆ cfe_damgard_dec_multi_decrypt()

cfe_error cfe_damgard_dec_multi_decrypt ( mpz_t  res,
cfe_vec ciphers,
cfe_damgard_dec_multi_fe_key_part fe_key_parts,
cfe_mat y,
cfe_damgard_dec_multi_dec d 
)

Accepts an array of ciphers, i.e. the encrypted vectors, an array of functional encryption key parts for the inner-product, a plaintext inner product matrix y, and the decryptor instance. It calculates the value Σ_i <x_i, y_i> (sum of inner products). 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
fe_key_partsAn array of the decryption key shares
yA pointer to the inner-product matrix
dA pointer to an instance of the decryptor.(initialized cfe_damgard_dec_multi_dec struct)
Returns
Error code