32#ifndef GNUNET_SECRETSHARING_SERVICE_H
33#define GNUNET_SECRETSHARING_SERVICE_H
57#define GNUNET_SECRETSHARING_ELGAMAL_BITS 1024
63#define GNUNET_SECRETSHARING_ELGAMAL_P_HEX \
64 "0x08a347d3d69e8b2dd7d1b12a08dfbccbebf4ca" \
65 "6f4269a0814e158a34312964d946b3ef22882317" \
66 "2bcf30fc08f772774cb404f9bc002a6f66b09a79" \
67 "d810d67c4f8cb3bedc6060e3c8ef874b1b64df71" \
68 "6c7d2b002da880e269438d5a776e6b5f253c8df5" \
69 "6a16b1c7ce58def07c03db48238aadfc52a354a2" \
76#define GNUNET_SECRETSHARING_ELGAMAL_Q_HEX \
77 "0x0451a3e9eb4f4596ebe8d895046fde65f5fa65" \
78 "37a134d040a70ac51a1894b26ca359f79144118b" \
79 "95e7987e047bb93ba65a027cde001537b3584d3c" \
80 "ec086b3e27c659df6e303071e477c3a58db26fb8" \
81 "b63e958016d4407134a1c6ad3bb735af929e46fa" \
82 "b50b58e3e72c6f783e01eda411c556fe2951aa51" \
89#define GNUNET_SECRETSHARING_ELGAMAL_G_HEX \
90 "0x05c00c36d2e822950087ef09d8252994adc4e4" \
91 "8fe3ec70269f035b46063aff0c99b633fd64df43" \
92 "02442e1914c829a41505a275438871f365e91c12" \
93 "3d5303ef9e90f4b8cb89bf86cc9b513e74a72634" \
94 "9cfd9f953674fab5d511e1c078fc72d72b34086f" \
95 "c82b4b951989eb85325cb203ff98df76bc366bba" \
178 unsigned int num_ready_peers,
221 unsigned int threshold,
282 void *decrypt_cb_cls);
325 void *buf,
size_t buflen,
size_t *writelen);
336 gcry_mpi_t exponent);
static int start
Set if we are to start default services (including ARM).
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static char * data
The data to insert into the dht.
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
static unsigned int num_peers
Number of peers.
Functions related to time.
int GNUNET_SECRETSHARING_plaintext_generate(struct GNUNET_SECRETSHARING_Plaintext *plaintext, gcry_mpi_t exponent)
int GNUNET_SECRETSHARING_encrypt(const struct GNUNET_SECRETSHARING_PublicKey *public_key, const struct GNUNET_SECRETSHARING_Plaintext *plaintext, struct GNUNET_SECRETSHARING_Ciphertext *result_ciphertext)
Encrypt a value.
void GNUNET_SECRETSHARING_decrypt_cancel(struct GNUNET_SECRETSHARING_DecryptionHandle *dh)
Cancel a decryption.
int GNUNET_SECRETSHARING_plaintext_generate_i(struct GNUNET_SECRETSHARING_Plaintext *plaintext, int64_t exponent)
#define GNUNET_SECRETSHARING_ELGAMAL_BITS
Number of bits for secretsharing elements.
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, void *cls)
Create a session that will eventually establish a shared secret with the other peers.
void GNUNET_SECRETSHARING_share_destroy(struct GNUNET_SECRETSHARING_Share *share)
void GNUNET_SECRETSHARING_session_destroy(struct GNUNET_SECRETSHARING_Session *s)
Destroy a secret sharing session.
struct GNUNET_SECRETSHARING_Share * GNUNET_SECRETSHARING_share_read(const void *data, size_t len, size_t *readlen)
Read a share from its binary representation.
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)
Publish the given ciphertext for decryption.
void(* GNUNET_SECRETSHARING_DecryptCallback)(void *cls, const struct GNUNET_SECRETSHARING_Plaintext *plaintext)
Called when a decryption has succeeded.
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)
Called once the secret has been established with all peers, or the deadline is due.
int GNUNET_SECRETSHARING_share_write(const struct GNUNET_SECRETSHARING_Share *share, void *buf, size_t buflen, size_t *writelen)
Convert a share to its binary representation.
The identity of the host (wraps the signing key of the peer).
uint32_t c2_bits[1024/8/sizeof(uint32_t)]
uint32_t c1_bits[1024/8/sizeof(uint32_t)]
Handle to cancel a cooperative decryption operation.
GNUNET_SECRETSHARING_DecryptCallback decrypt_cb
Called when the secret sharing is done.
Plain, unencrypted message that can be encrypted with a group public key.
uint32_t bits[1024/8/sizeof(uint32_t)]
Value of the message.
Public key of a group sharing a secret.
uint32_t bits[1024/8/sizeof(uint32_t)]
Session that will eventually establish a shared secred between the involved peers and allow encryptio...
A share, with all values in in host byte order.
struct GNUNET_SECRETSHARING_FieldElement my_share
Share of 'my_peer'.
struct GNUNET_SECRETSHARING_PublicKey public_key
Public key.
Time for absolute times used by GNUnet, in microseconds.