5 typedef struct dipe_param
* dipe_param_t
;
6 typedef struct dipe_master_publickey
* dipe_master_publickey_t
;
7 typedef struct dipe_master_secretkey
* dipe_master_secretkey_t
;
8 typedef struct dipe_secretkey
* dipe_secretkey_t
;
9 typedef struct dipe_ctxt
* dipe_ctxt_t
;
11 void dipe_init(FILE* configfp
, dipe_param_t
* param
);
12 pairing_t
* dipe_get_pairing(dipe_param_t param
);
14 void dipe_master_keygen(dipe_param_t param
, size_t dimension
, dipe_master_publickey_t
* pk
, dipe_master_secretkey_t
* sk
);
15 void dipe_keygen(dipe_param_t param
, dipe_master_secretkey_t msk
, const char* cid
, element_t
* y
, dipe_secretkey_t
* sk
);
17 void dipe_encrypt(dipe_param_t param
, size_t mpkcount
, dipe_master_publickey_t
* mpk
, size_t threshold
, element_t
* x
, size_t ptxt_len
, char* ptxt
, size_t ctxt_len
, char* ctxt
);
18 size_t dipe_decrypt(dipe_param_t param
, size_t skcount
, dipe_secretkey_t
* sk
, size_t sharecount
, const char* cid
, element_t
* y
, size_t ctxt_len
, char* ctxt
, char* ptxt
);
19 size_t dipe_ciphertext_overhead(dipe_param_t param
, size_t dimension
, size_t shares
);
21 void dipe_encap(dipe_param_t param
, size_t mpkcount
, dipe_master_publickey_t
* mpk
, size_t threshold
, element_t
* x
,
22 element_t ptxt
, dipe_ctxt_t
* ctxt
);
23 void dipe_decap(dipe_param_t param
, size_t skcount
, dipe_secretkey_t
* sk
, const char* cid
, element_t
* y
,
24 dipe_ctxt_t ctxt
, element_t ptxt
);
26 void dipe_ss_share(dipe_param_t param
, size_t id_size
, element_t
* ids
, size_t fid_size
, element_t
* fake_ids
,
27 size_t share_size
, element_t
** shares
, element_t
* secret
, element_t
** dummy_shares
);
28 void dipe_ss_recover(dipe_param_t param
, size_t id_size
, element_t
* ids
, size_t share_size
, element_t
** shares
, element_t
* secret
);
30 size_t dipe_serialize_ctxt(dipe_param_t param
, dipe_ctxt_t ctxt
, uint8_t* buffer
);
31 size_t dipe_deserialize_ctxt(dipe_param_t param
, size_t dimension
, size_t shares
, dipe_ctxt_t
* ctxt
, uint8_t* buffer
);
33 void dipe_free_param(dipe_param_t param
);
34 void dipe_free_master_secretkey(dipe_master_secretkey_t sk
);
35 void dipe_free_master_publickey(dipe_master_publickey_t pk
);
36 void dipe_free_secretkey(dipe_secretkey_t sk
);
37 void dipe_free_ctxt(dipe_ctxt_t ctxt
);