Bitcoin Core  27.99.0
P2P Digital Currency
Macros | Functions
siphash.cpp File Reference
#include <crypto/siphash.h>
#include <bit>
Include dependency graph for siphash.cpp:

Go to the source code of this file.

Macros

#define SIPROUND
 

Functions

uint64_t SipHashUint256 (uint64_t k0, uint64_t k1, const uint256 &val)
 Optimized SipHash-2-4 implementation for uint256. More...
 
uint64_t SipHashUint256Extra (uint64_t k0, uint64_t k1, const uint256 &val, uint32_t extra)
 

Macro Definition Documentation

◆ SIPROUND

#define SIPROUND
Value:
do { \
v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
v0 = std::rotl(v0, 32); \
v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
v2 = std::rotl(v2, 32); \
} while (0)
static SECP256K1_INLINE uint64_t rotl(const uint64_t x, int k)
Definition: testrand_impl.h:39

Definition at line 9 of file siphash.cpp.

Function Documentation

◆ SipHashUint256()

uint64_t SipHashUint256 ( uint64_t  k0,
uint64_t  k1,
const uint256 val 
)

Optimized SipHash-2-4 implementation for uint256.

It is identical to: SipHasher(k0, k1) .Write(val.GetUint64(0)) .Write(val.GetUint64(1)) .Write(val.GetUint64(2)) .Write(val.GetUint64(3)) .Finalize()

Definition at line 95 of file siphash.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SipHashUint256Extra()

uint64_t SipHashUint256Extra ( uint64_t  k0,
uint64_t  k1,
const uint256 val,
uint32_t  extra 
)

Definition at line 135 of file siphash.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: