mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-28 15:58:42 +02:00
refactor: use Span for SipHash::Write
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
This commit is contained in:
@@ -171,8 +171,8 @@ public:
|
||||
hasher.Write(a.source.GetNetwork());
|
||||
hasher.Write(addr_key.size());
|
||||
hasher.Write(source_key.size());
|
||||
hasher.Write(addr_key.data(), addr_key.size());
|
||||
hasher.Write(source_key.data(), source_key.size());
|
||||
hasher.Write(addr_key);
|
||||
hasher.Write(source_key);
|
||||
return (size_t)hasher.Finalize();
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ FUZZ_TARGET(crypto)
|
||||
(void)sha256.Write(data.data(), data.size());
|
||||
(void)sha3.Write(data);
|
||||
(void)sha512.Write(data.data(), data.size());
|
||||
(void)sip_hasher.Write(data.data(), data.size());
|
||||
(void)sip_hasher.Write(data);
|
||||
|
||||
(void)Hash(data);
|
||||
(void)Hash160(data);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace {
|
||||
uint64_t HashToRange(const std::vector<uint8_t>& element, const uint64_t f)
|
||||
{
|
||||
const uint64_t hash = CSipHasher(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL)
|
||||
.Write(element.data(), element.size())
|
||||
.Write(element)
|
||||
.Finalize();
|
||||
return FastRange64(hash, f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user