GNUnet  0.10.x
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 {
52  struct GNUNET_MessageHeader header;
53 
58 
63 
68 
74 
79 
80  /* struct GNUNET_PeerIdentity[num_peers]; */
81 };
82 
83 
84 
86 {
90  uint16_t threshold;
91 
95  uint16_t num_peers;
96 
100  uint16_t my_peer;
101 
107 
112 };
113 
114 
120 {
124  struct GNUNET_MessageHeader header;
125 
126  /* rest: the serialized share */
127 
128 };
129 
130 
132 {
136  struct GNUNET_MessageHeader header;
137 
142 
147 
152 
153  /* the share with payload */
154 };
155 
156 
158 {
162  struct GNUNET_MessageHeader header;
163 
168  uint32_t success GNUNET_PACKED;
169 
174 };
175 
176 
178 
179 
184 {
188  uint16_t threshold;
189 
193  uint16_t num_peers;
194 
198  uint16_t my_peer;
199 
205 
210 
215 
216  /*
217  * For each peer, store elgamal_g to the peer's
218  * share.
219  */
221 
222  /*
223  * Original indices of peers from the DKG round.
224  */
225  uint16_t *original_indices;
226 };
227 
228 
229 #endif
static unsigned int threshold
What should the threshold for then key be?
uint16_t threshold
Threshold for the key this share belongs to.
struct GNUNET_PeerIdentity * peers
Peer identities (includes &#39;my_peer&#39;)
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
A share, with all values in in host byte order.
static struct GNUNET_HashCode session_id
Time for absolute time used by GNUnet, in microseconds and in network byte order. ...
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
Public key of a group sharing a secret.
static struct GNUNET_SECRETSHARING_Ciphertext ciphertext
uint16_t threshold
Threshold for the key this share belongs to.
Definition: secretsharing.h:90
A 512-bit hashcode.
static unsigned int num_peers
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
The identity of the host (wraps the signing key of the peer).
#define GNUNET_PACKED
gcc-ism to get packed structs.
struct GNUNET_SECRETSHARING_FieldElement * sigmas
uint16_t my_peer
Index of our peer in the list.
unsigned char bits[GNUNET_SECRETSHARING_ELGAMAL_BITS/8]
Value of an element in <elgamal_g>.
Definition: secretsharing.h:43
static struct GNUNET_TIME_Absolute deadline
Deadline for all consensuses.
Header for all communications.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
uint16_t num_peers
Peers that have the share.
uint16_t my_peer
Index of our peer in the list.
Notify the client that then threshold secret has been established.
uint16_t num_peers
Peers that have the share.
Definition: secretsharing.h:95
#define GNUNET_SECRETSHARING_ELGAMAL_BITS
Number of bits for secretsharing elements.