2 This file is part of GNUnet.
3 Copyright (C) 2015 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.
16 * @file scalarproduct/gnunet-service-scalarproduct-ecc.h
17 * @brief scalarproduct service P2P messages
18 * @author Christian M. Fuchs
19 * @author Christian Grothoff
21 #ifndef GNUNET_SERVICE_SCALARPRODUCT_ECC_H
22 #define GNUNET_SERVICE_SCALARPRODUCT_ECC_H
25 GNUNET_NETWORK_STRUCT_BEGIN
28 * Message type passed from requesting service Alice to responding
29 * service Bob to initiate a request and make Bob participate in our
30 * protocol. Afterwards, Bob is expected to perform the set
31 * intersection with Alice. Once that has succeeded, Alice will
32 * send a `struct AliceCryptodataMessage *`. Bob is not expected
33 * to respond via CADET in the meantime.
35 struct EccServiceRequestMessage
38 * Type is #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_SESSION_INITIALIZATION
40 struct GNUNET_MessageHeader header;
43 * For alignment. Always zero.
48 * The transaction/session key used to identify a session
50 struct GNUNET_HashCode session_id;
56 * Vector of ECC-encrypted values sent by Alice to Bob
57 * (after set intersection). Alice may send messages of this
58 * type repeatedly to transmit all values.
60 struct EccAliceCryptodataMessage
63 * Type is #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_ALICE_CRYPTODATA
65 struct GNUNET_MessageHeader header;
68 * How many elements we appended to this message? In NBO.
70 uint32_t contained_element_count GNUNET_PACKED;
73 * struct GNUNET_CRYPTO_EccPoint[contained_element_count]
79 * Message type passed from responding service Bob to responding
80 * service Alice to complete a request and allow Alice to compute the
81 * result. If Bob's reply does not fit into this one message, the
82 * conversation may be continued with `struct BobCryptodataMultipartMessage`
83 * messages afterwards.
85 struct EccBobCryptodataMessage
88 * GNUNET message header with type
89 * #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_BOB_CRYPTODATA.
91 struct GNUNET_MessageHeader header;
94 * How many elements this individual message delivers (in NBO),
97 uint32_t contained_element_count GNUNET_PACKED;
100 * The product of the g_i^{b_i} values.
102 struct GNUNET_CRYPTO_EccPoint prod_g_i_b_i;
105 * The product of the h_i^{b_i} values.
107 struct GNUNET_CRYPTO_EccPoint prod_h_i_b_i;
112 GNUNET_NETWORK_STRUCT_END