GNUnet  0.10.x
gnunet_scalarproduct_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2013, 2014 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  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
32 #ifndef GNUNET_SCALARPRODUCT_SERVICE_H
33 #define GNUNET_SCALARPRODUCT_SERVICE_H
34 #define GCRYPT_NO_DEPRECATED
35 #include <gcrypt.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #if 0 /* keep Emacsens' auto-indent happy */
40 }
41 #endif
42 #endif
43 
47 #define GNUNET_SCALARPRODUCT_VERSION 0x00000044
48 
53 {
54 
59 
64 
69 
74 
79 
84 };
85 
86 
90 struct GNUNET_SCALARPRODUCT_Handle;
91 
92 
94 
99 {
104 
109 };
110 
112 
113 
121 typedef void
124 
125 
133 typedef void
136  gcry_mpi_t result);
137 
138 
143 
144 
159  const struct GNUNET_HashCode *session_key,
160  const struct GNUNET_PeerIdentity *peer,
161  const struct GNUNET_SCALARPRODUCT_Element *elements,
162  uint32_t element_count,
164  void *cont_cls);
165 
166 
180  const struct GNUNET_HashCode *key,
181  const struct GNUNET_SCALARPRODUCT_Element *elements,
182  uint32_t element_count,
184  void *cont_cls);
185 
186 
193 void
195 
196 
197 #if 0 /* keep Emacsens' auto-indent happy */
198 {
199 #endif
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif
205  /* end of group */
A handle returned for each computation.
Operation is still active (never returned, used internally).
struct GNUNET_HashCode key
Key used to identify matching pairs of values to multiply.
struct GNUNET_SCALARPRODUCT_ComputationHandle * GNUNET_SCALARPRODUCT_accept_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *key, const struct GNUNET_SCALARPRODUCT_Element *elements, uint32_t element_count, GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, void *cont_cls)
Used by Bob&#39;s client to cooperate with Alice,.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
void GNUNET_SCALARPRODUCT_cancel(struct GNUNET_SCALARPRODUCT_ComputationHandle *h)
Cancel an ongoing computation or revoke our collaboration offer.
static struct GNUNET_HashCode session_key
the session key identifying this computation
Operation is still active (never returned, used internally).
uint16_t status
See PRISM_STATUS_*-constants.
static int result
Global testing status.
We got disconnected from the SCALARPRODUCT service.
A 512-bit hashcode.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
void(* GNUNET_SCALARPRODUCT_DatumProcessor)(void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status, gcry_mpi_t result)
Process a datum that was stored in the scalarproduct.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
int64_t value
Value to multiply in scalar product, in NBO.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
The identity of the host (wraps the signing key of the peer).
#define GNUNET_PACKED
gcc-ism to get packed structs.
configuration data
Definition: configuration.c:85
void * cont_cls
Closure for cont_status or cont_datum.
GNUNET_SCALARPRODUCT_ResponseStatus
Result status values for the computation.
GNUNET_NETWORK_STRUCT_END typedef void(* GNUNET_SCALARPRODUCT_ContinuationWithStatus)(void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status)
Continuation called to notify client about result of the operation.
struct GNUNET_SCALARPRODUCT_ComputationHandle * GNUNET_SCALARPRODUCT_start_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *session_key, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_SCALARPRODUCT_Element *elements, uint32_t element_count, GNUNET_SCALARPRODUCT_DatumProcessor cont, void *cont_cls)
Request by Alice&#39;s client for computing a scalar product.
An element key-value pair for scalarproduct.