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/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
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 {
45 * Signature over the rest of the message.
47 struct GNUNET_CRYPTO_EddsaSignature signature;
49 * Signature purpose for signing the keygen commit data.
51 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
53 * Peer that inserts this element.
55 struct GNUNET_PeerIdentity peer;
57 * Ephemeral paillier public key used by 'peer' for
60 struct GNUNET_CRYPTO_PaillierPublicKey pubkey;
62 * Commitment of 'peer' to its presecret.
64 struct GNUNET_HashCode commitment GNUNET_PACKED;
68 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 {
92 * Signature over rest of the message.
94 struct GNUNET_CRYPTO_EddsaSignature signature;
96 * Signature purpose for signing the keygen commit data.
98 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
100 * Ciphertext we want to decrypt.
102 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
104 * Peer that inserts this element.
106 struct GNUNET_PeerIdentity peer;
108 * Partial decryption, computed as c_1^{s_i}
110 struct GNUNET_SECRETSHARING_FieldElement partial_decryption;
112 * Commitment for the non-interactive zero knowledge proof.
113 * g^\beta, with \beta < q
115 struct GNUNET_SECRETSHARING_FieldElement nizk_commit1;
117 * Commitment for the non-interactive zero knowledge proof.
118 * c_1^\beta, with \beta < q
120 struct GNUNET_SECRETSHARING_FieldElement nizk_commit2;
122 * Reponse to the challenge computed from the protocol transcript.
123 * r = \beta + challenge \cdot share_i
125 struct GNUNET_SECRETSHARING_FieldElement nizk_response;
129 struct GNUNET_SECRETSHARING_FairEncryption {
130 struct GNUNET_CRYPTO_PaillierCiphertext c;
132 * h = g^x, where x is the fairly encrypte secret.
134 char h[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
135 char t1[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
136 char t2[GNUNET_CRYPTO_PAILLIER_BITS * 2 / 8];
137 char z[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8];
138 char w[GNUNET_CRYPTO_PAILLIER_BITS / 8];
141 GNUNET_NETWORK_STRUCT_END