aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2001-2018 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21/**
22 * @file include/gnunet_zklaim_lib.h
23 * @brief ZKlaim functions for GNUnet
24 *
25 * @author Martin Schanzenbach
26 *
27 * @defgroup zklaim ZKlaim library: Zero-Knowledge Credentials
28 *
29 */
30#ifndef GNUNET_ZKLAIM_LIB_H
31#define GNUNET_ZKLAIM_LIB_H
32
33#ifdef __cplusplus
34extern "C"
35{
36#if 0 /* keep Emacsens' auto-indent happy */
37}
38#endif
39#endif
40
41#include "gnunet_common.h"
42
43/**
44 * @brief type for ZKlaim context
45 */
46struct GNUNET_ZKLAIM_Context;
47
48/**
49 * @brief type for ZKlaim payload
50 */
51struct GNUNET_ZKLAIM_Payload;
52
53
54/**
55 * @ingroup zklaim
56 * Create a new ZKlaim context. Caller must free return value.
57 * TODO: parameters: keys etc.
58 *
59 * @return fresh context; free using #GNUNET_free
60 */
61struct GNUNET_ZKLAIM_Context *
62GNUNET_ZKLAIM_context_create (void);
63
64/**
65 * @ingroup zklaim
66 * Create a payload.
67 * TODO: parameters, attributes etc.
68 *
69 * @return fresh payload; free using #GNUNET_free
70 */
71void
72GNUNET_ZKLAIM_payload_create (void);
73
74/**
75 * @ingroup zklaim
76 * Create a payload.
77 * TODO: parameters, attributes etc.
78 *
79 * @return GNUNET_OK is successful
80 */
81int
82GNUNET_ZKLAIM_context_add_payload (struct GNUNET_ZKLAIM_Context *ctx,
83 struct GNUNET_ZKLAIM_Payload* pl);
84
85
86/**
87 * @ingroup zklaim
88 * Create a payload.
89 * TODO: parameters, attributes etc.
90 *
91 * @return size needed for serialized context, -1 on error
92 */
93ssize_t
94GNUNET_ZKLAIM_context_serialize_get_size (struct GNUNET_ZKLAIM_Context *ctx);
95
96
97/**
98 * @ingroup zklaim
99 * Create a payload.
100 * TODO: parameters, attributes etc.
101 *
102 */
103void
104GNUNET_ZKLAIM_context_serialize (struct GNUNET_ZKLAIM_Context *ctx,
105 char* buf);
106
107
108/**
109 * @ingroup zklaim
110 * Create a payload.
111 * TODO: parameters, attributes etc.
112 *
113 * @return fresh payload; free using #GNUNET_free
114 */
115char *
116GNUNET_ZKLAIM_context_to_string (struct GNUNET_ZKLAIM_Context *ctx);
117
118
119
120
121#if 0 /* keep Emacsens' auto-indent happy */
122{
123#endif
124#ifdef __cplusplus
125}
126#endif
127
128
129/* ifndef GNUNET_ZKLAIM_LIB_H */
130#endif
131/* end of gnunet_zklaim_lib.h */