CiFEr
dmcfe.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 
18 #ifndef CIFER_DMCFE_H
19 #define CIFER_DMCFE_H
20 
21 #include "cifer/data/mat.h"
22 #include "cifer/data/vec_curve.h"
23 
35 typedef struct cfe_dmcfe_client {
36  size_t idx;
37  BIG_256_56 client_sec_key_big;
38  ECP_BN254 client_pub_key;
39  cfe_mat share;
40  cfe_vec s;
41  mpz_t order;
42  BIG_256_56 order_big;
44 
52 void cfe_dmcfe_client_init(cfe_dmcfe_client *c, size_t idx);
53 
62 
72 void cfe_dmcfe_set_share(cfe_dmcfe_client *c, ECP_BN254 *pub_keys, size_t num_clients);
73 
86 void cfe_dmcfe_encrypt(ECP_BN254 *cipher, cfe_dmcfe_client *c, mpz_t x, char *label, size_t label_len);
87 
93 void cfe_dmcfe_fe_key_part_init(cfe_vec_G2 *fe_key_part);
94 
105 
123 cfe_error cfe_dmcfe_decrypt(mpz_t res, ECP_BN254 *ciphers, cfe_vec_G2 *key_shares,
124  char *label, size_t label_len, cfe_vec *y, mpz_t bound);
125 
126 #endif
cfe_vec
Definition: vec.h:41
cfe_dmcfe_client_free
void cfe_dmcfe_client_free(cfe_dmcfe_client *c)
mat.h
Matrix struct and operations.
cfe_dmcfe_set_share
void cfe_dmcfe_set_share(cfe_dmcfe_client *c, ECP_BN254 *pub_keys, size_t num_clients)
cfe_dmcfe_decrypt
cfe_error cfe_dmcfe_decrypt(mpz_t res, ECP_BN254 *ciphers, cfe_vec_G2 *key_shares, char *label, size_t label_len, cfe_vec *y, mpz_t bound)
vec_curve.h
Vectors of elements of an elliptic curve struct and operations on it.
cfe_dmcfe_derive_fe_key_part
void cfe_dmcfe_derive_fe_key_part(cfe_vec_G2 *fe_key_part, cfe_dmcfe_client *c, cfe_vec *y)
cfe_dmcfe_fe_key_part_init
void cfe_dmcfe_fe_key_part_init(cfe_vec_G2 *fe_key_part)
cfe_dmcfe_client
Definition: dmcfe.h:35
cfe_dmcfe_encrypt
void cfe_dmcfe_encrypt(ECP_BN254 *cipher, cfe_dmcfe_client *c, mpz_t x, char *label, size_t label_len)
cfe_dmcfe_client
struct cfe_dmcfe_client cfe_dmcfe_client
cfe_vec_G2
Definition: vec_curve.h:42
cfe_dmcfe_client_init
void cfe_dmcfe_client_init(cfe_dmcfe_client *c, size_t idx)
cfe_mat
Definition: mat.h:44