6 #ifndef TOR_BLOOMFILT_H
7 #define TOR_BLOOMFILT_H
23 #define BLOOMFILT_N_HASHES 2
26 #define BLOOMFILT_KEY_LEN (BLOOMFILT_N_HASHES * 16)
29 typedef uint64_t (*bloomfilt_hash_fn)(
const struct sipkey *key,
36 bloomfilt_hash_fn hashfn,
37 const uint8_t *random_key);
39 #define bloomfilt_free(set) FREE_AND_NULL(bloomfilt_t, bloomfilt_free_, (set))
Implements a variable-sized (but non-resizeable) bit-array.
void bloomfilt_add(bloomfilt_t *set, const void *item)
int bloomfilt_probably_contains(const bloomfilt_t *set, const void *item)
bloomfilt_t * bloomfilt_new(int max_elements, bloomfilt_hash_fn hashfn, const uint8_t *random_key)
void bloomfilt_free_(bloomfilt_t *set)
Integer definitions used throughout Tor.