+ GNUNET_BLOCK_mingle_hash (&ee->element_hash,
+ op->state->salt,
+ &mutated_hash);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Testing mingled hash %s with salt %u\n",
+ GNUNET_h2s (&mutated_hash),
+ op->state->salt);
+ if (GNUNET_NO ==
+ GNUNET_CONTAINER_bloomfilter_test (op->state->remote_bf,
+ &mutated_hash))
+ {
+ GNUNET_break (0 < op->state->my_element_count);
+ op->state->my_element_count--;
+ GNUNET_CRYPTO_hash_xor (&op->state->my_xor,
+ &ee->element_hash,
+ &op->state->my_xor);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Bloom filter reduction of my_elements, removing %s:%u\n",
+ GNUNET_h2s (&ee->element_hash),
+ ee->element.size);
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CONTAINER_multihashmap_remove (op->state->my_elements,
+ &ee->element_hash,
+ ee));
+ send_client_removed_element (op,
+ &ee->element);
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Bloom filter reduction of my_elements, keeping %s:%u\n",
+ GNUNET_h2s (&ee->element_hash),
+ ee->element.size);
+ }
+ return GNUNET_YES;
+}
+
+
+/**
+ * Create initial bloomfilter based on all the elements given.
+ *
+ * @param cls the `struct Operation *`
+ * @param key current key code
+ * @param value the `struct ElementEntry` to process
+ * @return #GNUNET_YES (we should continue to iterate)
+ */
+static int
+iterator_bf_create (void *cls,
+ const struct GNUNET_HashCode *key,
+ void *value)
+{
+ struct Operation *op = cls;
+ struct ElementEntry *ee = value;
+ struct GNUNET_HashCode mutated_hash;
+
+ GNUNET_BLOCK_mingle_hash (&ee->element_hash,
+ op->state->salt,
+ &mutated_hash);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Initializing BF with hash %s with salt %u\n",
+ GNUNET_h2s (&mutated_hash),
+ op->state->salt);
+ GNUNET_CONTAINER_bloomfilter_add (op->state->local_bf,
+ &mutated_hash);
+ return GNUNET_YES;