summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-08-14 12:23:38 +0200
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-08-16 17:08:02 +0200
commit91e525e96c354a0b0382329e5cc05dd073f621e7 (patch)
tree82546b6929c61f4a04fb6ab9c9d2aee92ccdaadc
parent3a5676b89150990c83e47a11269a98c2ad2411b3 (diff)
start API
-rw-r--r--src/include/gnunet_zklaim_lib.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/src/include/gnunet_zklaim_lib.h b/src/include/gnunet_zklaim_lib.h
new file mode 100644
index 000000000..a1fd1f017
--- /dev/null
+++ b/src/include/gnunet_zklaim_lib.h
@@ -0,0 +1,131 @@
+/*
+ This file is part of GNUnet.
+ Copyright (C) 2001-2018 GNUnet e.V.
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file include/gnunet_zklaim_lib.h
+ * @brief ZKlaim functions for GNUnet
+ *
+ * @author Martin Schanzenbach
+ *
+ * @defgroup zklaim ZKlaim library: Zero-Knowledge Credentials
+ *
+ */
+#ifndef GNUNET_ZKLAIM_LIB_H
+#define GNUNET_ZKLAIM_LIB_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0 /* keep Emacsens' auto-indent happy */
+}
+#endif
+#endif
+
+#include "gnunet_common.h"
+
+/**
+ * @brief type for ZKlaim context
+ */
+struct GNUNET_ZKLAIM_Context;
+
+/**
+ * @brief type for ZKlaim payload
+ */
+struct GNUNET_ZKLAIM_Payload;
+
+
+/**
+ * @ingroup zklaim
+ * Create a new ZKlaim context. Caller must free return value.
+ * TODO: parameters: keys etc.
+ *
+ * @return fresh context; free using #GNUNET_free
+ */
+struct GNUNET_ZKLAIM_Context *
+GNUNET_ZKLAIM_context_create (void);
+
+/**
+ * @ingroup zklaim
+ * Create a payload.
+ * TODO: parameters, attributes etc.
+ *
+ * @return fresh payload; free using #GNUNET_free
+ */
+void
+GNUNET_ZKLAIM_payload_create (void);
+
+/**
+ * @ingroup zklaim
+ * Create a payload.
+ * TODO: parameters, attributes etc.
+ *
+ * @return GNUNET_OK is successful
+ */
+int
+GNUNET_ZKLAIM_context_add_payload (struct GNUNET_ZKLAIM_Context *ctx,
+ struct GNUNET_ZKLAIM_Payload* pl);
+
+
+/**
+ * @ingroup zklaim
+ * Create a payload.
+ * TODO: parameters, attributes etc.
+ *
+ * @return size needed for serialized context, -1 on error
+ */
+ssize_t
+GNUNET_ZKLAIM_context_serialize_get_size (struct GNUNET_ZKLAIM_Context *ctx);
+
+
+/**
+ * @ingroup zklaim
+ * Create a payload.
+ * TODO: parameters, attributes etc.
+ *
+ */
+void
+GNUNET_ZKLAIM_context_serialize (struct GNUNET_ZKLAIM_Context *ctx,
+ char* buf);
+
+
+/**
+ * @ingroup zklaim
+ * Create a payload.
+ * TODO: parameters, attributes etc.
+ *
+ * @return fresh payload; free using #GNUNET_free
+ */
+char *
+GNUNET_ZKLAIM_context_to_string (struct GNUNET_ZKLAIM_Context *ctx);
+
+
+
+
+#if 0 /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+
+/* ifndef GNUNET_ZKLAIM_LIB_H */
+#endif
+/* end of gnunet_zklaim_lib.h */