Merge "Add password and authurl in global moonclient command."
[moon.git] / moon-abe / libbswabe-0.9 / private.h
1 /*
2         Include glib.h, pbc.h, and bswabe.h before including this file.
3 */
4
5 struct bswabe_pub_s
6 {
7         char* pairing_desc;
8         pairing_t p;
9         element_t g;           /* G_1 */
10         element_t h;           /* G_1 */
11         element_t gp;          /* G_2 */
12         element_t g_hat_alpha; /* G_T */
13 };
14
15 struct bswabe_msk_s
16 {
17         element_t beta;    /* Z_r */
18         element_t g_alpha; /* G_2 */
19 };
20
21 /* Attributes */
22 typedef struct
23 {
24         /* these actually get serialized */
25         char* attr;
26         element_t d;  /* G_2 */
27         element_t dp; /* G_2 */
28
29         /* only used during dec (only by dec_merge) */
30         int used;
31         element_t z;  /* G_1 */
32         element_t zp; /* G_1 */
33 }
34 bswabe_prv_comp_t;
35
36 struct bswabe_prv_s
37 {
38         element_t d;   /* G_2 */
39         GArray* comps; /* bswabe_prv_comp_t's */
40 };
41
42 typedef struct
43 {
44         int deg;
45         /* coefficients from [0] x^0 to [deg] x^deg */
46         element_t* coef; /* G_T (of length deg + 1) */
47 }
48 bswabe_polynomial_t;
49
50 typedef struct
51 {
52         /* serialized */
53         int k;            /* one if leaf, otherwise threshold */
54         char* attr;       /* attribute string if leaf, otherwise null */
55         element_t c;      /* G_1, only for leaves */
56         element_t cp;     /* G_1, only for leaves */
57         GPtrArray* children; /* pointers to bswabe_policy_t's, len == 0 for leaves */
58
59         /* only used during encryption */
60         bswabe_polynomial_t* q;
61
62         /* only used during decryption */
63         int satisfiable;
64         int min_leaves;
65         int attri;
66         GArray* satl;
67 }
68 bswabe_policy_t;
69
70 struct bswabe_cph_s
71 {
72         element_t cs; /* G_T */
73         element_t c;  /* G_1 */
74         bswabe_policy_t* p;
75         char* policy;
76 };
77
78 struct peks_sew_s
79 {
80         element_t A; /* G_1 */
81         element_t B;  /* G_T */
82 };
83
84 struct peks_trap_s
85 {
86         element_t T; /* G_1 */
87 };
88
89 struct peks_ind_s
90 {
91         GArray* comps; /* index's components */
92 };
93
94