LCOV - code coverage report
Current view: top level - src/util - hasher.cpp (source / functions) Coverage Total Hit
Test: fuzz_coverage.info Lines: 100.0 % 22 22
Test Date: 2025-12-13 04:17:47 Functions: 100.0 % 6 6
Branches: 100.0 % 6 6

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2019-present The Bitcoin Core 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                 :             : #include <crypto/siphash.h>
       6                 :             : #include <random.h>
       7                 :             : #include <span.h>
       8                 :             : #include <util/hasher.h>
       9                 :             : 
      10                 :        1978 : SaltedUint256Hasher::SaltedUint256Hasher() : m_hasher{
      11                 :         989 :     FastRandomContext().rand64(),
      12                 :        1978 :     FastRandomContext().rand64()}
      13                 :         989 : {}
      14                 :             : 
      15                 :     6167360 : SaltedTxidHasher::SaltedTxidHasher() : m_hasher{
      16                 :     3083680 :     FastRandomContext().rand64(),
      17                 :     6167360 :     FastRandomContext().rand64()}
      18                 :     3083680 : {}
      19                 :             : 
      20                 :     3696764 : SaltedWtxidHasher::SaltedWtxidHasher() : m_hasher{
      21                 :     1848382 :     FastRandomContext().rand64(),
      22                 :     3696764 :     FastRandomContext().rand64()}
      23                 :     1848382 : {}
      24                 :             : 
      25         [ +  + ]:     6951175 : SaltedOutpointHasher::SaltedOutpointHasher(bool deterministic) : m_hasher{
      26         [ +  + ]:    20254151 :     deterministic ? 0x8e819f2607a18de6 : FastRandomContext().rand64(),
      27         [ +  + ]:    13602663 :     deterministic ? 0xf4020d2e3983b0eb : FastRandomContext().rand64()}
      28                 :     6951175 : {}
      29                 :             : 
      30                 :       31312 : SaltedSipHasher::SaltedSipHasher() :
      31                 :       31312 :     m_k0{FastRandomContext().rand64()},
      32                 :       31312 :     m_k1{FastRandomContext().rand64()}
      33                 :       31312 : {}
      34                 :             : 
      35                 :      339469 : size_t SaltedSipHasher::operator()(const std::span<const unsigned char>& script) const
      36                 :             : {
      37                 :      339469 :     return CSipHasher(m_k0, m_k1).Write(script).Finalize();
      38                 :             : }
        

Generated by: LCOV version 2.0-1