Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251break;252} else if (src < sim.size() && aux < sim.size() && command-- == 0) {253/* IsSupersetOf() and IsSubsetOf() */254bool is_superset = (sim[aux] & ~sim[src]).none();255bool is_subset = (sim[src] & ~sim[aux]).none();256assert(real[src].IsSupersetOf(real[aux]) == is_superset);257assert(real[src].IsSubsetOf(real[aux]) == is_subset);258assert(real[aux].IsSupersetOf(real[src]) == is_subset);259assert(real[aux].IsSubsetOf(real[src]) == is_superset);260break;261} else if (src < sim.size() && aux < sim.size() && command-- == 0) {262/* operator== and operator!= */263assert((sim[src] == sim[aux]) == (real[src] == real[aux]));264assert((sim[src] != sim[aux]) == (real[src] != real[aux]));265break;266} else if (src < sim.size() && aux < sim.size() && command-- == 0) {267/* Overlaps() */268assert((sim[src] & sim[aux]).any() == real[src].Overlaps(real[aux]));269assert((sim[src] & sim[aux]).any() == real[aux].Overlaps(real[src]));270break;271}272}273}274/* Fully compare the final state. */275for (unsigned i = 0; i < sim.size(); ++i) {276compare_fn(i);277}278}280} // namespace282FUZZ_TARGET(bitset)283{284unsigned typdat = ReadByte(buffer) % 8;285if (typdat == 0) {286/* 16 bits */287TestType<bitset_detail::IntBitSet<uint16_t>>(buffer);288TestType<bitset_detail::MultiIntBitSet<uint16_t, 1>>(buffer);289} else if (typdat == 1) {290/* 32 bits */291TestType<bitset_detail::MultiIntBitSet<uint16_t, 2>>(buffer);292TestType<bitset_detail::IntBitSet<uint32_t>>(buffer);293} else if (typdat == 2) {294/* 48 bits */295TestType<bitset_detail::MultiIntBitSet<uint16_t, 3>>(buffer);296} else if (typdat == 3) {297/* 64 bits */298TestType<bitset_detail::IntBitSet<uint64_t>>(buffer);299TestType<bitset_detail::MultiIntBitSet<uint64_t, 1>>(buffer);300TestType<bitset_detail::MultiIntBitSet<uint32_t, 2>>(buffer);301TestType<bitset_detail::MultiIntBitSet<uint16_t, 4>>(buffer);302} else if (typdat == 4) {303/* 96 bits */304TestType<bitset_detail::MultiIntBitSet<uint32_t, 3>>(buffer);305} else if (typdat == 5) {306/* 128 bits */307TestType<bitset_detail::MultiIntBitSet<uint64_t, 2>>(buffer);308TestType<bitset_detail::MultiIntBitSet<uint32_t, 4>>(buffer);309} else if (typdat == 6) {310/* 192 bits */311TestType<bitset_detail::MultiIntBitSet<uint64_t, 3>>(buffer);312} else if (typdat == 7) {313/* 256 bits */314TestType<bitset_detail::MultiIntBitSet<uint64_t, 4>>(buffer);315}316}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.