Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cryptography/conformance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hash = "c0501d4a691d1fccec7c5906e8608228569d24164150edd215838593e3b77512"

["commonware_cryptography::bloomfilter::tests::conformance::CodecConformance<BloomFilter>"]
n_cases = 65536
hash = "a75d6312366816126114abdc9d7fbd246891cab210eeae6a02781625aa1ad6a4"
hash = "b48e0f23d3f405f5b9306df0460e6301ecc3fe541a17a4a9d3013663fdf9b785"

["commonware_cryptography::bls12381::certificate::multisig::tests::conformance::CodecConformance<Certificate<MinSig>>"]
n_cases = 65536
Expand Down
4 changes: 3 additions & 1 deletion cryptography/src/bloomfilter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ impl EncodeSize for BloomFilter {
#[cfg(feature = "arbitrary")]
impl arbitrary::Arbitrary<'_> for BloomFilter {
fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
let hashers = u8::arbitrary(u)?;
// Ensure at least 1 hasher to avoid empty iterator in indices(),
// which would cause contains() to always return true
let hashers = u8::arbitrary(u)?.max(1);
// Ensure at least 1 bit to avoid empty bitmap
let bits_len = u.arbitrary_len::<u64>()?.max(1);
let mut bits = BitMap::with_capacity(bits_len as u64);
Expand Down
Loading