HomePhabricator

Make CRollingBloomFilter set nTweak for you
d2d7ee0e863bUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Make CRollingBloomFilter set nTweak for you

While CBloomFilter is usually used with an explicitly set nTweak,
CRollingBloomFilter is only used internally. Requiring every caller to
set nTweak is error-prone and redundant; better to have the class handle
that for you with a high-quality randomness source.

Additionally when clearing the filter it makes sense to change nTweak as
well to recover from a bad setting, e.g. due to insufficient randomness
at initialization, so the clear() method is replaced by a reset() method
that sets a new, random, nTweak value.

Details

Provenance
Peter Todd <pete@petertodd.org>Authored on Jul 19 2015, 19:43
Pieter Wuille <pieter.wuille@gmail.com>Committed on Jul 27 2015, 16:38
deadalnixPushed on May 14 2017, 22:04
Parents
rABCa3d65fedaa18: Reuse vector hashing code for uint256
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieter.wuille@gmail.com> committed rABCd2d7ee0e863b: Make CRollingBloomFilter set nTweak for you (authored by Peter Todd <pete@petertodd.org>).Jul 27 2015, 16:38