GNUnet  0.10.x
gnunet_abe_lib.h
Go to the documentation of this file.
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 it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your 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  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 
30 #ifndef GNUNET_ABE_LIB_H
31 #define GNUNET_ABE_LIB_H
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #if 0 /* keep Emacsens' auto-indent happy */
37 }
38 #endif
39 #endif
40 
41 #include "gnunet_common.h"
42 #include <gcrypt.h>
43 
48 
53 
54 
55 
64 
72 void
74 
83 struct GNUNET_ABE_AbeKey *
85  char **attrs);
86 
95 void
97  int delete_pub);
98 
99 
111 ssize_t
112 GNUNET_ABE_cpabe_encrypt (const void *block,
113  size_t size,
114  const char *policy,
115  const struct GNUNET_ABE_AbeMasterKey *key,
116  void **result);
117 
128 ssize_t
129 GNUNET_ABE_cpabe_decrypt (const void *block,
130  size_t size,
131  const struct GNUNET_ABE_AbeKey *key,
132  void **result);
133 
142 ssize_t
144  void **result);
145 
154 struct GNUNET_ABE_AbeKey*
156  size_t len);
157 
166 ssize_t
168  void **result);
169 
180  size_t len);
181 
182 
183 #if 0 /* keep Emacsens' auto-indent happy */
184 {
185 #endif
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 
191 /* ifndef GNUNET_ABE_LIB_H */
192 #endif
193 /* end of gnunet_abe_lib.h */
ssize_t GNUNET_ABE_cpabe_serialize_master_key(const struct GNUNET_ABE_AbeMasterKey *key, void **result)
Serialize an ABE master key.
Definition: abe.c:447
ssize_t GNUNET_ABE_cpabe_decrypt(const void *block, size_t size, const struct GNUNET_ABE_AbeKey *key, void **result)
Decrypt a block using the ABE key.
Definition: abe.c:339
static int result
Global testing status.
ssize_t GNUNET_ABE_cpabe_encrypt(const void *block, size_t size, const char *policy, const struct GNUNET_ABE_AbeMasterKey *key, void **result)
Encrypt a block using sessionkey.
Definition: abe.c:297
struct GNUNET_ABE_AbeMasterKey * GNUNET_ABE_cpabe_create_master_key(void)
Create a new CP-ABE master key.
Definition: abe.c:156
struct GNUNET_HashCode key
The key used in the DHT.
ssize_t GNUNET_ABE_cpabe_serialize_key(const struct GNUNET_ABE_AbeKey *key, void **result)
Serialize an ABE key.
Definition: abe.c:385
static unsigned int size
Size of the "table".
Definition: peer.c:67
struct GNUNET_ABE_AbeMasterKey * GNUNET_ABE_cpabe_deserialize_master_key(const void *data, size_t len)
Deserialize an ABE master key.
Definition: abe.c:477
void GNUNET_ABE_cpabe_delete_master_key(struct GNUNET_ABE_AbeMasterKey *key)
Delete a CP-ABE master key.
Definition: abe.c:174
struct GNUNET_ABE_AbeKey * GNUNET_ABE_cpabe_deserialize_key(const void *data, size_t len)
Deserialize a serialized ABE key.
Definition: abe.c:415
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
uint32_t data
The data value.
void GNUNET_ABE_cpabe_delete_key(struct GNUNET_ABE_AbeKey *key, int delete_pub)
Delete a CP-ABE key.
Definition: abe.c:217
struct GNUNET_ABE_AbeKey * GNUNET_ABE_cpabe_create_key(struct GNUNET_ABE_AbeMasterKey *key, char **attrs)
Create a new CP-ABE key.
Definition: abe.c:192
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...