uint16_t pt_size;
char iob[DBLOCK_SIZE];
char enc[DBLOCK_SIZE];
- struct GNUNET_CRYPTO_AesSessionKey sk;
- struct GNUNET_CRYPTO_AesInitializationVector iv;
+ struct GNUNET_CRYPTO_SymmetricSessionKey sk;
+ struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
unsigned int off;
GNUNET_assert (GNUNET_NO == te->in_next);
mychk = &te->chk_tree[te->current_depth * CHK_PER_INODE + off];
GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key);
GNUNET_CRYPTO_hash_to_aes_key (&mychk->key, &sk, &iv);
- GNUNET_CRYPTO_aes_encrypt (pt_block, pt_size, &sk, &iv, enc);
+ GNUNET_CRYPTO_symmetric_encrypt (pt_block, pt_size, &sk, &iv, enc);
GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"TE calculates query to be `%s', stored at %u\n",
}
+/**
+ * Get the resulting URI from the encoding.
+ *
+ * @param te the tree encoder to clean up
+ * @return uri set to the resulting URI (if encoding finished), NULL otherwise
+ */
+struct GNUNET_FS_Uri *
+GNUNET_FS_tree_encoder_get_uri (struct GNUNET_FS_TreeEncoder *te)
+{
+ if (NULL != te->uri)
+ return GNUNET_FS_uri_dup (te->uri);
+ return NULL;
+}
+
+
/**
* Clean up a tree encoder and return information
- * about the resulting URI or an error message.
+ * about possible errors.
*
* @param te the tree encoder to clean up
- * @param uri set to the resulting URI (if encoding finished)
* @param emsg set to an error message (if an error occured
* within the tree encoder; if this function is called
* prior to completion and prior to an internal error,
- * both "*uri" and "*emsg" will be set to NULL).
+ * both "*emsg" will be set to NULL).
*/
void
GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te,
- struct GNUNET_FS_Uri **uri, char **emsg)
+ char **emsg)
{
if (NULL != te->reader)
{
te->reader = NULL;
}
GNUNET_assert (GNUNET_NO == te->in_next);
- if (uri != NULL)
- *uri = te->uri;
- else if (NULL != te->uri)
+ if (NULL != te->uri)
GNUNET_FS_uri_destroy (te->uri);
if (emsg != NULL)
*emsg = te->emsg;