paragraph for gnunet devs that don't know how to use the web
[oweals/gnunet.git] / src / scalarproduct / gnunet-service-scalarproduct-ecc.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2015 GNUnet e.V.
4
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.
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      Affero General Public License for more details.
14     
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/>.
17  */
18 /**
19  * @file scalarproduct/gnunet-service-scalarproduct-ecc.h
20  * @brief scalarproduct service  P2P messages
21  * @author Christian M. Fuchs
22  * @author Christian Grothoff
23  */
24 #ifndef GNUNET_SERVICE_SCALARPRODUCT_ECC_H
25 #define GNUNET_SERVICE_SCALARPRODUCT_ECC_H
26
27
28 GNUNET_NETWORK_STRUCT_BEGIN
29
30 /**
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.
37  */
38 struct EccServiceRequestMessage
39 {
40   /**
41    * Type is #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_SESSION_INITIALIZATION
42    */
43   struct GNUNET_MessageHeader header;
44
45   /**
46    * For alignment. Always zero.
47    */
48   uint32_t reserved;
49
50   /**
51    * The transaction/session key used to identify a session
52    */
53   struct GNUNET_HashCode session_id;
54
55 };
56
57
58 /**
59  * Vector of ECC-encrypted values sent by Alice to Bob
60  * (after set intersection).  Alice may send messages of this
61  * type repeatedly to transmit all values.
62  */
63 struct EccAliceCryptodataMessage
64 {
65   /**
66    * Type is #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_ALICE_CRYPTODATA
67    */
68   struct GNUNET_MessageHeader header;
69
70   /**
71    * How many elements we appended to this message? In NBO.
72    */
73   uint32_t contained_element_count GNUNET_PACKED;
74
75   /**
76    * struct GNUNET_CRYPTO_EccPoint[contained_element_count]
77    */
78 };
79
80
81 /**
82  * Message type passed from responding service Bob to responding
83  * service Alice to complete a request and allow Alice to compute the
84  * result.  If Bob's reply does not fit into this one message, the
85  * conversation may be continued with `struct BobCryptodataMultipartMessage`
86  * messages afterwards.
87  */
88 struct EccBobCryptodataMessage
89 {
90   /**
91    * GNUNET message header with type
92    * #GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_BOB_CRYPTODATA.
93    */
94   struct GNUNET_MessageHeader header;
95
96   /**
97    * How many elements this individual message delivers (in NBO),
98    * always TWO.
99    */
100   uint32_t contained_element_count GNUNET_PACKED;
101
102   /**
103    * The product of the g_i^{b_i} values.
104    */
105   struct GNUNET_CRYPTO_EccPoint prod_g_i_b_i;
106
107   /**
108    * The product of the h_i^{b_i} values.
109    */
110   struct GNUNET_CRYPTO_EccPoint prod_h_i_b_i;
111
112 };
113
114
115 GNUNET_NETWORK_STRUCT_END
116
117
118 #endif