CiFEr
damgard_multi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 XLAB d.o.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CIFER_DAMGARD_MULTI_H
18 #define CIFER_DAMGARD_MULTI_H
19 
20 #include "cifer/data/mat.h"
22 
33 typedef struct cfe_damgard_multi {
34  size_t num_clients;
35  mpz_t bound;
36  cfe_damgard scheme;
38 
42 typedef struct cfe_damgard_multi_sec_key {
43  size_t num_keys;
45  cfe_mat otp;
47 
52 typedef struct cfe_damgard_multi_fe_key {
53  cfe_damgard_fe_key *keys;
54  mpz_t z;
55  size_t num_clients;
57 
61 typedef struct cfe_damgard_multi_client {
62  mpz_t bound;
63  cfe_damgard scheme;
65 
80 cfe_error cfe_damgard_multi_init(cfe_damgard_multi *m, size_t num_clients, size_t l, size_t modulus_len, mpz_t bound);
81 
82 
98 cfe_error cfe_damgard_multi_precomp_init(cfe_damgard_multi *m, size_t num_clients, size_t l, size_t modulus_len, mpz_t bound);
99 
108 
118 
129 
138 
146 
154 
165 
178 
187 
201 cfe_error
203  cfe_mat *y);
204 
213 
228 cfe_error
230 
245 cfe_error cfe_damgard_multi_decrypt(mpz_t res, cfe_damgard_multi *m, cfe_vec *ciphertext,
246  cfe_damgard_multi_fe_key *fe_key, cfe_mat *y);
247 
248 #endif
cfe_damgard_multi
Definition: damgard_multi.h:33
cfe_damgard_multi
struct cfe_damgard_multi cfe_damgard_multi
cfe_damgard_multi_sec_key_free
void cfe_damgard_multi_sec_key_free(cfe_damgard_multi_sec_key *key)
cfe_damgard_multi_fe_key_free
void cfe_damgard_multi_fe_key_free(cfe_damgard_multi_fe_key *key)
cfe_vec
Definition: vec.h:41
cfe_damgard_multi_encrypt
cfe_error cfe_damgard_multi_encrypt(cfe_vec *ciphertext, cfe_damgard_multi_client *e, cfe_vec *x, cfe_vec *pub_key, cfe_vec *otp)
cfe_damgard_multi_generate_master_keys
void cfe_damgard_multi_generate_master_keys(cfe_mat *mpk, cfe_damgard_multi_sec_key *msk, cfe_damgard_multi *m)
cfe_damgard_multi_precomp_init
cfe_error cfe_damgard_multi_precomp_init(cfe_damgard_multi *m, size_t num_clients, size_t l, size_t modulus_len, mpz_t bound)
cfe_damgard_multi_client_init
void cfe_damgard_multi_client_init(cfe_damgard_multi_client *e, cfe_damgard_multi *m)
mat.h
Matrix struct and operations.
cfe_damgard_multi_sec_key
Definition: damgard_multi.h:42
damgard.h
Damgard scheme.
cfe_damgard_multi_client
Definition: damgard_multi.h:61
cfe_damgard_multi_init
cfe_error cfe_damgard_multi_init(cfe_damgard_multi *m, size_t num_clients, size_t l, size_t modulus_len, mpz_t bound)
cfe_damgard_multi_fe_key
struct cfe_damgard_multi_fe_key cfe_damgard_multi_fe_key
cfe_damgard_multi_sec_key
struct cfe_damgard_multi_sec_key cfe_damgard_multi_sec_key
cfe_damgard_multi_fe_key_init
void cfe_damgard_multi_fe_key_init(cfe_damgard_multi_fe_key *fe_key, cfe_damgard_multi *m)
cfe_damgard_multi_client_free
void cfe_damgard_multi_client_free(cfe_damgard_multi_client *e)
cfe_damgard_sec_key
Definition: damgard.h:44
cfe_damgard
Definition: damgard.h:32
cfe_damgard_multi_fe_key
Definition: damgard_multi.h:52
cfe_damgard_multi_client
struct cfe_damgard_multi_client cfe_damgard_multi_client
cfe_damgard_multi_decrypt
cfe_error cfe_damgard_multi_decrypt(mpz_t res, cfe_damgard_multi *m, cfe_vec *ciphertext, cfe_damgard_multi_fe_key *fe_key, cfe_mat *y)
cfe_damgard_fe_key
Definition: damgard.h:52
cfe_damgard_multi_copy
void cfe_damgard_multi_copy(cfe_damgard_multi *res, cfe_damgard_multi *m)
cfe_damgard_multi_master_keys_init
void cfe_damgard_multi_master_keys_init(cfe_mat *mpk, cfe_damgard_multi_sec_key *msk, cfe_damgard_multi *m)
cfe_damgard_multi_free
void cfe_damgard_multi_free(cfe_damgard_multi *m)
cfe_damgard_multi_derive_fe_key
cfe_error cfe_damgard_multi_derive_fe_key(cfe_damgard_multi_fe_key *fe_key, cfe_damgard_multi *m, cfe_damgard_multi_sec_key *msk, cfe_mat *y)
cfe_damgard_multi_ciphertext_init
void cfe_damgard_multi_ciphertext_init(cfe_vec *ciphertext, cfe_damgard_multi_client *e)
cfe_mat
Definition: mat.h:44