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.h | |
parent | 06b98ce26989dd42cad35f91ae9d8e757b602383 (diff) | |
download | gnunet-32b0ff1774ca5e76485be047ae693398163e0e68.tar.gz gnunet-32b0ff1774ca5e76485be047ae693398163e0e68.zip |
- work on secretsharing
Diffstat (limited to 'src/secretsharing/secretsharing.h')
-rw-r--r-- | src/secretsharing/secretsharing.h | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/src/secretsharing/secretsharing.h b/src/secretsharing/secretsharing.h new file mode 100644 index 000000000..7025fdfea --- /dev/null +++ b/src/secretsharing/secretsharing.h | |||
@@ -0,0 +1,132 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2013 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 | * @author Florian Dold | ||
23 | * @file secretsharing/secretsharing.h | ||
24 | * @brief messages used for the secretsharing api | ||
25 | */ | ||
26 | #ifndef SECRETSHARING_H | ||
27 | #define SECRETSHARING_H | ||
28 | |||
29 | #include "platform.h" | ||
30 | #include "gnunet_common.h" | ||
31 | #include "gnunet_time_lib.h" | ||
32 | #include "gnunet_secretsharing_service.h" | ||
33 | |||
34 | |||
35 | GNUNET_NETWORK_STRUCT_BEGIN | ||
36 | |||
37 | |||
38 | struct GNUNET_SECRETSHARING_CreateMessage | ||
39 | { | ||
40 | /** | ||
41 | * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_GENERATE | ||
42 | */ | ||
43 | struct GNUNET_MessageHeader header; | ||
44 | |||
45 | /** | ||
46 | * Session ID, will be used for consensus. | ||
47 | */ | ||
48 | struct GNUNET_HashCode session_id GNUNET_PACKED; | ||
49 | |||
50 | /** | ||
51 | * Deadline for the establishment of the crypto system. | ||
52 | */ | ||
53 | struct GNUNET_TIME_AbsoluteNBO deadline; | ||
54 | |||
55 | /** | ||
56 | * Mininum number of cooperating peers to decrypt a | ||
57 | * value. | ||
58 | */ | ||
59 | uint16_t threshold GNUNET_PACKED; | ||
60 | |||
61 | /** | ||
62 | * Number of peers at the end of this message. | ||
63 | */ | ||
64 | uint16_t num_peers GNUNET_PACKED; | ||
65 | |||
66 | /* struct GNUNET_PeerIdentity[num_peers]; */ | ||
67 | }; | ||
68 | |||
69 | |||
70 | struct GNUNET_SECRETSHARING_SecretEstablishedMessage | ||
71 | { | ||
72 | /** | ||
73 | * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_ESTABLISHED | ||
74 | */ | ||
75 | struct GNUNET_MessageHeader header; | ||
76 | |||
77 | /** | ||
78 | * Secret share in network byte order. | ||
79 | */ | ||
80 | unsigned char secret[GNUNET_SECRETSHARING_KEY_BITS / 8]; | ||
81 | |||
82 | /** | ||
83 | * Number of peers at the end of this message. | ||
84 | * Includes peers that are part of the established | ||
85 | * threshold crypto system. | ||
86 | */ | ||
87 | uint16_t num_secret_peers GNUNET_PACKED; | ||
88 | |||
89 | /* struct GNUNET_PeerIdentity[num_peers]; */ | ||
90 | }; | ||
91 | |||
92 | |||
93 | struct GNUNET_SECRETSHARING_DecryptMessage | ||
94 | { | ||
95 | /** | ||
96 | * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT | ||
97 | */ | ||
98 | struct GNUNET_MessageHeader header; | ||
99 | |||
100 | /** | ||
101 | * Ciphertext to request decryption for. | ||
102 | */ | ||
103 | unsigned char ciphertext[GNUNET_SECRETSHARING_KEY_BITS / 8]; | ||
104 | |||
105 | /** | ||
106 | * Number of peers at the end of this message. | ||
107 | * Includes peers that are part of the established | ||
108 | * threshold crypto system. | ||
109 | */ | ||
110 | uint16_t num_secret_peers GNUNET_PACKED; | ||
111 | |||
112 | /* struct GNUNET_PeerIdentity[num_peers]; */ | ||
113 | }; | ||
114 | |||
115 | |||
116 | struct GNUNET_SECRETSHARING_DecryptDoneMessage | ||
117 | { | ||
118 | /** | ||
119 | * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE | ||
120 | */ | ||
121 | struct GNUNET_MessageHeader header; | ||
122 | |||
123 | /** | ||
124 | * Ciphertext to request decryption for. | ||
125 | */ | ||
126 | unsigned char plaintext[GNUNET_SECRETSHARING_KEY_BITS / 8]; | ||
127 | }; | ||
128 | |||
129 | |||
130 | GNUNET_NETWORK_STRUCT_END | ||
131 | |||
132 | #endif | ||