CiFEr
fh_multi_ipe.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_FH_MULTI_IPE_H
18 #define CIFER_FH_MULTI_IPE_H
19 
20 #include "cifer/data/mat.h"
21 #include "cifer/data/mat_curve.h"
22 
45 typedef struct cfe_fh_multi_ipe {
46  size_t sec_level;
47  size_t num_clients;
48  size_t vec_len;
49  mpz_t bound_x;
50  mpz_t bound_y;
51  mpz_t order;
53 
68 cfe_error cfe_fh_multi_ipe_init(cfe_fh_multi_ipe *c, size_t sec_level, size_t num_clients,
69  size_t vec_len, mpz_t bound_x, mpz_t bound_y);
70 
80 
89 
93 typedef struct cfe_fh_multi_ipe_sec_key {
94  cfe_mat *B_hat;
95  cfe_mat *B_star_hat;
96  size_t num_clients;
98 
107  cfe_fh_multi_ipe *c);
108 
116 
130  FP12_BN254 *pub_key, cfe_fh_multi_ipe *c);
131 
141 
142 
156  cfe_fh_multi_ipe_sec_key *sec_key,
157  cfe_fh_multi_ipe *c);
158 
167 
168 
183 cfe_error cfe_fh_multi_ipe_encrypt(cfe_vec_G1 *cipher, cfe_vec *x,
184  cfe_mat *part_sec_key, cfe_fh_multi_ipe *c);
185 
200 cfe_error cfe_fh_multi_ipe_decrypt(mpz_t res, cfe_vec_G1 *ciphers, cfe_mat_G2 *fe_key,
201  FP12_BN254 *pub_key, cfe_fh_multi_ipe *c);
202 
203 #endif
cfe_fh_multi_ipe_init
cfe_error cfe_fh_multi_ipe_init(cfe_fh_multi_ipe *c, size_t sec_level, size_t num_clients, size_t vec_len, mpz_t bound_x, mpz_t bound_y)
cfe_vec_G1
Definition: vec_curve.h:34
cfe_fh_multi_ipe_generate_keys
cfe_error cfe_fh_multi_ipe_generate_keys(cfe_fh_multi_ipe_sec_key *sec_key, FP12_BN254 *pub_key, cfe_fh_multi_ipe *c)
cfe_vec
Definition: vec.h:41
cfe_fh_multi_ipe_derive_fe_key
cfe_error cfe_fh_multi_ipe_derive_fe_key(cfe_mat_G2 *fe_key, cfe_mat *y, cfe_fh_multi_ipe_sec_key *sec_key, cfe_fh_multi_ipe *c)
cfe_fh_multi_ipe
Definition: fh_multi_ipe.h:45
cfe_fh_multi_ipe_encrypt
cfe_error cfe_fh_multi_ipe_encrypt(cfe_vec_G1 *cipher, cfe_vec *x, cfe_mat *part_sec_key, cfe_fh_multi_ipe *c)
mat.h
Matrix struct and operations.
cfe_fh_multi_ipe_sec_key
Definition: fh_multi_ipe.h:93
cfe_fh_multi_ipe_fe_key_init
void cfe_fh_multi_ipe_fe_key_init(cfe_mat_G2 *fe_key, cfe_fh_multi_ipe *c)
cfe_mat_G2
Definition: mat_curve.h:42
cfe_fh_multi_ipe_free
void cfe_fh_multi_ipe_free(cfe_fh_multi_ipe *c)
cfe_fh_multi_ipe
struct cfe_fh_multi_ipe cfe_fh_multi_ipe
cfe_fh_multi_ipe_decrypt
cfe_error cfe_fh_multi_ipe_decrypt(mpz_t res, cfe_vec_G1 *ciphers, cfe_mat_G2 *fe_key, FP12_BN254 *pub_key, cfe_fh_multi_ipe *c)
cfe_fh_multi_ipe_master_key_free
void cfe_fh_multi_ipe_master_key_free(cfe_fh_multi_ipe_sec_key *sec_key)
mat_curve.h
Matrices of elements of an elliptic curve struct and operations on it.
cfe_fh_multi_ipe_copy
void cfe_fh_multi_ipe_copy(cfe_fh_multi_ipe *res, cfe_fh_multi_ipe *c)
cfe_fh_multi_ipe_master_key_init
void cfe_fh_multi_ipe_master_key_init(cfe_fh_multi_ipe_sec_key *sec_key, cfe_fh_multi_ipe *c)
cfe_fh_multi_ipe_sec_key
struct cfe_fh_multi_ipe_sec_key cfe_fh_multi_ipe_sec_key
cfe_fh_multi_ipe_ciphertext_init
void cfe_fh_multi_ipe_ciphertext_init(cfe_vec_G1 *cipher, cfe_fh_multi_ipe *c)
cfe_mat
Definition: mat.h:44