tor  0.4.2.0-alpha-dev
Functions
digestset.c File Reference
#include "orconfig.h"
#include "lib/container/bloomfilt.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/defs/digest_sizes.h"
#include "lib/crypt_ops/digestset.h"
#include "ext/siphash.h"

Go to the source code of this file.

Functions

static uint64_t bloomfilt_digest_hash (const struct sipkey *key, const void *item)
 
digestset_tdigestset_new (int max_guess)
 
void digestset_add (digestset_t *set, const char *digest)
 
int digestset_probably_contains (const digestset_t *set, const char *digest)
 

Detailed Description

Implementation for a set of digests.

Definition in file digestset.c.

Function Documentation

◆ digestset_add()

void digestset_add ( digestset_t set,
const char *  digest 
)

Add digest to set.

All future queries for digest in set will return true. Removing items is not possible.

Definition at line 44 of file digestset.c.

References bloomfilt_add().

◆ digestset_new()

digestset_t* digestset_new ( int  max_guess)

Allocate and return an digestset, suitable for holding up to max_guess distinct values.

Definition at line 30 of file digestset.c.

References BLOOMFILT_KEY_LEN, and bloomfilt_new().

◆ digestset_probably_contains()

int digestset_probably_contains ( const digestset_t set,
const char *  digest 
)

Return true if digest is a member of set. (And probably, return false if digest is not a member of set.)

Definition at line 54 of file digestset.c.

References bloomfilt_probably_contains().