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 GNUNET_NETWORK_STRUCT_BEGIN
41 * Consensus element data used in the first round of key generation.
43 struct GNUNET_SECRETSHARING_KeygenCommitData
46 * Signature over the rest of the message.
48 struct GNUNET_CRYPTO_EddsaSignature signature;
50 * Signature purpose for signing the keygen commit data.
52 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
54 * Peer that inserts this element.
56 struct GNUNET_PeerIdentity peer;
58 * Ephemeral paillier public key used by 'peer' for
61 struct GNUNET_CRYPTO_PaillierPublicKey pubkey;
63 * Commitment of 'peer' to his presecret.
65 struct GNUNET_HashCode commitment GNUNET_PACKED;
69 struct GNUNET_SECRETSHARING_KeygenRevealData
72 * Signature over rest of the message.
74 struct GNUNET_CRYPTO_EddsaSignature signature;
76 * Signature purpose for signing the keygen commit data.
78 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
80 * Peer that inserts this element.
82 struct GNUNET_PeerIdentity peer;
89 * Data of then element put in consensus
90 * for decrypting a value.
92 struct GNUNET_SECRETSHARING_DecryptData
95 * Signature over rest of the message.
97 struct GNUNET_CRYPTO_EddsaSignature signature;
99 * Signature purpose for signing the keygen commit data.
101 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
103 * Ciphertext we want to decrypt.
105 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
107 * Peer that inserts this element.
109 struct GNUNET_PeerIdentity peer;
111 * Partial decryption, computed as c_1^{s_i}
113 struct GNUNET_SECRETSHARING_FieldElement partial_decryption;
115 * Commitment for the non-interactive zero knowledge proof.
116 * g^\beta, with \beta < q
118 struct GNUNET_SECRETSHARING_FieldElement nizk_commit1;
120 * Commitment for the non-interactive zero knowledge proof.
121 * c_1^\beta, with \beta < q
123 struct GNUNET_SECRETSHARING_FieldElement nizk_commit2;
125 * Reponse to the challenge computed from the protocol transcript.
126 * r = \beta + challenge \cdot share_i
128 struct GNUNET_SECRETSHARING_FieldElement nizk_response;
132 struct GNUNET_SECRETSHARING_FairEncryption
134 struct GNUNET_CRYPTO_PaillierCiphertext c;
136 * h = g^x, where x is the fairly encrypte secret.
138 char h[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
139 char t1[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
140 char t2[GNUNET_CRYPTO_PAILLIER_BITS * 2 / 8];
141 char z[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
142 char w[GNUNET_CRYPTO_PAILLIER_BITS / 8];
145 GNUNET_NETWORK_STRUCT_END