scalarproduct service implementation More...
#include "platform.h"
#include <limits.h>
#include <gcrypt.h>
#include "gnunet_util_lib.h"
#include "gnunet_cadet_service.h"
#include "gnunet_protocols.h"
#include "gnunet_scalarproduct_service.h"
#include "gnunet_seti_service.h"
#include "scalarproduct.h"
#include "gnunet-service-scalarproduct.h"
#include "gnunet_constants.h"
Go to the source code of this file.
Data Structures | |
struct | MpiElement |
An encrypted element key-value pair. More... | |
struct | BobServiceSession |
A scalarproduct session which tracks an offer for a multiplication service by a local client. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "scalarproduct-bob", __VA_ARGS__) |
#define | ELEMENT_CAPACITY |
Maximum count of elements we can put into a multipart message. More... | |
Functions | |
static int | free_element_cb (void *cls, const struct GNUNET_HashCode *key, void *value) |
Callback used to free the elements in the map. More... | |
static void | destroy_service_session (struct BobServiceSession *s) |
Destroy session state, we are done with it. More... | |
static void | prepare_client_end_notification (struct BobServiceSession *session) |
Notify the client that the session has succeeded or failed. More... | |
static void | cb_channel_destruction (void *cls, const struct GNUNET_CADET_Channel *channel) |
Function called whenever a channel is destroyed. More... | |
static void | bob_cadet_done_cb (void *cls) |
MQ finished giving our last message to CADET, now notify the client that we are finished. More... | |
static void | transmit_bobs_cryptodata_message_multipart (struct BobServiceSession *s) |
Send a multipart chunk of a service response from Bob to Alice. More... | |
static void | transmit_bobs_cryptodata_message (struct BobServiceSession *s) |
Bob generates the response message to be sent to Alice after computing the values (1), (2), S and S'. More... | |
static gcry_mpi_t | compute_square_sum (const gcry_mpi_t *vector, uint32_t length) |
Computes the square sum over a vector of a given length. More... | |
static int | compute_service_response (struct BobServiceSession *session) |
Compute the values (1)[]: $E_A(a_{pi(i)}) otimes E_A(- r_{pi(i)} - b_{pi(i)}) &= E_A(a_{pi(i)} - r_{pi(i)} - b_{pi(i)})$ (2)[]: $E_A(a_{pi'(i)}) otimes E_A(- r_{pi'(i)}) &= E_A(a_{pi'(i)} - r_{pi'(i)})$ S: $S := E_A(sum (r_i + b_i)^2)$ S': $S' := E_A(sum r_i^2)$. More... | |
static int | copy_element_cb (void *cls, const struct GNUNET_HashCode *key, void *value) |
Iterator to copy over messages from the hash map into an array for sorting. More... | |
static int | element_cmp (const void *a, const void *b) |
Compare two struct MpiValue s by key for sorting. More... | |
static void | transmit_cryptographic_reply (struct BobServiceSession *s) |
Intersection operation and receiving data via CADET from Alice are both done, compute and transmit our reply via CADET. More... | |
static int | check_alices_cryptodata_message (void *cls, const struct AliceCryptodataMessage *msg) |
Check a multipart-chunk of a request from another service to calculate a scalarproduct with us. More... | |
static void | handle_alices_cryptodata_message (void *cls, const struct AliceCryptodataMessage *msg) |
Handle a multipart-chunk of a request from another service to calculate a scalarproduct with us. More... | |
static void | cb_intersection_element_removed (void *cls, const struct GNUNET_SETI_Element *element, uint64_t current_size, enum GNUNET_SETI_Status status) |
Callback for set operation results. More... | |
static void | start_intersection (struct BobServiceSession *s) |
We've paired up a client session with an incoming CADET request. More... | |
static void | handle_alices_computation_request (void *cls, const struct ServiceRequestMessage *msg) |
Handle a request from Alice to calculate a scalarproduct with us (Bob). More... | |
static void * | cb_channel_incoming (void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *initiator) |
Function called for inbound channels on Bob's end. More... | |
static int | check_bob_client_message_multipart (void *cls, const struct ComputationBobCryptodataMultipartMessage *msg) |
We're receiving additional set data. More... | |
static void | handle_bob_client_message_multipart (void *cls, const struct ComputationBobCryptodataMultipartMessage *msg) |
We're receiving additional set data. More... | |
static int | check_bob_client_message (void *cls, const struct BobComputationMessage *msg) |
Handler for Bob's a client request message. More... | |
static void | handle_bob_client_message (void *cls, const struct BobComputationMessage *msg) |
Handler for Bob's a client request message. More... | |
static void | shutdown_task (void *cls) |
Task run during shutdown. More... | |
static void * | client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq) |
A client connected. More... | |
static void | client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *app_cls) |
A client disconnected. More... | |
static void | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service) |
Initialization of the program and message handlers. More... | |
GNUNET_SERVICE_MAIN (GNUNET_OS_project_data_gnunet(), "scalarproduct-bob", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_var_size(bob_client_message, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_BOB, struct BobComputationMessage, NULL), GNUNET_MQ_hd_var_size(bob_client_message_multipart, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_MULTIPART_BOB, struct ComputationBobCryptodataMultipartMessage, NULL), GNUNET_MQ_handler_end()) | |
Define "main" method using service macro. More... | |
Variables | |
static const struct GNUNET_CONFIGURATION_Handle * | cfg |
GNUnet configuration handle. More... | |
static struct GNUNET_CRYPTO_PaillierPublicKey | my_pubkey |
Service's own public key. More... | |
static struct GNUNET_CRYPTO_PaillierPrivateKey | my_privkey |
Service's own private key. More... | |
static gcry_mpi_t | my_offset |
Service's offset for values that could possibly be negative but are plaintext for encryption. More... | |
static struct GNUNET_CADET_Handle * | my_cadet |
Handle to the CADET service. More... | |
scalarproduct service implementation
Definition in file gnunet-service-scalarproduct_bob.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "scalarproduct-bob", __VA_ARGS__) |
Definition at line 38 of file gnunet-service-scalarproduct_bob.c.
#define ELEMENT_CAPACITY |
Maximum count of elements we can put into a multipart message.
Definition at line 398 of file gnunet-service-scalarproduct_bob.c.
|
static |
Callback used to free the elements in the map.
cls | NULL |
key | key of the element |
value | the value to free |
Definition at line 238 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_free, GNUNET_OK, and value.
Referenced by destroy_service_session().
|
static |
Destroy session state, we are done with it.
session | the session to free elements from |
Definition at line 255 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::channel, BobServiceSession::client, BobServiceSession::e_a, free_element_cb(), GNUNET_CADET_channel_destroy(), GNUNET_CADET_close_port(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_free, GNUNET_SERVICE_client_drop(), GNUNET_SETI_destroy(), GNUNET_SETI_operation_cancel(), GNUNET_YES, BobServiceSession::in_destroy, BobServiceSession::intersected_elements, BobServiceSession::intersection_op, BobServiceSession::intersection_set, BobServiceSession::port, BobServiceSession::r, BobServiceSession::r_prime, BobServiceSession::sorted_elements, BobServiceSession::used_element_count, and MpiElement::value.
Referenced by cb_channel_destruction(), and client_disconnect_cb().
|
static |
Notify the client that the session has succeeded or failed.
This message gets sent to Bob's client if the operation completed or Alice disconnected.
session | the associated client session to fail or succeed |
Definition at line 331 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::client_mq, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, GNUNET_MQ_msg, GNUNET_MQ_send(), msg, BobServiceSession::session_id, and BobServiceSession::status.
Referenced by bob_cadet_done_cb(), cb_channel_destruction(), and cb_intersection_element_removed().
|
static |
Function called whenever a channel is destroyed.
Should clean up any associated state.
It must NOT call GNUNET_CADET_channel_destroy() on the channel.
cls | the struct BobServiceSession |
channel | connection to the other end (henceforth invalid) |
Definition at line 362 of file gnunet-service-scalarproduct_bob.c.
References destroy_service_session(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_SCALARPRODUCT_STATUS_ACTIVE, GNUNET_SCALARPRODUCT_STATUS_FAILURE, prepare_client_end_notification(), and BobServiceSession::s.
Referenced by handle_bob_client_message().
|
static |
MQ finished giving our last message to CADET, now notify the client that we are finished.
Definition at line 386 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_SCALARPRODUCT_STATUS_SUCCESS, prepare_client_end_notification(), and BobServiceSession::status.
Referenced by transmit_bobs_cryptodata_message(), and transmit_bobs_cryptodata_message_multipart().
|
static |
Send a multipart chunk of a service response from Bob to Alice.
This element only contains the two permutations of R, R'.
s | the associated service session |
Definition at line 411 of file gnunet-service-scalarproduct_bob.c.
References bob_cadet_done_cb(), BobServiceSession::cadet_mq, BobServiceSession::cadet_transmitted_element_count, ELEMENT_CAPACITY, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_BOB_CRYPTODATA_MULTIPART, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), msg, payload, BobServiceSession::r, BobServiceSession::r_prime, and BobServiceSession::used_element_count.
Referenced by transmit_bobs_cryptodata_message().
|
static |
Bob generates the response message to be sent to Alice after computing the values (1), (2), S and S'.
(1)[]: $E_A(a_{pi(i)}) times E_A(- r_{pi(i)} - b_{pi(i)}) &= E_A(a_{pi(i)} - r_{pi(i)} - b_{pi(i)})$ (2)[]: $E_A(a_{pi'(i)}) times E_A(- r_{pi'(i)}) &= E_A(a_{pi'(i)} - r_{pi'(i)})$ S: $S := E_A(sum (r_i + b_i)^2)$ S': $S' := E_A(sum r_i^2)$
s | the associated requesting session with Alice |
Definition at line 472 of file gnunet-service-scalarproduct_bob.c.
References bob_cadet_done_cb(), BobServiceSession::cadet_mq, BobServiceSession::cadet_transmitted_element_count, GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_BOB_CRYPTODATA, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), msg, payload, BobServiceSession::r, BobServiceSession::r_prime, BobServiceSession::s, BobServiceSession::s_prime, transmit_bobs_cryptodata_message_multipart(), and BobServiceSession::used_element_count.
Referenced by transmit_cryptographic_reply().
|
static |
Computes the square sum over a vector of a given length.
vector | the vector to compute over |
length | the length of the vector |
Definition at line 539 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_assert, and consensus-simulation::sum.
Referenced by compute_service_response().
|
static |
Compute the values (1)[]: $E_A(a_{pi(i)}) otimes E_A(- r_{pi(i)} - b_{pi(i)}) &= E_A(a_{pi(i)} - r_{pi(i)} - b_{pi(i)})$ (2)[]: $E_A(a_{pi'(i)}) otimes E_A(- r_{pi'(i)}) &= E_A(a_{pi'(i)} - r_{pi'(i)})$ S: $S := E_A(sum (r_i + b_i)^2)$ S': $S' := E_A(sum r_i^2)$.
session | the requesting session + bob's requesting peer |
Definition at line 569 of file gnunet-service-scalarproduct_bob.c.
References compute_square_sum(), BobServiceSession::e_a, GNUNET_assert, GNUNET_break_op, GNUNET_CRYPTO_paillier_encrypt(), GNUNET_CRYPTO_paillier_hom_add(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_permute(), GNUNET_CRYPTO_random_u32(), GNUNET_free, GNUNET_malloc, GNUNET_OK, GNUNET_SYSERR, my_offset, p, q, BobServiceSession::r, BobServiceSession::r_prime, BobServiceSession::remote_pubkey, BobServiceSession::s, BobServiceSession::s_prime, BobServiceSession::sorted_elements, BobServiceSession::used_element_count, and value.
Referenced by transmit_cryptographic_reply().
|
static |
Iterator to copy over messages from the hash map into an array for sorting.
cls | the struct BobServiceSession * |
key | the key (unused) |
value | the struct GNUNET_SCALARPRODUCT_Element * TODO: code duplication with Alice! |
Definition at line 719 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_ntohll(), GNUNET_OK, MpiElement::key, GNUNET_SCALARPRODUCT_Element::key, BobServiceSession::s, BobServiceSession::sorted_elements, BobServiceSession::used_element_count, value, MpiElement::value, and GNUNET_SCALARPRODUCT_Element::value.
Referenced by transmit_cryptographic_reply().
|
static |
Compare two struct MpiValue
s by key for sorting.
a | pointer to first struct MpiValue * |
b | pointer to first struct MpiValue * |
Definition at line 750 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_CRYPTO_hash_cmp(), and MpiElement::key.
Referenced by transmit_cryptographic_reply().
|
static |
Intersection operation and receiving data via CADET from Alice are both done, compute and transmit our reply via CADET.
s | session to transmit reply for. |
Definition at line 769 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::channel, compute_service_response(), copy_element_cb(), element_cmp(), GNUNET_CADET_channel_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_malloc, GNUNET_OK, BobServiceSession::intersected_elements, LOG, BobServiceSession::sorted_elements, transmit_bobs_cryptodata_message(), and BobServiceSession::used_element_count.
Referenced by cb_intersection_element_removed(), and handle_alices_cryptodata_message().
|
static |
Check a multipart-chunk of a request from another service to calculate a scalarproduct with us.
cls | the struct BobServiceSession * |
msg | the actual message |
Definition at line 810 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::cadet_received_element_count, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_size(), GNUNET_OK, GNUNET_SYSERR, max, msg, BobServiceSession::s, and GNUNET_MessageHeader::size.
|
static |
Handle a multipart-chunk of a request from another service to calculate a scalarproduct with us.
cls | the struct BobServiceSession * |
msg | the actual message |
Definition at line 847 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::cadet_received_element_count, BobServiceSession::channel, BobServiceSession::e_a, GNUNET_CADET_receive_done(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_new_array, BobServiceSession::intersected_elements, BobServiceSession::intersection_op, max, msg, payload, BobServiceSession::s, and transmit_cryptographic_reply().
|
static |
Callback for set operation results.
Called for each element that needs to be removed from the result set.
cls | closure with the struct BobServiceSession |
element | a result element, only valid if status is #GNUNET_SETI_STATUS_OK |
current_size | current set size |
status | what has happened with the set intersection? |
Definition at line 895 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::channel, BobServiceSession::client_received_element_count, GNUNET_SETI_Element::data, GNUNET_assert, GNUNET_break, GNUNET_CADET_receive_done(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_ntohll(), GNUNET_SCALARPRODUCT_STATUS_FAILURE, GNUNET_SETI_destroy(), GNUNET_SETI_STATUS_DEL_LOCAL, GNUNET_SETI_STATUS_DONE, GNUNET_SETI_STATUS_FAILURE, GNUNET_YES, BobServiceSession::intersected_elements, BobServiceSession::intersection_op, BobServiceSession::intersection_set, GNUNET_SCALARPRODUCT_Element::key, LOG, prepare_client_end_notification(), BobServiceSession::s, status, BobServiceSession::status, transmit_cryptographic_reply(), and GNUNET_SCALARPRODUCT_Element::value.
|
static |
We've paired up a client session with an incoming CADET request.
Initiate set intersection work.
s | client session to start intersection for |
Definition at line 963 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_SETI_prepare(), BobServiceSession::intersection_op, BobServiceSession::peer, BobServiceSession::session_id, and BobServiceSession::total.
Referenced by handle_alices_computation_request(), and handle_bob_client_message_multipart().
|
static |
Handle a request from Alice to calculate a scalarproduct with us (Bob).
cls | the struct BobServiceSession * |
msg | the actual message |
Definition at line 998 of file gnunet-service-scalarproduct_bob.c.
References msg, BobServiceSession::s, and start_intersection().
|
static |
Function called for inbound channels on Bob's end.
Does some preliminary initialization, more happens after we get Alice's first message.
cls | closure with the struct BobServiceSession |
channel | new handle to the channel |
initiator | peer that started the channel |
Definition at line 1021 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::channel, GNUNET_CADET_close_port(), GNUNET_CADET_get_mq(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, and BobServiceSession::s.
Referenced by handle_bob_client_message().
|
static |
We're receiving additional set data.
Check it is well-formed.
cls | identification of the client |
msg | the actual message |
Definition at line 1047 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, BobServiceSession::s, and GNUNET_MessageHeader::size.
|
static |
We're receiving additional set data.
Add it to our set and if we are done, initiate the transaction.
cls | identification of the client |
msg | the actual message |
Definition at line 1081 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::channel, BobServiceSession::client, BobServiceSession::client_received_element_count, GNUNET_SETI_Element::data, GNUNET_SETI_Element::element_type, GNUNET_break, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_free, GNUNET_memcpy, GNUNET_new, GNUNET_SERVICE_client_continue(), GNUNET_SETI_add_element(), GNUNET_SYSERR, BobServiceSession::intersected_elements, BobServiceSession::intersection_set, GNUNET_SCALARPRODUCT_Element::key, msg, BobServiceSession::s, GNUNET_SETI_Element::size, start_intersection(), and BobServiceSession::total.
|
static |
Handler for Bob's a client request message.
Check msg is well-formed.
cls | identification of the client |
msg | the actual message |
Definition at line 1142 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_break, GNUNET_break_op, GNUNET_OK, GNUNET_SCALARPRODUCT_STATUS_INIT, GNUNET_SYSERR, msg, BobServiceSession::s, and GNUNET_MessageHeader::size.
|
static |
Handler for Bob's a client request message.
Bob is in the response role, keep the values + session and waiting for a matching session or process a waiting request from Alice.
cls | identification of the client |
msg | the actual message |
Definition at line 1181 of file gnunet-service-scalarproduct_bob.c.
References cb_channel_destruction(), cb_channel_incoming(), cfg, BobServiceSession::client, BobServiceSession::client_received_element_count, GNUNET_SETI_Element::data, GNUNET_SETI_Element::element_type, GNUNET_break, GNUNET_CADET_open_port(), GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_free, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ALICE_CRYPTODATA, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_SESSION_INITIALIZATION, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_new, GNUNET_ntohll(), GNUNET_SCALARPRODUCT_STATUS_ACTIVE, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SETI_add_element(), GNUNET_SETI_create(), GNUNET_SYSERR, GNUNET_YES, BobServiceSession::intersected_elements, BobServiceSession::intersection_set, GNUNET_SCALARPRODUCT_Element::key, msg, my_cadet, BobServiceSession::port, BobServiceSession::s, BobServiceSession::session_id, GNUNET_SETI_Element::size, BobServiceSession::status, BobServiceSession::total, BobServiceSession::used_element_count, and value.
|
static |
Task run during shutdown.
cls | unused |
Definition at line 1264 of file gnunet-service-scalarproduct_bob.c.
References GNUNET_CADET_disconnect(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, and my_cadet.
Referenced by run().
|
static |
A client connected.
Setup the associated data structure.
cls | closure, NULL |
client | identification of the client |
mq | message queue to communicate with client |
struct BobServiceSession
Definition at line 1288 of file gnunet-service-scalarproduct_bob.c.
References BobServiceSession::client, GNUNET_new, mq, and BobServiceSession::s.
|
static |
A client disconnected.
Remove the associated session(s), release data structures and cancel pending outgoing transmissions to the client.
cls | closure, NULL |
client | identification of the client |
app_cls | our struct BobServiceSession |
Definition at line 1312 of file gnunet-service-scalarproduct_bob.c.
References destroy_service_session(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, and BobServiceSession::s.
|
static |
Initialization of the program and message handlers.
cls | closure |
c | configuration to use |
service | the initialized service |
Definition at line 1333 of file gnunet-service-scalarproduct_bob.c.
References _, cfg, GNUNET_CADET_connect(), GNUNET_CRYPTO_PAILLIER_BITS, GNUNET_CRYPTO_paillier_create(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), my_cadet, my_offset, my_privkey, my_pubkey, and shutdown_task().
GNUNET_SERVICE_MAIN | ( | GNUNET_OS_project_data_gnunet() | , |
"scalarproduct-bob" | , | ||
GNUNET_SERVICE_OPTION_NONE | , | ||
& | run, | ||
& | client_connect_cb, | ||
& | client_disconnect_cb, | ||
NULL | , | ||
GNUNET_MQ_hd_var_size(bob_client_message, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_BOB, struct BobComputationMessage, NULL) | , | ||
GNUNET_MQ_hd_var_size(bob_client_message_multipart, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_MULTIPART_BOB, struct ComputationBobCryptodataMultipartMessage, NULL) | , | ||
GNUNET_MQ_handler_end() | |||
) |
Define "main" method using service macro.
|
static |
GNUnet configuration handle.
Definition at line 207 of file gnunet-service-scalarproduct_bob.c.
Referenced by handle_bob_client_message(), and run().
|
static |
Service's own public key.
Definition at line 212 of file gnunet-service-scalarproduct_bob.c.
Referenced by run().
|
static |
Service's own private key.
Definition at line 217 of file gnunet-service-scalarproduct_bob.c.
Referenced by run().
|
static |
Service's offset for values that could possibly be negative but are plaintext for encryption.
Definition at line 222 of file gnunet-service-scalarproduct_bob.c.
Referenced by compute_service_response(), and run().
|
static |
Handle to the CADET service.
Definition at line 227 of file gnunet-service-scalarproduct_bob.c.
Referenced by handle_bob_client_message(), run(), and shutdown_task().