File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 10
10
SaltedTxidHasher::SaltedTxidHasher () : k0(GetRand(std::numeric_limits<uint64_t >::max())), k1(GetRand(std::numeric_limits<uint64_t >::max())) {}
11
11
12
12
SaltedOutpointHasher::SaltedOutpointHasher () : k0(GetRand(std::numeric_limits<uint64_t >::max())), k1(GetRand(std::numeric_limits<uint64_t >::max())) {}
13
+
14
+ SaltedSipHasher::SaltedSipHasher () : m_k0(GetRand(std::numeric_limits<uint64_t >::max())), m_k1(GetRand(std::numeric_limits<uint64_t >::max())) {}
15
+
16
+ size_t SaltedSipHasher::operator ()(const Span<const unsigned char >& script) const
17
+ {
18
+ return CSipHasher (m_k0, m_k1).Write (script.data (), script.size ()).Finalize ();
19
+ }
Original file line number Diff line number Diff line change @@ -84,4 +84,16 @@ struct BlockHasher
84
84
size_t operator ()(const uint256& hash) const { return ReadLE64 (hash.begin ()); }
85
85
};
86
86
87
+ class SaltedSipHasher
88
+ {
89
+ private:
90
+ /* * Salt */
91
+ const uint64_t m_k0, m_k1;
92
+
93
+ public:
94
+ SaltedSipHasher ();
95
+
96
+ size_t operator ()(const Span<const unsigned char >& script) const ;
97
+ };
98
+
87
99
#endif // BITCOIN_UTIL_HASHER_H
You can’t perform that action at this time.
0 commit comments