CiFEr
|
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 |
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 struct cfe_damgard_dec_multi_client 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).
typedef struct cfe_damgard_dec_multi_dec cfe_damgard_dec_multi_dec |
cfe_damgard_dec_multi_dec represents a decryptor in a decentralized multi input Damgard style scheme.
typedef struct cfe_damgard_dec_multi_sec_key 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 represents a functional encryption key needed for the decryption.
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.
c | A pointer to an uninitialized struct representing the scheme |
damgard_multi | A pointer to a damgard_multi scheme on top of which the decentralized scheme is based. |
idx | Identification value of the client; it is assumed that if there are n clients, their identifications are from [0,n) |
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.
c | A pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct) |
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.
c | A pointer to an initialized struct representing the scheme |
pub_keys | An array of public keys |
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.
sec_key | A pointer to an uninitialized cfe_damgard_dec_multi_sec_key struct |
c | A pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct) |
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.
sec_key | A pointer to an instance of the secret key (initialized cfe_damgard_dec_multi_sec_key struct) |
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.
sec_key | A pointer to an instance of the secret key (initialized cfe_damgard_dec_multi_sec_key struct) |
c | A pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct) |
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.
ciphertext | A pointer to an uninitialized cfe_vec struct |
c | A pointer to an instance of the scheme (initialized cfe_damgard_dec_multi_client struct) |
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.
cipher | A pointer to cfe_vec struct (the resulting ciphertext will be stored here) |
x | The input value |
sec_key | A pointer to client's secret key |
c | A pointer to a struct representing a client (initialized cfe_damgard_dec_multi_client) |
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.
fe_key_part | A pointer to an uninitialized cfe_damgard_dec_multi_fe_key_part struct |
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.
fe_key_part | A pointer to an instance of the functional encryption key.(initialized cfe_damgard_dec_multi_client struct) |
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.
fe_key_part | A pointer to initialized cfe_damgard_dec_multi_fe_key_part (the key part will be save here) |
y | A 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_key | A client's secret key |
c | A pointer to an initialized struct representing the scheme |
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.
d | A pointer to an uninitialized cfe_damgard_dec_multi_dec struct |
damgard_multi | A pointer to the underlying damgard_multi scheme on which the decentralization is based |
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.
d | A pointer to an instance of the decryptor.(initialized cfe_damgard_dec_multi_dec struct) |
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.
res | The result of the decryption (the value will be stored here) |
ciphers | An array of the encrypted coordinates of the vector |
fe_key_parts | An array of the decryption key shares |
y | A pointer to the inner-product matrix |
d | A pointer to an instance of the decryptor.(initialized cfe_damgard_dec_multi_dec struct) |