-
Notifications
You must be signed in to change notification settings - Fork 0
/
preimage_chameleon_hash.h
69 lines (59 loc) · 2.33 KB
/
preimage_chameleon_hash.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef __PREIMAGE_CHAMELEON_HASH_H_
#define __PREIMAGE_CHAMELEON_HASH_H_
#include <stdbool.h>
struct message;
struct randomness;
struct digest;
struct eval_key;
struct trap_key;
struct ch_sys_params;
/* Initialization functions */
void chameleon_hash_init_sysparams(const unsigned int security_bits,
struct ch_sys_params *sys);
void chameleon_hash_init_message(const struct ch_sys_params *sys,
struct message *msg);
void chameleon_hash_init_randomness(const struct ch_sys_params *sys,
struct randomness *rnd);
void chameleon_hash_init_digest(const struct ch_sys_params *sys,
struct digest *dgt);
/* Finalization functions */
void chameleon_hash_destroy_sysparams(struct ch_sys_params *);
void chameleon_hash_destroy_keys(struct ch_sys_params *,
struct eval_key *, struct trap_key *);
void chameleon_hash_destroy_message(struct message *msg);
void chameleon_hash_destroy_randomness(struct randomness *rnd);
void chameleon_hash_destroy_digest(struct digest *dgt);
/* Print functions */
void chameleon_hash_print_sysparams(const struct ch_sys_params *);
void chameleon_hash_print_keys(const struct eval_key *,
const struct trap_key *);
void chameleon_hash_print_message(const struct message *msg);
void chameleon_hash_print_randomness(const struct randomness *rnd);
void chameleon_hash_print_digest(const struct digest *dgt);
/* Base Functions */
void chameleon_hash_keygen(const struct ch_sys_params *sys,
struct eval_key *ek,
struct trap_key *tk);
void chameleon_hash_hash(const struct ch_sys_params *sys,
const struct eval_key *,
const struct message *msg,
const struct randomness *rnd,
struct digest *dgt);
void chameleon_hash_preimage(const struct ch_sys_params *sys,
const struct trap_key *,
const struct message *msg,
const struct digest *dgt,
struct randomness *rnd);
/* Sampling Functions */
void chameleon_hash_sample_randomness(const struct ch_sys_params *sys,
const struct eval_key *ek,
struct randomness *rnd);
void chameleon_hash_sample_message(const struct ch_sys_params *sys,
const struct eval_key *ek,
struct message *msg);
void chameleon_hash_sample_digest(const struct ch_sys_params *sys,
const struct eval_key *ek,
struct digest *dgt);
/* Comparison*/
bool compare_digest(struct digest *, struct digest *);
#endif