2 This file is part of GNUnet
3 (C) 2012 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.
23 * @file secretsharing/secretsharing_protocol.h
24 * @brief p2p message definitions for secretsharing
25 * @author Florian Dold
28 #ifndef GNUNET_SECRETSHARING_PROTOCOL_H
29 #define GNUNET_SECRETSHARING_PROTOCOL_H
32 #include "gnunet_common.h"
33 #include "gnunet_protocols.h"
34 #include "secretsharing.h"
37 * Bit length used for the Paillier crypto system.
39 #define PAILLIER_BITS 2048
41 GNUNET_NETWORK_STRUCT_BEGIN
45 * Public key for the Paillier crypto system.
47 struct PaillierPublicKey
50 * Network order representation of the
53 uint32_t n[PAILLIER_BITS / 8 / sizeof (uint32_t)];
58 * Consensus element data used in the first round of key generation.
60 struct GNUNET_SECRETSHARING_KeygenCommitData
63 * Signature over the rest of the message.
65 struct GNUNET_CRYPTO_EddsaSignature signature;
67 * Signature purpose for signing the keygen commit data.
69 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
71 * Peer that inserts this element.
73 struct GNUNET_PeerIdentity peer;
75 * Ephemeral paillier public key used by 'peer' for
78 struct PaillierPublicKey pubkey GNUNET_PACKED;
80 * Commitment of 'peer' to his presecret.
82 struct GNUNET_HashCode commitment GNUNET_PACKED;
86 struct GNUNET_SECRETSHARING_KeygenRevealData
89 * Signature over rest of the message.
91 struct GNUNET_CRYPTO_EddsaSignature signature;
93 * Signature purpose for signing the keygen commit data.
95 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
97 * Peer that inserts this element.
99 struct GNUNET_PeerIdentity peer;
106 * Data of then element put in consensus
107 * for decrypting a value.
109 struct GNUNET_SECRETSHARING_DecryptData
112 * Signature over rest of the message.
114 struct GNUNET_CRYPTO_EddsaSignature signature;
116 * Signature purpose for signing the keygen commit data.
118 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
120 * Ciphertext we want to decrypt.
122 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
124 * Peer that inserts this element.
126 struct GNUNET_PeerIdentity peer;
128 * Partial decryption, computed as c_1^{s_i}
130 struct GNUNET_SECRETSHARING_FieldElement partial_decryption;
132 * Commitment for the non-interactive zero knowledge proof.
133 * g^\beta, with \beta < q
135 struct GNUNET_SECRETSHARING_FieldElement nizk_commit1;
137 * Commitment for the non-interactive zero knowledge proof.
138 * c_1^\beta, with \beta < q
140 struct GNUNET_SECRETSHARING_FieldElement nizk_commit2;
142 * Reponse to the challenge computed from the protocol transcript.
143 * r = \beta + challenge \cdot share_i
145 struct GNUNET_SECRETSHARING_FieldElement nizk_response;
148 GNUNET_NETWORK_STRUCT_END