* @return The share, or NULL on error.
*/
struct GNUNET_SECRETSHARING_Share *
-GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen)
+GNUNET_SECRETSHARING_share_read (const void *data,
+ size_t len,
+ size_t *readlen)
{
struct GNUNET_SECRETSHARING_Share *share;
const struct GNUNET_SECRETSHARING_ShareHeaderNBO *sh = data;
size_t n;
uint16_t payload_size;
- payload_size = ntohs (sh->num_peers) *
- (sizeof (uint16_t) + sizeof (struct GNUNET_SECRETSHARING_FieldElement) +
+ payload_size = ntohs (sh->num_peers) *
+ (sizeof (uint16_t) + sizeof (struct GNUNET_SECRETSHARING_FieldElement) +
sizeof (struct GNUNET_PeerIdentity));
if (NULL != readlen)
char *p;
int n;
- payload_size = share->num_peers *
- (sizeof (uint16_t) + sizeof (struct GNUNET_SECRETSHARING_FieldElement) +
+ payload_size = share->num_peers *
+ (sizeof (uint16_t) + sizeof (struct GNUNET_SECRETSHARING_FieldElement) +
sizeof (struct GNUNET_PeerIdentity));
if (NULL != writelen)
}
+void
+GNUNET_SECRETSHARING_share_destroy (struct GNUNET_SECRETSHARING_Share *share)
+{
+ GNUNET_free (share->original_indices);
+ share->original_indices = NULL;
+ GNUNET_free (share->sigmas);
+ share->sigmas = NULL;
+ GNUNET_free (share->peers);
+ share->peers = NULL;
+ GNUNET_free (share);
+}
+
+