LCOV - code coverage report
Current view: top level - src/util - hasher.cpp (source / functions) Coverage Total Hit
Test: fuzz_coverage.info Lines: 100.0 % 12 12
Test Date: 2024-09-01 05:20:30 Functions: 100.0 % 4 4
Branches: 100.0 % 12 12

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2019-2022 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                 :      610763 : SaltedTxidHasher::SaltedTxidHasher() :
      11                 :      610763 :     k0{FastRandomContext().rand64()},
      12                 :      610763 :     k1{FastRandomContext().rand64()} {}
      13                 :             : 
      14                 :     4755693 : SaltedOutpointHasher::SaltedOutpointHasher(bool deterministic) :
      15   [ +  +  +  +  :     4755693 :     k0{deterministic ? 0x8e819f2607a18de6 : FastRandomContext().rand64()},
                   +  + ]
      16   [ +  +  +  +  :     4755693 :     k1{deterministic ? 0xf4020d2e3983b0eb : FastRandomContext().rand64()}
                   +  + ]
      17                 :     4755693 : {}
      18                 :             : 
      19                 :       26056 : SaltedSipHasher::SaltedSipHasher() :
      20                 :       26056 :     m_k0{FastRandomContext().rand64()},
      21                 :       26056 :     m_k1{FastRandomContext().rand64()} {}
      22                 :             : 
      23                 :    21564205 : size_t SaltedSipHasher::operator()(const Span<const unsigned char>& script) const
      24                 :             : {
      25                 :    21564205 :     return CSipHasher(m_k0, m_k1).Write(script).Finalize();
      26                 :             : }
        

Generated by: LCOV version 2.0-1