#endif
#include "gnunet_util_lib.h"
+#include "zklaim/zklaim.h"
/**
* Version number of GNUnet Identity Provider API.
uint64_t *data);
+/**
+ * Iterator called for each attribute to set a predicate in proof generation.
+ *
+ * @param cls closure
+ * @param name name of attribute
+ * @param data attribute data (can be modified)
+ */
+typedef void
+(*GNUNET_ZKLAIM_PredicateIterator) (void *cls,
+ const char* name,
+ enum zklaim_op *op,
+ uint64_t *ref);
+
/**
* Continuation called to notify client about result of the
ZKLAIM_context_sign (ctx,
key);
}
+
+void
+ZKLAIM_context_prove (struct GNUNET_ZKLAIM_Context *ctx,
+ GNUNET_ZKLAIM_PredicateIterator iter,
+ void *iter_cls)
+{
+ int i;
+ int j;
+ char *attr_name;
+ char *tmp;
+ zklaim_wrap_payload_ctx *plw;
+
+ tmp = GNUNET_strdup (ctx->attrs);
+ attr_name = strtok (tmp, ",");
+ plw = ctx->ctx->pl_ctx_head;
+
+ for (i = 0; i < ctx->ctx->num_of_payloads; i++)
+ {
+ for (j = 0; j < ZKLAIM_MAX_PAYLOAD_ATTRIBUTES; j++)
+ {
+ GNUNET_assert (NULL != attr_name);
+ iter (iter_cls,
+ attr_name,
+ &plw->pl.data_op[i],
+ &plw->pl.data_ref[i]);
+ attr_name = strtok (NULL, ",");
+ }
+ plw = plw->next;
+ GNUNET_assert (NULL != plw);
+ }
+ GNUNET_free (tmp);
+
+}
+
+int
+ZKLAIM_context_verify (struct GNUNET_ZKLAIM_Context *ctx,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *ttp)
+{
+ //TODO check ttp pubkey against pubkey in ctx
+ return zklaim_ctx_verify (ctx->ctx);
+}