GNUnet  0.11.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 
63 
71 void
73 
82 struct GNUNET_ABE_AbeKey *
84  char **attrs);
85 
94 void
96  int delete_pub);
97 
98 
110 ssize_t
111 GNUNET_ABE_cpabe_encrypt (const void *block,
112  size_t size,
113  const char *policy,
114  const struct GNUNET_ABE_AbeMasterKey *key,
115  void **result);
116 
127 ssize_t
128 GNUNET_ABE_cpabe_decrypt (const void *block,
129  size_t size,
130  const struct GNUNET_ABE_AbeKey *key,
131  void **result);
132 
141 ssize_t
143  void **result);
144 
153 struct GNUNET_ABE_AbeKey*
155  size_t len);
156 
165 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:465
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:353
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:309
struct GNUNET_ABE_AbeMasterKey * GNUNET_ABE_cpabe_create_master_key(void)
Create a new CP-ABE master key.
Definition: abe.c:161
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:401
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:497
void GNUNET_ABE_cpabe_delete_master_key(struct GNUNET_ABE_AbeMasterKey *key)
Delete a CP-ABE master key.
Definition: abe.c:181
struct GNUNET_ABE_AbeKey * GNUNET_ABE_cpabe_deserialize_key(const void *data, size_t len)
Deserialize a serialized ABE key.
Definition: abe.c:432
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:226
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:200
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...