2021-07-21 14:05:08 +02:00
|
|
|
#ifndef BLOOM_H
|
|
|
|
#define BLOOM_H
|
|
|
|
|
|
|
|
#include "ens/storage.h"
|
2021-09-21 21:41:40 +02:00
|
|
|
#include "exposure-notification.h"
|
2021-07-30 00:36:36 +02:00
|
|
|
|
2021-12-10 13:51:56 +01:00
|
|
|
typedef struct {
|
2021-07-30 00:36:36 +02:00
|
|
|
uint8_t* data;
|
|
|
|
size_t size;
|
|
|
|
} bloom_filter_t;
|
|
|
|
|
2021-07-21 14:05:08 +02:00
|
|
|
/**
|
|
|
|
* Initialize the bloom filter on basis of the already registerred records.
|
|
|
|
*/
|
2021-09-21 21:41:40 +02:00
|
|
|
bloom_filter_t* bloom_init(size_t size);
|
|
|
|
|
|
|
|
void bloom_destroy(bloom_filter_t* bloom);
|
2021-07-21 14:05:08 +02:00
|
|
|
|
|
|
|
// TODO lome: maybe only use RPI (should be sufficient)
|
2021-09-21 21:41:40 +02:00
|
|
|
void bloom_add_record(bloom_filter_t* bloom, ENIntervalIdentifier* rpi);
|
2021-07-21 14:05:08 +02:00
|
|
|
|
|
|
|
// TODO lome: maybe only use RPI (should be sufficient)
|
2021-09-21 21:41:40 +02:00
|
|
|
bool bloom_probably_has_record(bloom_filter_t* bloom, ENIntervalIdentifier* rpi);
|
2021-07-21 14:05:08 +02:00
|
|
|
|
2021-09-21 21:41:40 +02:00
|
|
|
#endif
|