Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

SipHash-2-4. More...

#include <hash.h>

Public Member Functions

 CSipHasher (uint64_t k0, uint64_t k1)
 Construct a SipHash calculator initialized with 128-bit key (k0, k1) More...
 
CSipHasherWrite (uint64_t data)
 Hash a 64-bit integer worth of data It is treated as if this was the little-endian interpretation of 8 bytes. More...
 
CSipHasherWrite (const unsigned char *data, size_t size)
 Hash arbitrary bytes. More...
 
uint64_t Finalize () const
 Compute the 64-bit SipHash-2-4 of the data written so far. More...
 

Private Attributes

uint64_t v [4]
 
uint64_t tmp
 
int count
 

Detailed Description

SipHash-2-4.

Definition at line 266 of file hash.h.

Constructor & Destructor Documentation

◆ CSipHasher()

CSipHasher::CSipHasher ( uint64_t  k0,
uint64_t  k1 
)

Construct a SipHash calculator initialized with 128-bit key (k0, k1)

Definition at line 92 of file hash.cpp.

References count, k1, tmp, and v.

Member Function Documentation

◆ Finalize()

uint64_t CSipHasher::Finalize ( ) const

Compute the 64-bit SipHash-2-4 of the data written so far.

The object remains untouched.

Definition at line 150 of file hash.cpp.

References count, SIPROUND, tmp, and v.

Referenced by CConnman::AcceptConnection(), and CConnman::ConnectNode().

◆ Write() [1/2]

CSipHasher & CSipHasher::Write ( uint64_t  data)

Hash a 64-bit integer worth of data It is treated as if this was the little-endian interpretation of 8 bytes.

This function can only be used when a multiple of 8 bytes have been written so far.

Definition at line 102 of file hash.cpp.

References count, SIPROUND, and v.

Referenced by CConnman::AcceptConnection(), CConnman::CalculateKeyedNetGroup(), CConnman::ConnectNode(), CConnman::GetDeterministicRandomizer(), and RelayAddress().

◆ Write() [2/2]

CSipHasher & CSipHasher::Write ( const unsigned char *  data,
size_t  size 
)

Hash arbitrary bytes.

Definition at line 122 of file hash.cpp.

References count, SIPROUND, tmp, and v.

Member Data Documentation

◆ count

int CSipHasher::count
private

Definition at line 271 of file hash.h.

Referenced by CSipHasher(), Finalize(), and Write().

◆ tmp

uint64_t CSipHasher::tmp
private

Definition at line 270 of file hash.h.

Referenced by CSipHasher(), Finalize(), and Write().

◆ v

uint64_t CSipHasher::v[4]
private

Definition at line 269 of file hash.h.

Referenced by CSipHasher(), Finalize(), and Write().


The documentation for this class was generated from the following files:
Released under the MIT license