![]() |
GNUnet
0.11.x
|
profiling tool for distributed key generation and decryption More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_secretsharing_service.h"
#include "gnunet_testbed_service.h"
Go to the source code of this file.
Functions | |
static void | controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) |
Signature of the event handler function called by the respective event controller. More... | |
static void | session_connect_complete (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg) |
Callback to be called when a service connect operation is completed. More... | |
static void | decrypt_connect_complete (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg) |
Callback to be called when a service connect operation is completed. More... | |
static void | decrypt_cb (void *cls, const struct GNUNET_SECRETSHARING_Plaintext *plaintext) |
Called when a decryption has succeeded. More... | |
static void * | decrypt_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Adapter function called to establish a connection to a service. More... | |
static void | decrypt_disconnect_adapter (void *cls, void *op_result) |
Adapter function called to destroy a connection to a service. More... | |
static void | secret_ready_cb (void *cls, struct GNUNET_SECRETSHARING_Share *my_share, struct GNUNET_SECRETSHARING_PublicKey *public_key, unsigned int num_ready_peers, const struct GNUNET_PeerIdentity *ready_peers) |
static void * | session_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Adapter function called to establish a connection to a service. More... | |
static void | session_disconnect_adapter (void *cls, void *op_result) |
Adapter function called to destroy a connection to a service. More... | |
static void | peer_info_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op, const struct GNUNET_TESTBED_PeerInformation *pinfo, const char *emsg) |
Callback to be called when the requested peer information is available. More... | |
static void | handle_shutdown (void *cls) |
Signature of the main function of a task. More... | |
static void | test_master (void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **started_peers, unsigned int links_succeeded, unsigned int links_failed) |
Signature of a main function for a testcase. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
int | main (int argc, char **argv) |
Variables | |
static unsigned int | num_peers = 3 |
How many peers should participate in the key generation? More... | |
static unsigned int | threshold = 2 |
What should the threshold for then key be? More... | |
static int | decrypt = GNUNET_NO |
Should we try to decrypt a value after the key generation? More... | |
static struct GNUNET_TIME_Relative | timeout |
When would we like to see the operation finished? More... | |
static struct GNUNET_TIME_Relative | delay |
When should dkg communication start? More... | |
static struct GNUNET_SECRETSHARING_Session ** | session_handles |
Handles for secretsharing sessions. More... | |
static struct GNUNET_SECRETSHARING_DecryptionHandle ** | decrypt_handles |
static struct GNUNET_SECRETSHARING_Share ** | shares |
Shares we got from the distributed key generation. More... | |
static struct GNUNET_SECRETSHARING_PublicKey | common_pubkey |
static unsigned int | num_connected_sessions |
static unsigned int | num_connected_decrypt |
static struct GNUNET_TESTBED_Peer ** | peers |
Handles to the running peers. More... | |
static struct GNUNET_PeerIdentity * | peer_ids |
static unsigned int | num_retrieved_peer_ids |
static unsigned int | num_generated |
static unsigned int | num_decrypted |
static struct GNUNET_HashCode | session_id |
static unsigned int | verbose |
static struct GNUNET_SECRETSHARING_Plaintext | reference_plaintext |
static struct GNUNET_SECRETSHARING_Ciphertext | ciphertext |
static struct GNUNET_TIME_Absolute | dkg_start |
static struct GNUNET_TIME_Absolute | dkg_deadline |
static struct GNUNET_TIME_Absolute | decrypt_start |
static struct GNUNET_TIME_Absolute | decrypt_deadline |
static struct GNUNET_TESTBED_Operation ** | connect_ops |
Connect operations, one for every peer. More... | |
static int | in_shutdown |
Are we performing a shutdown right now? More... | |
profiling tool for distributed key generation and decryption
Definition in file gnunet-secretsharing-profiler.c.
|
static |
Signature of the event handler function called by the respective event controller.
cls | closure |
event | information about the event |
Definition at line 125 of file gnunet-secretsharing-profiler.c.
References GNUNET_assert.
Referenced by run().
|
static |
Callback to be called when a service connect operation is completed.
cls | the callback closure from functions generating an operation |
op | the operation that has been finished |
ca_result | the service handle returned from GNUNET_TESTBED_ConnectAdapter() |
emsg | error message in case the operation has failed; will be NULL if operation has executed successfully. |
Definition at line 142 of file gnunet-secretsharing-profiler.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, num_connected_sessions, and num_peers.
Referenced by peer_info_cb().
|
static |
Callback to be called when a service connect operation is completed.
cls | the callback closure from functions generating an operation |
op | the operation that has been finished |
ca_result | the service handle returned from GNUNET_TESTBED_ConnectAdapter() |
emsg | error message in case the operation has failed; will be NULL if operation has executed successfully. |
Definition at line 178 of file gnunet-secretsharing-profiler.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, num_connected_decrypt, and num_peers.
Referenced by session_disconnect_adapter().
|
static |
Called when a decryption has succeeded.
cls | Plaintext |
plaintext | Plaintext |
Definition at line 211 of file gnunet-secretsharing-profiler.c.
References decrypt_handles, GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_memcmp, GNUNET_SCHEDULER_shutdown(), GNUNET_TESTBED_operation_done(), num_decrypted, num_peers, and reference_plaintext.
Referenced by decrypt_connect_adapter(), and GNUNET_SECRETSHARING_decrypt().
|
static |
Adapter function called to establish a connection to a service.
cls | closure |
cfg | configuration of the peer to connect to; will be available until GNUNET_TESTBED_operation_done() is called on the operation returned from GNUNET_TESTBED_service_connect() |
Definition at line 259 of file gnunet-secretsharing-profiler.c.
References ciphertext, decrypt_cb(), decrypt_deadline, decrypt_handles, decrypt_start, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SECRETSHARING_decrypt(), and num_peers.
Referenced by session_disconnect_adapter().
|
static |
Adapter function called to destroy a connection to a service.
cls | closure |
op_result | service handle returned from the connect adapter |
Definition at line 285 of file gnunet-secretsharing-profiler.c.
References decrypt_handles, GNUNET_assert, and GNUNET_SECRETSHARING_decrypt_cancel().
Referenced by session_disconnect_adapter().
|
static |
Definition at line 304 of file gnunet-secretsharing-profiler.c.
References common_pubkey, GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_memcmp, GNUNET_SCHEDULER_shutdown(), GNUNET_STRINGS_data_to_string(), GNUNET_TESTBED_operation_done(), num_generated, ret, and session_handles.
Referenced by session_connect_adapter().
|
static |
Adapter function called to establish a connection to a service.
cls | closure |
cfg | configuration of the peer to connect to; will be available until GNUNET_TESTBED_operation_done() is called on the operation returned from GNUNET_TESTBED_service_connect() |
Definition at line 366 of file gnunet-secretsharing-profiler.c.
References dkg_deadline, dkg_start, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SECRETSHARING_create_session(), num_peers, secret_ready_cb(), session_id, and threshold.
Referenced by peer_info_cb().
|
static |
Adapter function called to destroy a connection to a service.
cls | closure |
op_result | service handle returned from the connect adapter |
Definition at line 394 of file gnunet-secretsharing-profiler.c.
References ciphertext, common_pubkey, decrypt, decrypt_connect_adapter(), decrypt_connect_complete(), decrypt_deadline, decrypt_disconnect_adapter(), decrypt_start, delay, GNUNET_assert, GNUNET_NO, GNUNET_SCHEDULER_shutdown(), GNUNET_SECRETSHARING_encrypt(), GNUNET_SECRETSHARING_plaintext_generate_i(), GNUNET_SECRETSHARING_session_destroy(), GNUNET_TESTBED_service_connect(), GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get(), GNUNET_YES, in_shutdown, num_generated, num_peers, reference_plaintext, session_handles, and timeout.
Referenced by peer_info_cb().
|
static |
Callback to be called when the requested peer information is available.
cb_cls | the closure from GNUNET_TETSBED_peer_get_information() |
op | the operation this callback corresponds to |
pinfo | the result; will be NULL if the operation has failed |
emsg | error message if the operation has failed; will be NULL if the operation is successfull |
Definition at line 456 of file gnunet-secretsharing-profiler.c.
References GNUNET_assert, GNUNET_TESTBED_operation_done(), GNUNET_TESTBED_PIT_IDENTITY, GNUNET_TESTBED_service_connect(), GNUNET_TESTBED_PeerInformation::id, num_peers, num_retrieved_peer_ids, p, GNUNET_TESTBED_PeerInformation::pit, GNUNET_TESTBED_PeerInformation::result, session_connect_adapter(), session_connect_complete(), and session_disconnect_adapter().
Referenced by test_master().
|
static |
Signature of the main function of a task.
cls | closure |
Definition at line 496 of file gnunet-secretsharing-profiler.c.
References GNUNET_free, GNUNET_TESTBED_operation_done(), GNUNET_YES, in_shutdown, and num_peers.
Referenced by test_master().
|
static |
Signature of a main function for a testcase.
cls | closure |
h | the run handle |
num_peers | number of peers in 'peers' |
started_peers | handle to peers run in the testbed. NULL upon timeout (see GNUNET_TESTBED_test_run()). |
links_succeeded | the number of overlay link connection attempts that succeeded |
links_failed | the number of overlay link connection attempts that failed |
Definition at line 531 of file gnunet-secretsharing-profiler.c.
References GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_log_setup(), GNUNET_malloc, GNUNET_new_array, GNUNET_SCHEDULER_add_shutdown(), GNUNET_TESTBED_peer_get_information(), GNUNET_TESTBED_PIT_IDENTITY, handle_shutdown(), num_peers, and peer_info_cb().
Referenced by run().
|
static |
Definition at line 570 of file gnunet-secretsharing-profiler.c.
References controller_cb(), delay, dkg_deadline, dkg_start, GNUNET_CONFIGURATION_get_value_string(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_TESTBED_test_run(), GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get(), num_peers, session_id, test_master(), timeout, and topology.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 618 of file gnunet-secretsharing-profiler.c.
References decrypt, delay, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_relative_time(), GNUNET_GETOPT_option_uint(), GNUNET_GETOPT_option_verbose(), GNUNET_PROGRAM_run2(), GNUNET_TIME_UNIT_MINUTES, GNUNET_TIME_UNIT_ZERO, GNUNET_YES, num_peers, run(), threshold, timeout, and verbose.
|
static |
How many peers should participate in the key generation?
Definition at line 34 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_cb(), decrypt_connect_adapter(), decrypt_connect_complete(), handle_shutdown(), main(), peer_info_cb(), run(), session_connect_adapter(), session_connect_complete(), session_disconnect_adapter(), and test_master().
|
static |
What should the threshold for then key be?
Definition at line 39 of file gnunet-secretsharing-profiler.c.
Referenced by GNUNET_TIME_randomized_backoff(), keygen_reveal_get_exp_coeff(), main(), and session_connect_adapter().
|
static |
Should we try to decrypt a value after the key generation?
Definition at line 44 of file gnunet-secretsharing-profiler.c.
Referenced by main(), and session_disconnect_adapter().
|
static |
When would we like to see the operation finished?
Definition at line 49 of file gnunet-secretsharing-profiler.c.
Referenced by main(), run(), and session_disconnect_adapter().
|
static |
When should dkg communication start?
Definition at line 54 of file gnunet-secretsharing-profiler.c.
Referenced by ack_proc(), get_delay(), GST_ats_update_delay(), GST_manipulation_init(), main(), run(), schedule_select_v4(), schedule_select_v6(), and session_disconnect_adapter().
|
static |
Handles for secretsharing sessions.
Definition at line 59 of file gnunet-secretsharing-profiler.c.
Referenced by secret_ready_cb(), and session_disconnect_adapter().
|
static |
Definition at line 61 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_cb(), decrypt_connect_adapter(), and decrypt_disconnect_adapter().
|
static |
Shares we got from the distributed key generation.
Definition at line 66 of file gnunet-secretsharing-profiler.c.
|
static |
Definition at line 68 of file gnunet-secretsharing-profiler.c.
Referenced by secret_ready_cb(), and session_disconnect_adapter().
|
static |
Definition at line 71 of file gnunet-secretsharing-profiler.c.
Referenced by session_connect_complete().
|
static |
Definition at line 73 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_connect_complete().
|
static |
Handles to the running peers.
When peers[i] is NULL, the i-th peer has stopped.
Definition at line 79 of file gnunet-secretsharing-profiler.c.
|
static |
Definition at line 81 of file gnunet-secretsharing-profiler.c.
|
static |
Definition at line 83 of file gnunet-secretsharing-profiler.c.
Referenced by peer_info_cb().
|
static |
Definition at line 85 of file gnunet-secretsharing-profiler.c.
Referenced by secret_ready_cb(), and session_disconnect_adapter().
|
static |
Definition at line 87 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_cb().
|
static |
Definition at line 89 of file gnunet-secretsharing-profiler.c.
Referenced by run(), and session_connect_adapter().
|
static |
Definition at line 91 of file gnunet-secretsharing-profiler.c.
Referenced by main().
|
static |
Definition at line 93 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_cb(), and session_disconnect_adapter().
|
static |
Definition at line 95 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_connect_adapter(), decrypt_new_element(), GNUNET_SECRETSHARING_decrypt(), insert_decrypt_element(), and session_disconnect_adapter().
|
static |
Definition at line 97 of file gnunet-secretsharing-profiler.c.
Referenced by run(), and session_connect_adapter().
|
static |
Definition at line 99 of file gnunet-secretsharing-profiler.c.
Referenced by run(), and session_connect_adapter().
|
static |
Definition at line 102 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_connect_adapter(), and session_disconnect_adapter().
|
static |
Definition at line 104 of file gnunet-secretsharing-profiler.c.
Referenced by decrypt_connect_adapter(), and session_disconnect_adapter().
|
static |
Connect operations, one for every peer.
Definition at line 109 of file gnunet-secretsharing-profiler.c.
|
static |
Are we performing a shutdown right now?
Definition at line 114 of file gnunet-secretsharing-profiler.c.
Referenced by handle_shutdown(), and session_disconnect_adapter().