GNUnet  0.11.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 
85 {
89  uint16_t threshold;
90 
94  uint16_t num_peers;
95 
99  uint16_t my_peer;
100 
106 
111 };
112 
113 
119 {
123  struct GNUNET_MessageHeader header;
124 
125  /* rest: the serialized share */
126 };
127 
128 
130 {
134  struct GNUNET_MessageHeader header;
135 
140 
145 
150 
151  /* the share with payload */
152 };
153 
154 
156 {
160  struct GNUNET_MessageHeader header;
161 
166  uint32_t success GNUNET_PACKED;
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  */
223  uint16_t *original_indices;
224 };
225 
226 
227 #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:89
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.
Definition: secretsharing.h:99
Notify the client that then threshold secret has been established.
uint16_t num_peers
Peers that have the share.
Definition: secretsharing.h:94
#define GNUNET_SECRETSHARING_ELGAMAL_BITS
Number of bits for secretsharing elements.