CiFEr
damgard_dec_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_DEC_MULTI_H
18 #define CIFER_DAMGARD_DEC_MULTI_H
19 
20 #include "cifer/data/vec.h"
21 #include "cifer/internal/errors.h"
23 
46  size_t idx;
47  cfe_damgard_multi scheme;
48  mpz_t client_pub_key;
49  mpz_t client_sec_key;
50  cfe_mat share;
52 
57 typedef struct cfe_damgard_dec_multi_dec {
58  cfe_damgard_multi scheme;
60 
67  cfe_damgard_sec_key dam_sec_key;
68  cfe_vec dam_pub_key;
69  cfe_vec otp_key;
71 
77  cfe_damgard_fe_key key_part;
78  mpz_t otp_key_part;
80 
91  cfe_damgard_multi *damgard_multi, size_t idx);
92 
101 
112  mpz_t *pub_keys);
113 
124 
133 
144 
154 
166 cfe_error cfe_damgard_dec_multi_encrypt(cfe_vec *cipher, cfe_vec *x,
169 
177 
187 
203 
213  cfe_damgard_multi *damgard_multi);
214 
223 
238 cfe_error cfe_damgard_dec_multi_decrypt(mpz_t res, cfe_vec *ciphers,
239  cfe_damgard_dec_multi_fe_key_part *fe_key_parts, cfe_mat *y,
241 
242 #endif
cfe_damgard_dec_multi_client
struct cfe_damgard_dec_multi_client cfe_damgard_dec_multi_client
cfe_damgard_dec_multi_dec
struct cfe_damgard_dec_multi_dec cfe_damgard_dec_multi_dec
cfe_damgard_multi
Definition: damgard_multi.h:33
cfe_damgard_dec_multi_sec_key_free
void cfe_damgard_dec_multi_sec_key_free(cfe_damgard_dec_multi_sec_key *sec_key)
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)
cfe_damgard_dec_multi_fe_key_part
Definition: damgard_dec_multi.h:76
cfe_damgard_dec_multi_sec_key
struct cfe_damgard_dec_multi_sec_key cfe_damgard_dec_multi_sec_key
cfe_vec
Definition: vec.h:41
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)
cfe_damgard_dec_multi_client
Definition: damgard_dec_multi.h:45
errors.h
Error definitions.
cfe_damgard_dec_multi_client_free
void cfe_damgard_dec_multi_client_free(cfe_damgard_dec_multi_client *c)
cfe_damgard_dec_multi_dec
Definition: damgard_dec_multi.h:57
cfe_damgard_dec_multi_dec_init
void cfe_damgard_dec_multi_dec_init(cfe_damgard_dec_multi_dec *d, cfe_damgard_multi *damgard_multi)
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)
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)
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)
cfe_damgard_dec_multi_dec_free
void cfe_damgard_dec_multi_dec_free(cfe_damgard_dec_multi_dec *d)
cfe_damgard_dec_multi_sec_key
Definition: damgard_dec_multi.h:66
cfe_damgard_dec_multi_fe_key_part
struct cfe_damgard_dec_multi_fe_key_part cfe_damgard_dec_multi_fe_key_part
cfe_damgard_sec_key
Definition: damgard.h:44
cfe_damgard_dec_multi_ciphertext_init
void cfe_damgard_dec_multi_ciphertext_init(cfe_vec *ciphertext, cfe_damgard_dec_multi_client *c)
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)
vec.h
Vector struct and operations.
cfe_damgard_fe_key
Definition: damgard.h:52
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)
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)
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)
cfe_mat
Definition: mat.h:44
damgard_multi.h
Damgard multi input scheme.