Tor
0.4.6.0-alpha-dev
lib
crypt_ops
digestset.h
Go to the documentation of this file.
1
/* Copyright (c) 2018-2020, The Tor Project, Inc. */
2
/* See LICENSE for licensing information */
3
4
/**
5
* \file digestset.h
6
* \brief Types to handle sets of digests, based on bloom filters.
7
**/
8
9
#ifndef TOR_DIGESTSET_H
10
#define TOR_DIGESTSET_H
11
12
#include "orconfig.h"
13
#include "
lib/cc/torint.h
"
14
#include "
lib/container/bloomfilt.h
"
15
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.
20
*/
21
typedef
struct
bloomfilt_t
digestset_t;
22
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);
28
29
#endif
/* !defined(TOR_DIGESTSET_H) */
torint.h
Integer definitions used throughout Tor.
digestset_add
void digestset_add(digestset_t *set, const char *addr)
Definition:
digestset.c:44
bloomfilt_t
Definition:
bloomfilt.c:24
digestset_new
digestset_t * digestset_new(int max_addresses_guess)
Definition:
digestset.c:30
bloomfilt.h
Header for bloomfilt.c.
digestset_probably_contains
int digestset_probably_contains(const digestset_t *set, const char *addr)
Definition:
digestset.c:54
Generated by
1.8.20