X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_secretsharing_service.h;h=f77fd33d2dec327adc4bbb8522529a35efe75051;hb=e933b0a58ab7b0f21faef0267c2cb835cabd5a03;hp=1524c79fed0425eebd29b72990be3a2e8e1a98b9;hpb=29517cf1e5cb2e2a92c97f458ba4d3fe6716b1ee;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_secretsharing_service.h b/src/include/gnunet_secretsharing_service.h index 1524c79fe..f77fd33d2 100644 --- a/src/include/gnunet_secretsharing_service.h +++ b/src/include/gnunet_secretsharing_service.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet - (C) 2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2013 GNUnet e.V. GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -14,14 +14,19 @@ You should have received a copy of the GNU General Public License along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /** - * @file include/gnunet_secretsharing_service.h - * @brief verifiable additive secret sharing and cooperative decryption * @author Florian Dold + * + * @file + * Verifiable additive secret sharing and cooperative decryption + * + * @defgroup secretsharing Secret Sharing service + * Verifiable additive secret sharing and cooperative decryption. + * @{ */ #ifndef GNUNET_SECRETSHARING_SERVICE_H @@ -35,7 +40,6 @@ extern "C" #endif #endif -#include "platform.h" #include "gnunet_common.h" #include "gnunet_time_lib.h" #include "gnunet_configuration_lib.h" @@ -164,11 +168,12 @@ struct GNUNET_SECRETSHARING_Plaintext * @param ready_peers peers that successfuly participated in establishing * the shared secret */ -typedef void (*GNUNET_SECRETSHARING_SecretReadyCallback) (void *cls, - struct GNUNET_SECRETSHARING_Share *my_share, - struct GNUNET_SECRETSHARING_PublicKey *public_key, - unsigned int num_ready_peers, - struct GNUNET_PeerIdentity *ready_peers); +typedef void +(*GNUNET_SECRETSHARING_SecretReadyCallback) (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); /** @@ -178,8 +183,9 @@ typedef void (*GNUNET_SECRETSHARING_SecretReadyCallback) (void *cls, * @param data decrypted value * @param data_size number of bytes in @a data */ -typedef void (*GNUNET_SECRETSHARING_DecryptCallback) (void *cls, - const struct GNUNET_SECRETSHARING_Plaintext *plaintext); +typedef void +(*GNUNET_SECRETSHARING_DecryptCallback) (void *cls, + const struct GNUNET_SECRETSHARING_Plaintext *plaintext); /** @@ -187,20 +193,23 @@ typedef void (*GNUNET_SECRETSHARING_DecryptCallback) (void *cls, * with the other peers. * * @param cfg configuration to use - * @param num_peers number of peers in 'peers' + * @param num_peers number of peers in @a peers * @param peers array of peers that we will share secrets with, can optionally contain the local peer * @param session_id unique session id + * @param start When should all peers be available for sharing the secret? + * Random number generation can take place before the start time. * @param deadline point in time where the session must be established; taken as hint * by underlying consensus sessions * @param threshold minimum number of peers that must cooperate to decrypt a value * @param cb called when the secret has been established - * @param cls closure for cb + * @param cls closure for @a cb */ struct GNUNET_SECRETSHARING_Session * GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int num_peers, const struct GNUNET_PeerIdentity *peers, const struct GNUNET_HashCode *session_id, + struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute deadline, unsigned int threshold, GNUNET_SECRETSHARING_SecretReadyCallback cb, @@ -211,10 +220,10 @@ GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *c * Destroy a secret sharing session. * The secret ready callback will not be called. * - * @param session session to destroy + * @param s session to destroy */ void -GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *session); +GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *s); /** @@ -247,6 +256,7 @@ GNUNET_SECRETSHARING_encrypt (const struct GNUNET_SECRETSHARING_PublicKey *publi * @param share our secret share to use for decryption * @param ciphertext ciphertext to publish in order to decrypt it (if enough peers agree) * @param decrypt_cb callback called once the decryption succeeded + * @param start By when should the cooperation for decryption start? * @param deadline By when should the decryption be finished? * @param decrypt_cb_cls closure for @a decrypt_cb * @return handle to cancel the operation @@ -255,6 +265,7 @@ struct GNUNET_SECRETSHARING_DecryptionHandle * GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SECRETSHARING_Share *share, const struct GNUNET_SECRETSHARING_Ciphertext *ciphertext, + struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute deadline, GNUNET_SECRETSHARING_DecryptCallback decrypt_cb, void *decrypt_cb_cls); @@ -266,10 +277,10 @@ GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg, * The decrypt_cb is not called anymore, but the calling * peer may already have irrevocably contributed his share for the decryption of the value. * - * @param decryption_handle decryption to cancel + * @param dh to cancel */ void -GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandle *decryption_handle); +GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandle *dh); /** @@ -314,8 +325,6 @@ GNUNET_SECRETSHARING_plaintext_generate_i (struct GNUNET_SECRETSHARING_Plaintext int64_t exponent); - - #if 0 /* keep Emacsens' auto-indent happy */ { #endif @@ -324,3 +333,5 @@ GNUNET_SECRETSHARING_plaintext_generate_i (struct GNUNET_SECRETSHARING_Plaintext #endif #endif + +/** @} */ /* end of group */