GNUnet 0.22.2
secretsharing.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
26#ifndef SECRETSHARING_H
27#define SECRETSHARING_H
28
29#include "platform.h"
30#include "gnunet_util_lib.h"
31#include "gnunet_time_lib.h"
32#include "gnunet_common.h"
34
35
37
39{
44};
45
46
48{
53
58
63
68
74
79
80 /* struct GNUNET_PeerIdentity[num_peers]; */
81};
82
83
85{
89 uint16_t threshold;
90
94 uint16_t num_peers;
95
99 uint16_t my_peer;
100
106
111};
112
113
119{
124
125 /* rest: the serialized share */
126};
127
128
130{
135
140
145
150
151 /* the share with payload */
152};
153
154
156{
161
167
172};
173
174
176
177
182{
186 uint16_t threshold;
187
191 uint16_t num_peers;
192
196 uint16_t my_peer;
197
203
208
213
214 /*
215 * For each peer, store elgamal_g to the peer's
216 * share.
217 */
219
220 /*
221 * Original indices of peers from the DKG round.
222 */
224};
225
226
227#endif
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Functions related to time.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
#define GNUNET_SECRETSHARING_ELGAMAL_BITS
Number of bits for secretsharing elements.
A 512-bit hashcode.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_GENERATE.
Definition: secretsharing.h:52
struct GNUNET_TIME_AbsoluteNBO deadline
Deadline for the establishment of the crypto system.
Definition: secretsharing.h:67
struct GNUNET_TIME_AbsoluteNBO start
Start time for communication with the other peers.
Definition: secretsharing.h:62
uint16_t num_peers
Number of peers at the end of this message.
Definition: secretsharing.h:78
struct GNUNET_HashCode session_id
Session ID, will be used for consensus.
Definition: secretsharing.h:57
uint16_t threshold
Minimum number of cooperating peers to decrypt a value.
Definition: secretsharing.h:73
struct GNUNET_TIME_AbsoluteNBO deadline
Until when should the decryption be finished?
struct GNUNET_TIME_AbsoluteNBO start
Until when should the decryption start?
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_REQUEST.
struct GNUNET_SECRETSHARING_Ciphertext ciphertext
Ciphertext we want to decrypt.
struct GNUNET_SECRETSHARING_FieldElement plaintext
Decrypted plaintext.
uint32_t success
Zero if decryption failed, non-zero if decryption succeeded.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE.
unsigned char bits[GNUNET_SECRETSHARING_ELGAMAL_BITS/8]
Value of an element in <elgamal_g>.
Definition: secretsharing.h:43
Public key of a group sharing a secret.
Notify the client that then threshold secret has been established.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY.
uint16_t threshold
Threshold for the key this share belongs to.
Definition: secretsharing.h:89
uint16_t my_peer
Index of our peer in the list.
Definition: secretsharing.h:99
struct GNUNET_SECRETSHARING_FieldElement my_share
Share of 'my_peer'.
struct GNUNET_SECRETSHARING_PublicKey public_key
Public key.
uint16_t num_peers
Peers that have the share.
Definition: secretsharing.h:94
A share, with all values in in host byte order.
uint16_t num_peers
Peers that have the share.
uint16_t threshold
Threshold for the key this share belongs to.
struct GNUNET_SECRETSHARING_FieldElement my_share
Share of 'my_peer'.
struct GNUNET_SECRETSHARING_PublicKey public_key
Public key.
struct GNUNET_PeerIdentity * peers
Peer identities (includes 'my_peer')
uint16_t my_peer
Index of our peer in the list.
struct GNUNET_SECRETSHARING_FieldElement * sigmas
Time for absolute time used by GNUnet, in microseconds and in network byte order.