Bitcoin ABC  0.24.7
P2P Digital Currency
salteduint256hasher.h
Go to the documentation of this file.
1 // Copyright (c) 2018-2019 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_SALTEDUINT256HASHER_H
6 #define BITCOIN_SALTEDUINT256HASHER_H
7 
8 #include <crypto/siphash.h>
9 #include <uint256.h>
10 
12 private:
14  const uint64_t k0, k1;
15 
16 public:
18 
19  size_t hash(const uint256 &h) const { return SipHashUint256(k0, k1, h); }
20  size_t operator()(const uint256 &h) const { return hash(h); }
21 };
22 
23 #endif // BITCOIN_SALTEDUINT256HASHER_H
SaltedUint256Hasher
Definition: salteduint256hasher.h:11
uint256.h
SaltedUint256Hasher::SaltedUint256Hasher
SaltedUint256Hasher()
Definition: salteduint256hasher.cpp:4
siphash.h
SipHashUint256
uint64_t SipHashUint256(uint64_t k0, uint64_t k1, const uint256 &val)
Optimized SipHash-2-4 implementation for uint256.
Definition: siphash.cpp:99
SaltedUint256Hasher::k1
const uint64_t k1
Definition: salteduint256hasher.h:14
uint256
256-bit opaque blob.
Definition: uint256.h:127
SaltedUint256Hasher::operator()
size_t operator()(const uint256 &h) const
Definition: salteduint256hasher.h:20
SaltedUint256Hasher::k0
const uint64_t k0
Salt.
Definition: salteduint256hasher.h:14
SaltedUint256Hasher::hash
size_t hash(const uint256 &h) const
Definition: salteduint256hasher.h:19