Bitcoin ABC
0.22.13
P2P Digital Currency
src
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
11
class
SaltedUint256Hasher
{
12
private
:
14
const
uint64_t
k0
,
k1
;
15
16
public
:
17
SaltedUint256Hasher
();
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
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
Definition:
salteduint256hasher.h:11
siphash.h
SaltedUint256Hasher::operator()
size_t operator()(const uint256 &h) const
Definition:
salteduint256hasher.h:20
SaltedUint256Hasher::SaltedUint256Hasher
SaltedUint256Hasher()
Definition:
salteduint256hasher.cpp:4
SaltedUint256Hasher::k0
const uint64_t k0
Salt.
Definition:
salteduint256hasher.h:14
uint256
256-bit opaque blob.
Definition:
uint256.h:120
uint256.h
SaltedUint256Hasher::hash
size_t hash(const uint256 &h) const
Definition:
salteduint256hasher.h:19
SaltedUint256Hasher::k1
const uint64_t k1
Definition:
salteduint256hasher.h:14
Generated on Wed Jan 27 2021 17:36:25 for Bitcoin ABC by
1.8.13