diff options
author | Ruan HE <ruan.he@orange.com> | 2015-09-04 07:35:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-09-04 07:35:06 +0000 |
commit | ca6aa8198d2335f8c326c3dd4d26bf5899064214 (patch) | |
tree | 6274a2d971fc0cac0896efe8583927d0190e3d20 /moon-abe/libbswabe-0.9/private.h | |
parent | 92fd2dbfb672d7b2b1cdfd5dd5cf89f7716b3e12 (diff) | |
parent | 3baeb11a8fbcfcdbc31976d421f17b85503b3ecd (diff) |
Merge "init attribute-based encryption"
Diffstat (limited to 'moon-abe/libbswabe-0.9/private.h')
-rw-r--r-- | moon-abe/libbswabe-0.9/private.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/moon-abe/libbswabe-0.9/private.h b/moon-abe/libbswabe-0.9/private.h new file mode 100644 index 00000000..3498f17b --- /dev/null +++ b/moon-abe/libbswabe-0.9/private.h @@ -0,0 +1,94 @@ +/* + Include glib.h, pbc.h, and bswabe.h before including this file. +*/ + +struct bswabe_pub_s +{ + char* pairing_desc; + pairing_t p; + element_t g; /* G_1 */ + element_t h; /* G_1 */ + element_t gp; /* G_2 */ + element_t g_hat_alpha; /* G_T */ +}; + +struct bswabe_msk_s +{ + element_t beta; /* Z_r */ + element_t g_alpha; /* G_2 */ +}; + +/* Attributes */ +typedef struct +{ + /* these actually get serialized */ + char* attr; + element_t d; /* G_2 */ + element_t dp; /* G_2 */ + + /* only used during dec (only by dec_merge) */ + int used; + element_t z; /* G_1 */ + element_t zp; /* G_1 */ +} +bswabe_prv_comp_t; + +struct bswabe_prv_s +{ + element_t d; /* G_2 */ + GArray* comps; /* bswabe_prv_comp_t's */ +}; + +typedef struct +{ + int deg; + /* coefficients from [0] x^0 to [deg] x^deg */ + element_t* coef; /* G_T (of length deg + 1) */ +} +bswabe_polynomial_t; + +typedef struct +{ + /* serialized */ + int k; /* one if leaf, otherwise threshold */ + char* attr; /* attribute string if leaf, otherwise null */ + element_t c; /* G_1, only for leaves */ + element_t cp; /* G_1, only for leaves */ + GPtrArray* children; /* pointers to bswabe_policy_t's, len == 0 for leaves */ + + /* only used during encryption */ + bswabe_polynomial_t* q; + + /* only used during decryption */ + int satisfiable; + int min_leaves; + int attri; + GArray* satl; +} +bswabe_policy_t; + +struct bswabe_cph_s +{ + element_t cs; /* G_T */ + element_t c; /* G_1 */ + bswabe_policy_t* p; + char* policy; +}; + +struct peks_sew_s +{ + element_t A; /* G_1 */ + element_t B; /* G_T */ +}; + +struct peks_trap_s +{ + element_t T; /* G_1 */ +}; + +struct peks_ind_s +{ + GArray* comps; /* index's components */ +}; + + |