2 This file is part of GNUnet
3 Copyright (C) 2012 GNUnet e.V.
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.
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.
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/>.
21 * @file secretsharing/secretsharing_protocol.h
22 * @brief p2p message definitions for secretsharing
23 * @author Florian Dold
26 #ifndef GNUNET_SECRETSHARING_PROTOCOL_H
27 #define GNUNET_SECRETSHARING_PROTOCOL_H
30 #include "gnunet_common.h"
31 #include "gnunet_protocols.h"
32 #include "secretsharing.h"
35 GNUNET_NETWORK_STRUCT_BEGIN
39 * Consensus element data used in the first round of key generation.
41 struct GNUNET_SECRETSHARING_KeygenCommitData
44 * Signature over the rest of the message.
46 struct GNUNET_CRYPTO_EddsaSignature signature;
48 * Signature purpose for signing the keygen commit data.
50 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
52 * Peer that inserts this element.
54 struct GNUNET_PeerIdentity peer;
56 * Ephemeral paillier public key used by 'peer' for
59 struct GNUNET_CRYPTO_PaillierPublicKey pubkey;
61 * Commitment of 'peer' to its presecret.
63 struct GNUNET_HashCode commitment GNUNET_PACKED;
67 struct GNUNET_SECRETSHARING_KeygenRevealData
70 * Signature over rest of the message.
72 struct GNUNET_CRYPTO_EddsaSignature signature;
74 * Signature purpose for signing the keygen commit data.
76 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
78 * Peer that inserts this element.
80 struct GNUNET_PeerIdentity peer;
87 * Data of then element put in consensus
88 * for decrypting a value.
90 struct GNUNET_SECRETSHARING_DecryptData
93 * Signature over rest of the message.
95 struct GNUNET_CRYPTO_EddsaSignature signature;
97 * Signature purpose for signing the keygen commit data.
99 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
101 * Ciphertext we want to decrypt.
103 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
105 * Peer that inserts this element.
107 struct GNUNET_PeerIdentity peer;
109 * Partial decryption, computed as c_1^{s_i}
111 struct GNUNET_SECRETSHARING_FieldElement partial_decryption;
113 * Commitment for the non-interactive zero knowledge proof.
114 * g^\beta, with \beta < q
116 struct GNUNET_SECRETSHARING_FieldElement nizk_commit1;
118 * Commitment for the non-interactive zero knowledge proof.
119 * c_1^\beta, with \beta < q
121 struct GNUNET_SECRETSHARING_FieldElement nizk_commit2;
123 * Reponse to the challenge computed from the protocol transcript.
124 * r = \beta + challenge \cdot share_i
126 struct GNUNET_SECRETSHARING_FieldElement nizk_response;
130 struct GNUNET_SECRETSHARING_FairEncryption
132 struct GNUNET_CRYPTO_PaillierCiphertext c;
134 * h = g^x, where x is the fairly encrypte secret.
136 char h[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
137 char t1[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
138 char t2[GNUNET_CRYPTO_PAILLIER_BITS * 2 / 8];
139 char z[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
140 char w[GNUNET_CRYPTO_PAILLIER_BITS / 8];
143 GNUNET_NETWORK_STRUCT_END