diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-08-17 15:18:39 +0200 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-08-17 15:18:39 +0200 |
commit | a6581f9ede6cae352c71a4a632513d74bb45695a (patch) | |
tree | 3025d674508a5dfb1998c0eb94199108f318c055 /src/zklaim/zklaim_functions.c | |
parent | cfb3c27290ab28f4b081908536fca1910ae364fb (diff) | |
download | gnunet-a6581f9ede6cae352c71a4a632513d74bb45695a.tar.gz gnunet-a6581f9ede6cae352c71a4a632513d74bb45695a.zip |
add prove and issue
Diffstat (limited to 'src/zklaim/zklaim_functions.c')
-rw-r--r-- | src/zklaim/zklaim_functions.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/zklaim/zklaim_functions.c b/src/zklaim/zklaim_functions.c index 268056698..3c968cfea 100644 --- a/src/zklaim/zklaim_functions.c +++ b/src/zklaim/zklaim_functions.c | |||
@@ -98,3 +98,44 @@ ZKLAIM_context_issue (struct GNUNET_ZKLAIM_Context *ctx, | |||
98 | ZKLAIM_context_sign (ctx, | 98 | ZKLAIM_context_sign (ctx, |
99 | key); | 99 | key); |
100 | } | 100 | } |
101 | |||
102 | void | ||
103 | ZKLAIM_context_prove (struct GNUNET_ZKLAIM_Context *ctx, | ||
104 | GNUNET_ZKLAIM_PredicateIterator iter, | ||
105 | void *iter_cls) | ||
106 | { | ||
107 | int i; | ||
108 | int j; | ||
109 | char *attr_name; | ||
110 | char *tmp; | ||
111 | zklaim_wrap_payload_ctx *plw; | ||
112 | |||
113 | tmp = GNUNET_strdup (ctx->attrs); | ||
114 | attr_name = strtok (tmp, ","); | ||
115 | plw = ctx->ctx->pl_ctx_head; | ||
116 | |||
117 | for (i = 0; i < ctx->ctx->num_of_payloads; i++) | ||
118 | { | ||
119 | for (j = 0; j < ZKLAIM_MAX_PAYLOAD_ATTRIBUTES; j++) | ||
120 | { | ||
121 | GNUNET_assert (NULL != attr_name); | ||
122 | iter (iter_cls, | ||
123 | attr_name, | ||
124 | &plw->pl.data_op[i], | ||
125 | &plw->pl.data_ref[i]); | ||
126 | attr_name = strtok (NULL, ","); | ||
127 | } | ||
128 | plw = plw->next; | ||
129 | GNUNET_assert (NULL != plw); | ||
130 | } | ||
131 | GNUNET_free (tmp); | ||
132 | |||
133 | } | ||
134 | |||
135 | int | ||
136 | ZKLAIM_context_verify (struct GNUNET_ZKLAIM_Context *ctx, | ||
137 | const struct GNUNET_CRYPTO_EcdsaPublicKey *ttp) | ||
138 | { | ||
139 | //TODO check ttp pubkey against pubkey in ctx | ||
140 | return zklaim_ctx_verify (ctx->ctx); | ||
141 | } | ||