diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-12-03 11:38:14 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-12-03 11:38:14 +0000 |
commit | 32b0ff1774ca5e76485be047ae693398163e0e68 (patch) | |
tree | 85de5403d4e7c71378155fe02684d7bcdbc9365e /src/secretsharing/secretsharing_protocol.h | |
parent | 06b98ce26989dd42cad35f91ae9d8e757b602383 (diff) | |
download | gnunet-32b0ff1774ca5e76485be047ae693398163e0e68.tar.gz gnunet-32b0ff1774ca5e76485be047ae693398163e0e68.zip |
- work on secretsharing
Diffstat (limited to 'src/secretsharing/secretsharing_protocol.h')
-rw-r--r-- | src/secretsharing/secretsharing_protocol.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/secretsharing/secretsharing_protocol.h b/src/secretsharing/secretsharing_protocol.h new file mode 100644 index 000000000..71e6d50a9 --- /dev/null +++ b/src/secretsharing/secretsharing_protocol.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | (C) 2012 Christian Grothoff (and other contributing authors) | ||
4 | |||
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. | ||
9 | |||
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. | ||
14 | |||
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. | ||
19 | */ | ||
20 | |||
21 | |||
22 | /** | ||
23 | * @file secretsharing/secretsharing_protocol.h | ||
24 | * @brief p2p message definitions for secretsharing | ||
25 | * @author Florian Dold | ||
26 | */ | ||
27 | |||
28 | #ifndef GNUNET_SECRETSHARING_PROTOCOL_H | ||
29 | #define GNUNET_SECRETSHARING_PROTOCOL_H | ||
30 | |||
31 | #include "platform.h" | ||
32 | #include "gnunet_common.h" | ||
33 | #include "gnunet_protocols.h" | ||
34 | |||
35 | /** | ||
36 | * Bit length used for the Paillier crypto system. | ||
37 | */ | ||
38 | #define PAILLIER_BITS 2048 | ||
39 | |||
40 | /** | ||
41 | * Big endian representation of the prime field order used | ||
42 | * for ElGamal. | ||
43 | */ | ||
44 | #define ELGAMAL_Q_DATA {0x00 /* FIXME */}; | ||
45 | |||
46 | |||
47 | GNUNET_NETWORK_STRUCT_BEGIN | ||
48 | |||
49 | |||
50 | /** | ||
51 | * Public key for the Paillier crypto system. | ||
52 | */ | ||
53 | struct PaillierPublicKey | ||
54 | { | ||
55 | /** | ||
56 | * Network order representation of the | ||
57 | * g-component. | ||
58 | */ | ||
59 | uint32_t g[PAILLIER_BITS / 8 / sizeof (uint32_t)]; | ||
60 | |||
61 | /** | ||
62 | * Network order representation of the | ||
63 | * g-component. | ||
64 | */ | ||
65 | uint32_t mu[PAILLIER_BITS / 8 / sizeof (uint32_t)]; | ||
66 | }; | ||
67 | |||
68 | |||
69 | /** | ||
70 | * Consensus element data used in the first round of key generation. | ||
71 | */ | ||
72 | struct GNUNET_SECRETSHARING_KeygenCommitData | ||
73 | { | ||
74 | /** | ||
75 | * Signature purpose for signing the keygen commit data. | ||
76 | */ | ||
77 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
78 | /** | ||
79 | * Peer that inserts this element. | ||
80 | */ | ||
81 | struct GNUNET_PeerIdentity peer; | ||
82 | /** | ||
83 | * Ephemeral paillier public key used by 'peer' for | ||
84 | * this session. | ||
85 | */ | ||
86 | struct PaillierPublicKey pubkey GNUNET_PACKED; | ||
87 | /** | ||
88 | * Commitment of 'peer' to his presecret. | ||
89 | */ | ||
90 | struct GNUNET_HashCode commitment GNUNET_PACKED; | ||
91 | /** | ||
92 | * Signature over the previous values. | ||
93 | */ | ||
94 | struct GNUNET_CRYPTO_EddsaSignature signature; | ||
95 | }; | ||
96 | |||
97 | GNUNET_NETWORK_STRUCT_END | ||
98 | |||
99 | #endif | ||