42 uint16_t payload_size;
44 payload_size = ntohs (
sh->num_peers)
45 * (
sizeof(uint16_t) +
sizeof(
struct
50 *readlen = payload_size +
sizeof *
sh;
61 p = (
const char *) &
sh[1];
98 void *buf,
size_t buflen,
size_t *writelen)
100 uint16_t payload_size;
106 * (
sizeof(uint16_t) +
sizeof(
struct
110 if (NULL != writelen)
111 *writelen = payload_size +
sizeof(
struct
119 if (buflen < payload_size +
sizeof(
struct
static char * data
The data to insert into the dht.
static struct GNUNET_IDENTITY_Handle * sh
Handle to IDENTITY service.
static struct GNUNET_OS_Process * p
Helper process we started.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_SECRETSHARING_share_destroy(struct GNUNET_SECRETSHARING_Share *share)
struct GNUNET_SECRETSHARING_Share * GNUNET_SECRETSHARING_share_read(const void *data, size_t len, size_t *readlen)
Read a share from its binary representation.
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.
messages used for the secretsharing api
The identity of the host (wraps the signing key of the peer).
A share, with all values in in host byte order.
uint16_t num_peers
Peers that have the share.
uint16_t threshold
Threshold for the key this share belongs to.
struct GNUNET_SECRETSHARING_FieldElement my_share
Share of 'my_peer'.
struct GNUNET_SECRETSHARING_PublicKey public_key
Public key.
struct GNUNET_PeerIdentity * peers
Peer identities (includes 'my_peer')
uint16_t my_peer
Index of our peer in the list.
struct GNUNET_SECRETSHARING_FieldElement * sigmas
uint16_t * original_indices