2 This file is part of GNUnet.
3 Copyright (C) 2013, 2014 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/>.
19 * @file scalarproduct/gnunet-service-scalarproduct.h
20 * @brief scalarproduct service P2P messages
21 * @author Christian M. Fuchs
22 * @author Christian Grothoff
24 #ifndef GNUNET_SERVICE_SCALARPRODUCT_H
25 #define GNUNET_SERVICE_SCALARPRODUCT_H
28 GNUNET_NETWORK_STRUCT_BEGIN
31 * Message type passed from requesting service Alice to responding
32 * service Bob to initiate a request and make Bob participate in our
33 * protocol. Afterwards, Bob is expected to perform the set
34 * intersection with Alice. Once that has succeeded, Alice will
35 * send a `struct AliceCryptodataMessage *`. Bob is not expected
36 * to respond via CADET in the meantime.
38 struct ServiceRequestMessage
41 * Type is #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_SESSION_INITIALIZATION
43 struct GNUNET_MessageHeader header;
46 * For alignment. Always zero.
51 * The transaction/session key used to identify a session
53 struct GNUNET_HashCode session_id;
58 struct GNUNET_CRYPTO_PaillierPublicKey public_key;
64 * Vector of Pallier-encrypted values sent by Alice to Bob
65 * (after set intersection). Alice may send messages of this
66 * type repeatedly to transmit all values.
68 struct AliceCryptodataMessage
71 * Type is #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ALICE_CRYPTODATA
73 struct GNUNET_MessageHeader header;
76 * How many elements we appended to this message? In NBO.
78 uint32_t contained_element_count GNUNET_PACKED;
81 * struct GNUNET_CRYPTO_PaillierCiphertext[contained_element_count]
87 * Message type passed from responding service Bob to responding
88 * service Alice to complete a request and allow Alice to compute the
89 * result. If Bob's reply does not fit into this one message, the
90 * conversation may be continued with `struct BobCryptodataMultipartMessage`
91 * messages afterwards.
93 struct BobCryptodataMessage
96 * GNUNET message header with type
97 * #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_BOB_CRYPTODATA.
99 struct GNUNET_MessageHeader header;
102 * How many elements this individual message delivers (in NBO).
104 uint32_t contained_element_count GNUNET_PACKED;
107 * followed by s | s' | k[i][perm]
113 * Multipart Message type passed between to supply additional elements
114 * for the peer. Send from Bob to Alice with additional elements
115 * of k[i][perm] after his `struct BobCryptodataMessage *`.
116 * Once all k-values have been transmitted, Bob is finished and
117 * Alice can transmit the final result to the client.
119 struct BobCryptodataMultipartMessage
122 * GNUNET message header
124 struct GNUNET_MessageHeader header;
127 * How many elements we supply within this message? In NBO.
129 uint32_t contained_element_count GNUNET_PACKED;
132 * Followed by `struct
133 * GNUNET_CRYPTO_PaillierCiphertext[contained_element_count]`
139 GNUNET_NETWORK_STRUCT_END