Open AmritKumar opened 10 years ago
My guess is you're trying to do something similar to what is outlined here? – https://www.uni-due.de/~hq0215/documents/Draft_Ottawa_Bloom.pdf
A couple of things are sticking out to me immediately:
What do you think?
Basically, one would wish to use hmac instead of hash function in a scenario where only specific entities have the right to insert elements in the filter or check for belonging in it. To this end, the entities may share a common secret key and generate hmac for each item. Similarly checking for belonging would require ownership of the key. Such a filter may prevent Denial-of-service attacks against certain services.
Indeed, a more cleaner code would be to create a subclass HMACBloomFilter which would have an attribute key.
Provides an HMAC extension to the existing implementation. The filters now also have the possibility to use keyed hash functions.