Update copyrights to 2021, using "make update-copyright"
[tor.git] / src / lib / crypt_ops / digestset.h
blob76e6045c981ca1c99f894499c4ead3efdf9a77b1
1 /* Copyright (c) 2018-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
4 /**
5 * \file digestset.h
6 * \brief Types to handle sets of digests, based on bloom filters.
7 **/
9 #ifndef TOR_DIGESTSET_H
10 #define TOR_DIGESTSET_H
12 #include "orconfig.h"
13 #include "lib/cc/torint.h"
14 #include "lib/container/bloomfilt.h"
16 /**
17 * An digestset_t represents a set of 20-byte digest values. The
18 * implementation is probabilistic: false negatives cannot occur but false
19 * positives are possible.
21 typedef struct bloomfilt_t digestset_t;
23 digestset_t *digestset_new(int max_addresses_guess);
24 #define digestset_free(set) bloomfilt_free(set)
25 void digestset_add(digestset_t *set, const char *addr);
26 int digestset_probably_contains(const digestset_t *set,
27 const char *addr);
29 #endif /* !defined(TOR_DIGESTSET_H) */