GNUnet  0.11.x
gnunet_revocation_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2013 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 
21 #ifndef GNUNET_REVOCATION_SERVICE_H_
22 #define GNUNET_REVOCATION_SERVICE_H_
23 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #if 0 /* keep Emacsens' auto-indent happy */
42 }
43 #endif
44 #endif
45 
46 #include "gnunet_util_lib.h"
47 
51 #define GNUNET_REVOCATION_VERSION 0x00000001
52 
57 #define POW_COUNT 32
58 
59 
61 
66 {
71 
76 
81 
86 
91 };
92 
93 
98 {
103 
108 
113 };
114 
116 
117 
122 
127 
137 typedef void (*GNUNET_REVOCATION_Callback) (void *cls,
139  is_valid);
140 
141 
153  const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
155 
156 
162 void
164 
165 
170 
171 
186  const struct GNUNET_REVOCATION_PowP *pow,
188 
189 
195 void
197 
198 
209  unsigned int matching_bits,
211 
212 
219 void
221  struct GNUNET_REVOCATION_PowP *pow);
222 
223 
235  int epochs,
236  unsigned int difficulty);
237 
238 
247 
248 
256 void
258 
259 #if 0 /* keep Emacsens' auto-indent happy */
260 {
261 #endif
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 #endif /* GNUNET_REVOCATION_SERVICE_H_ */
267  /* end of group revocation */
void GNUNET_REVOCATION_pow_init(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, struct GNUNET_REVOCATION_PowP *pow)
Initializes a fresh PoW computation.
static unsigned int epochs
-e option.
void GNUNET_REVOCATION_query_cancel(struct GNUNET_REVOCATION_Query *q)
Cancel key revocation check.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
struct GNUNET_CRYPTO_EcdsaPublicKey key
The revoked public key.
enum GNUNET_GenericReturnValue GNUNET_REVOCATION_pow_round(struct GNUNET_REVOCATION_PowCalculationHandle *pc)
Calculate a single round in the key revocation PoW.
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
#define POW_COUNT
The proof-of-work narrowing factor.
Struct for a proof of work as part of the revocation.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:83
The signature object we use for the PoW.
Private ECC key encoded for transmission.
Time for relative time used by GNUnet, in microseconds and in network byte order. ...
Time for absolute time used by GNUnet, in microseconds and in network byte order. ...
void GNUNET_REVOCATION_pow_stop(struct GNUNET_REVOCATION_PowCalculationHandle *pc)
Stop a PoW calculation.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_TIME_Relative epoch_duration
Epoch length.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
void * func_cls
Closure for func.
unsigned int difficulty
The difficulty (leading zeros) to achieve.
an ECC signature using ECDSA
void * func_cls
Closure for func.
uint64_t pow[32]
The PoWs.
struct GNUNET_CRYPTO_EcdsaSignature signature
The signature.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
struct GNUNET_REVOCATION_PowCalculationHandle * GNUNET_REVOCATION_pow_start(struct GNUNET_REVOCATION_PowP *pow, int epochs, unsigned int difficulty)
Starts a proof-of-work calculation given the pow object as well as target epochs and difficulty...
Handle for the key revocation query.
struct GNUNET_TIME_AbsoluteNBO timestamp
The timestamp of the revocation.
struct GNUNET_REVOCATION_Handle * GNUNET_REVOCATION_revoke(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_REVOCATION_PowP *pow, GNUNET_REVOCATION_Callback func, void *func_cls)
Perform key revocation.
void(* GNUNET_REVOCATION_Callback)(void *cls, enum GNUNET_GenericReturnValue is_valid)
Callback to call with the result of a key revocation query.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
#define GNUNET_PACKED
gcc-ism to get packed structs.
configuration data
Definition: configuration.c:84
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
struct GNUNET_REVOCATION_Query * GNUNET_REVOCATION_query(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EcdsaPublicKey *key, GNUNET_REVOCATION_Callback func, void *func_cls)
Check if a key was revoked.
Handle for the key revocation operation.
GNUNET_REVOCATION_Callback func
Function to call with the result.
GNUNET_REVOCATION_Callback func
Function to call once we are done.
The handle to a PoW calculation.
void GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h)
Cancel key revocation.
static unsigned long long matching_bits
Number of matching bits required for revocation.
struct GNUNET_TIME_RelativeNBO ttl
The TTL of this revocation (purely informational)
Time for relative time used by GNUnet, in microseconds.
enum GNUNET_GenericReturnValue GNUNET_REVOCATION_check_pow(const struct GNUNET_REVOCATION_PowP *pow, unsigned int matching_bits, struct GNUNET_TIME_Relative epoch_duration)
Check if the given proof-of-work is valid.