#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_secretsharing_service.h"
#include "secretsharing.h"
#include <gcrypt.h>
Go to the source code of this file.
Data Structures | |
struct | GNUNET_SECRETSHARING_Session |
Session that will eventually establish a shared secred between the involved peers and allow encryption and cooperative decryption. More... | |
struct | GNUNET_SECRETSHARING_DecryptionHandle |
Handle to cancel a cooperative decryption operation. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "secretsharing-api", __VA_ARGS__) |
Variables | |
static gcry_mpi_t | elgamal_q |
The ElGamal prime field order as libgcrypt mpi. More... | |
static gcry_mpi_t | elgamal_p |
Modulus of the prime field used for ElGamal. More... | |
static gcry_mpi_t | elgamal_g |
Generator for prime field of order 'elgamal_q'. More... | |
Definition in file secretsharing_api.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "secretsharing-api", __VA_ARGS__) |
Definition at line 33 of file secretsharing_api.c.
|
static |
Function to initialize elgamal_q, elgamal_p and elgamal_g.
Definition at line 103 of file secretsharing_api.c.
References elgamal_g, elgamal_p, elgamal_q, GNUNET_assert, GNUNET_SECRETSHARING_ELGAMAL_G_HEX, GNUNET_SECRETSHARING_ELGAMAL_P_HEX, and GNUNET_SECRETSHARING_ELGAMAL_Q_HEX.
Referenced by GNUNET_SECRETSHARING_encrypt(), and GNUNET_SECRETSHARING_plaintext_generate_i().
|
static |
Callback invoked when there is an error communicating with the service.
Notifies the application about the error.
cls | the struct GNUNET_SECRETSHARING_Session |
error | error code |
Definition at line 128 of file secretsharing_api.c.
References GNUNET_SECRETSHARING_session_destroy(), GNUNET_SECRETSHARING_Session::secret_ready_cb, and GNUNET_SECRETSHARING_Session::secret_ready_cls.
Referenced by GNUNET_SECRETSHARING_create_session().
|
static |
Callback invoked when there is an error communicating with the service.
Notifies the application about the error.
cls | the struct GNUNET_SECRETSHARING_DecryptionHandle |
error | error code |
Definition at line 146 of file secretsharing_api.c.
References GNUNET_SECRETSHARING_DecryptionHandle::decrypt_cb, GNUNET_SECRETSHARING_DecryptionHandle::decrypt_cls, and GNUNET_SECRETSHARING_decrypt_cancel().
Referenced by GNUNET_SECRETSHARING_decrypt().
|
static |
Handler invoked with the final result message from secret sharing.
Decodes the message and passes the result to the application.
cls | the struct GNUNET_SECRETSHARING_Session |
m | message with the result |
Definition at line 165 of file secretsharing_api.c.
References GNUNET_OK.
|
static |
Handler invoked with the final result message from secret sharing.
Decodes the message and passes the result to the application.
cls | the struct GNUNET_SECRETSHARING_Session |
m | message with the result |
Definition at line 182 of file secretsharing_api.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_SECRETSHARING_session_destroy(), GNUNET_SECRETSHARING_share_read(), LOG, m, GNUNET_SECRETSHARING_Share::num_peers, GNUNET_SECRETSHARING_Share::public_key, GNUNET_SECRETSHARING_Session::secret_ready_cb, and GNUNET_SECRETSHARING_Session::secret_ready_cls.
|
static |
Definition at line 303 of file secretsharing_api.c.
References GNUNET_SECRETSHARING_DecryptionHandle::decrypt_cb, GNUNET_SECRETSHARING_DecryptionHandle::decrypt_cls, GNUNET_SECRETSHARING_decrypt_cancel(), and m.
|
static |
The ElGamal prime field order as libgcrypt mpi.
Initialized in init_crypto_constants.
Definition at line 84 of file secretsharing_api.c.
Referenced by ensure_elgamal_initialized(), and GNUNET_SECRETSHARING_encrypt().
|
static |
Modulus of the prime field used for ElGamal.
Initialized in init_crypto_constants.
Definition at line 90 of file secretsharing_api.c.
Referenced by ensure_elgamal_initialized(), GNUNET_SECRETSHARING_encrypt(), and GNUNET_SECRETSHARING_plaintext_generate_i().
|
static |
Generator for prime field of order 'elgamal_q'.
Initialized in init_crypto_constants.
Definition at line 96 of file secretsharing_api.c.
Referenced by ensure_elgamal_initialized(), GNUNET_SECRETSHARING_encrypt(), and GNUNET_SECRETSHARING_plaintext_generate_i().