key->msk = bswabe_msk_serialize(msk);
GNUNET_assert (NULL != key->pub);
GNUNET_assert (NULL != key->msk);
+ bswabe_pub_free (pub);
+ bswabe_msk_free (msk);
return key;
}
prv = bswabe_keygen(pub, msk, attrs);
prv_key = GNUNET_new (struct GNUNET_CRYPTO_AbeKey);
prv_key->prv = bswabe_prv_serialize(prv);
-
len = key->pub->len;
printf ("Keylen %lu\n", len);
prv_key->pub = bswabe_pub_serialize (pub);
GNUNET_assert (NULL != prv_key->prv);
+ bswabe_prv_free (prv);
+ bswabe_pub_free (pub);
+ bswabe_msk_free (msk);
return prv_key;
}
element_t m;
size_t payload_len;
ssize_t result_len;
+
pub = bswabe_pub_unserialize(key->pub, 0);
if( !(cph = bswabe_enc(pub, m, policy)) )
return GNUNET_SYSERR;
result_len = write_cpabe(result, cph_buf, payload_len, aes_buf);
g_byte_array_free(cph_buf, 1);
g_byte_array_free(aes_buf, 1);
+ bswabe_pub_free (pub);
return result_len;
}
g_byte_array_free(aes_buf, 1);
*result = GNUNET_malloc (plt->len);
GNUNET_memcpy (*result, plt->data, plt->len);
-
+ bswabe_prv_free (prv);
+ bswabe_pub_free (pub);
return pt_size;
}