2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @author Florian Dold
23 * @file secretsharing/secretsharing.h
24 * @brief messages used for the secretsharing api
26 #ifndef SECRETSHARING_H
27 #define SECRETSHARING_H
30 #include "gnunet_common.h"
31 #include "gnunet_time_lib.h"
32 #include "gnunet_secretsharing_service.h"
35 GNUNET_NETWORK_STRUCT_BEGIN
38 struct GNUNET_SECRETSHARING_CreateMessage
41 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_GENERATE
43 struct GNUNET_MessageHeader header;
46 * Session ID, will be used for consensus.
48 struct GNUNET_HashCode session_id GNUNET_PACKED;
51 * Deadline for the establishment of the crypto system.
53 struct GNUNET_TIME_AbsoluteNBO deadline;
56 * Mininum number of cooperating peers to decrypt a
59 uint16_t threshold GNUNET_PACKED;
62 * Number of peers at the end of this message.
64 uint16_t num_peers GNUNET_PACKED;
66 /* struct GNUNET_PeerIdentity[num_peers]; */
70 struct GNUNET_SECRETSHARING_SecretReadyMessage
73 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY
75 struct GNUNET_MessageHeader header;
78 * Secret share in network byte order.
80 unsigned char secret[GNUNET_SECRETSHARING_KEY_BITS / 8];
83 * Secret share in network byte order.
85 struct GNUNET_SECRETSHARING_PublicKey public_key;
88 * Number of peers at the end of this message.
89 * Includes peers that are part of the established
90 * threshold crypto system.
92 uint16_t num_secret_peers GNUNET_PACKED;
94 /* struct GNUNET_PeerIdentity[num_peers]; */
98 struct GNUNET_SECRETSHARING_DecryptRequestMessage
101 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_REQUEST
103 struct GNUNET_MessageHeader header;
106 * Ciphertext to request decryption for.
108 unsigned char ciphertext[GNUNET_SECRETSHARING_KEY_BITS / 8];
111 * Number of peers at the end of this message.
112 * Includes peers that are part of the established
113 * threshold crypto system.
115 uint16_t num_secret_peers GNUNET_PACKED;
117 /* struct GNUNET_PeerIdentity[num_peers]; */
121 struct GNUNET_SECRETSHARING_DecryptResponseMessage
124 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_RESPONSE
126 struct GNUNET_MessageHeader header;
129 * Ciphertext to request decryption for.
131 unsigned char plaintext[GNUNET_SECRETSHARING_KEY_BITS / 8];
135 GNUNET_NETWORK_STRUCT_END