CiFEr
ddh_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_DDH_MULTI_H
18 #define CIFER_DDH_MULTI_H
19 
20 #include "cifer/data/mat.h"
22 
32 typedef struct cfe_ddh_multi {
33  size_t slots;
34  cfe_ddh scheme;
36 
40 typedef struct cfe_ddh_multi_sec_key {
41  cfe_mat msk;
42  cfe_mat otp_key;
44 
49 typedef struct cfe_ddh_multi_fe_key {
50  cfe_vec keys;
51  mpz_t otp_key;
53 
57 typedef struct cfe_ddh_multi_enc {
58  cfe_ddh scheme;
60 
75 cfe_error cfe_ddh_multi_init(cfe_ddh_multi *m, size_t slots, size_t l, size_t modulus_len, mpz_t bound);
76 
92 cfe_error cfe_ddh_multi_precomp_init(cfe_ddh_multi *m, size_t slots, size_t l, size_t modulus_len, mpz_t bound);
93 
102 
112 
123 
132 
140 
148 
159 
168 
177 
190 
205 
220 cfe_error cfe_ddh_multi_encrypt(cfe_vec *ciphertext, cfe_ddh_multi_enc *e, cfe_vec *x, cfe_vec *pub_key, cfe_vec *otp);
221 
235 cfe_error
236 cfe_ddh_multi_decrypt(mpz_t res, cfe_ddh_multi *m, cfe_mat *ciphertext, cfe_ddh_multi_fe_key *key, cfe_mat *y);
237 
238 #endif
cfe_ddh_multi_sec_key
struct cfe_ddh_multi_sec_key cfe_ddh_multi_sec_key
cfe_vec
Definition: vec.h:41
cfe_ddh_multi_fe_key_free
void cfe_ddh_multi_fe_key_free(cfe_ddh_multi_fe_key *key)
cfe_ddh_multi_enc
struct cfe_ddh_multi_enc cfe_ddh_multi_enc
cfe_ddh_multi_master_keys_init
void cfe_ddh_multi_master_keys_init(cfe_mat *mpk, cfe_ddh_multi_sec_key *msk, cfe_ddh_multi *m)
cfe_ddh_multi_encrypt
cfe_error cfe_ddh_multi_encrypt(cfe_vec *ciphertext, cfe_ddh_multi_enc *e, cfe_vec *x, cfe_vec *pub_key, cfe_vec *otp)
cfe_ddh_multi_fe_key_init
void cfe_ddh_multi_fe_key_init(cfe_ddh_multi_fe_key *key, cfe_ddh_multi *m)
mat.h
Matrix struct and operations.
cfe_ddh_multi_generate_master_keys
void cfe_ddh_multi_generate_master_keys(cfe_mat *mpk, cfe_ddh_multi_sec_key *msk, cfe_ddh_multi *m)
cfe_ddh_multi_ciphertext_init
void cfe_ddh_multi_ciphertext_init(cfe_vec *ciphertext, cfe_ddh_multi_enc *e)
cfe_ddh_multi_enc_free
void cfe_ddh_multi_enc_free(cfe_ddh_multi_enc *e)
ddh.h
DDH scheme.
cfe_ddh_multi_free
void cfe_ddh_multi_free(cfe_ddh_multi *m)
cfe_ddh_multi_derive_fe_key
cfe_error cfe_ddh_multi_derive_fe_key(cfe_ddh_multi_fe_key *res, cfe_ddh_multi *m, cfe_ddh_multi_sec_key *msk, cfe_mat *y)
cfe_ddh_multi_enc_init
void cfe_ddh_multi_enc_init(cfe_ddh_multi_enc *e, cfe_ddh_multi *m)
cfe_ddh_multi
Definition: ddh_multi.h:32
cfe_ddh_multi_fe_key
Definition: ddh_multi.h:49
cfe_ddh_multi_copy
void cfe_ddh_multi_copy(cfe_ddh_multi *res, cfe_ddh_multi *m)
cfe_ddh_multi_sec_key_free
void cfe_ddh_multi_sec_key_free(cfe_ddh_multi_sec_key *key)
cfe_ddh_multi_sec_key
Definition: ddh_multi.h:40
cfe_ddh_multi
struct cfe_ddh_multi cfe_ddh_multi
cfe_ddh_multi_fe_key
struct cfe_ddh_multi_fe_key cfe_ddh_multi_fe_key
cfe_ddh
Definition: ddh.h:32
cfe_ddh_multi_precomp_init
cfe_error cfe_ddh_multi_precomp_init(cfe_ddh_multi *m, size_t slots, size_t l, size_t modulus_len, mpz_t bound)
cfe_ddh_multi_decrypt
cfe_error cfe_ddh_multi_decrypt(mpz_t res, cfe_ddh_multi *m, cfe_mat *ciphertext, cfe_ddh_multi_fe_key *key, cfe_mat *y)
cfe_ddh_multi_init
cfe_error cfe_ddh_multi_init(cfe_ddh_multi *m, size_t slots, size_t l, size_t modulus_len, mpz_t bound)
cfe_ddh_multi_enc
Definition: ddh_multi.h:57
cfe_mat
Definition: mat.h:44