-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbloom_filter.h
More file actions
33 lines (26 loc) · 736 Bytes
/
bloom_filter.h
File metadata and controls
33 lines (26 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Created by jelle on 09-10-20.
//
#ifndef BLOOM_FILTER_H
#define BLOOM_FILTER_H
#include <vector>
#include "threshold_paillier.h"
#include "MurmurHash3.h"
using namespace NTL;
class BloomFilter {
public:
explicit BloomFilter(unsigned long m_bits, unsigned long k_hashes) :
storage(m_bits),
m_bits(m_bits),
k_hashes(k_hashes) {}
void insert(long element);
bool contains(long element);
void invert();
void encrypt_all(std::vector<ZZ> &ciphertexts, PublicKey &public_key);
static unsigned long hash(long input, long seed);
private:
std::vector<bool> storage; // TODO: Make private
unsigned long m_bits;
unsigned long k_hashes;
};
#endif //BLOOM_FILTER_H