LCOV - code coverage report
Current view: top level - src/script - sigcache.h (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 0 2 0.0 %
Date: 2023-11-10 23:46:46 Functions: 0 3 0.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // Copyright (c) 2009-2010 Satoshi Nakamoto
       2                 :            : // Copyright (c) 2009-2022 The Bitcoin Core developers
       3                 :            : // Distributed under the MIT software license, see the accompanying
       4                 :            : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       5                 :            : 
       6                 :            : #ifndef BITCOIN_SCRIPT_SIGCACHE_H
       7                 :            : #define BITCOIN_SCRIPT_SIGCACHE_H
       8                 :            : 
       9                 :            : #include <script/interpreter.h>
      10                 :            : #include <span.h>
      11                 :            : #include <util/hasher.h>
      12                 :            : 
      13                 :            : #include <optional>
      14                 :            : #include <vector>
      15                 :            : 
      16                 :            : // DoS prevention: limit cache size to 32MiB (over 1000000 entries on 64-bit
      17                 :            : // systems). Due to how we count cache size, actual memory usage is slightly
      18                 :            : // more (~32.25 MiB)
      19                 :            : static constexpr size_t DEFAULT_MAX_SIG_CACHE_BYTES{32 << 20};
      20                 :            : 
      21                 :            : class CPubKey;
      22                 :            : 
      23                 :          0 : class CachingTransactionSignatureChecker : public TransactionSignatureChecker
      24                 :            : {
      25                 :            : private:
      26                 :            :     bool store;
      27                 :            : 
      28                 :            : public:
      29                 :          0 :     CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn, MissingDataBehavior::ASSERT_FAIL), store(storeIn) {}
      30                 :            : 
      31                 :            :     bool VerifyECDSASignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const override;
      32                 :            :     bool VerifySchnorrSignature(Span<const unsigned char> sig, const XOnlyPubKey& pubkey, const uint256& sighash) const override;
      33                 :            : };
      34                 :            : 
      35                 :            : [[nodiscard]] bool InitSignatureCache(size_t max_size_bytes);
      36                 :            : 
      37                 :            : #endif // BITCOIN_SCRIPT_SIGCACHE_H

Generated by: LCOV version 1.14