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: 2026-01-13 04:20:53 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                 :        2284 : SaltedUint256Hasher::SaltedUint256Hasher() : m_hasher{
      11                 :        1142 :     FastRandomContext().rand64(),
      12                 :        2284 :     FastRandomContext().rand64()}
      13                 :        1142 : {}
      14                 :             : 
      15                 :     8643132 : SaltedTxidHasher::SaltedTxidHasher() : m_hasher{
      16                 :     4321566 :     FastRandomContext().rand64(),
      17                 :     8643132 :     FastRandomContext().rand64()}
      18                 :     4321566 : {}
      19                 :             : 
      20                 :     5518648 : SaltedWtxidHasher::SaltedWtxidHasher() : m_hasher{
      21                 :     2759324 :     FastRandomContext().rand64(),
      22                 :     5518648 :     FastRandomContext().rand64()}
      23                 :     2759324 : {}
      24                 :             : 
      25         [ +  + ]:     9414640 : SaltedOutpointHasher::SaltedOutpointHasher(bool deterministic) : m_hasher{
      26         [ +  + ]:    26138784 :     deterministic ? 0x8e819f2607a18de6 : FastRandomContext().rand64(),
      27         [ +  + ]:    17776712 :     deterministic ? 0xf4020d2e3983b0eb : FastRandomContext().rand64()}
      28                 :     9414640 : {}
      29                 :             : 
      30                 :       37821 : SaltedSipHasher::SaltedSipHasher() :
      31                 :       37821 :     m_k0{FastRandomContext().rand64()},
      32                 :       37821 :     m_k1{FastRandomContext().rand64()}
      33                 :       37821 : {}
      34                 :             : 
      35                 :      398467 : size_t SaltedSipHasher::operator()(const std::span<const unsigned char>& script) const
      36                 :             : {
      37                 :      398467 :     return CSipHasher(m_k0, m_k1).Write(script).Finalize();
      38                 :             : }
        

Generated by: LCOV version 2.0-1