![]() |
Bitcoin Core 29.99.0
P2P Digital Currency
|
Data structure to cache SHA256 midstates for the ECDSA sighash calculations (bare, P2SH, P2WPKH, P2WSH). More...
#include <interpreter.h>
Public Member Functions | |
bool | Load (int32_t hash_type, const CScript &script_code, HashWriter &writer) const noexcept |
Load into writer the SHA256 midstate if found in this cache. More... | |
void | Store (int32_t hash_type, const CScript &script_code, const HashWriter &writer) noexcept |
Store into this cache object the provided SHA256 midstate. More... | |
Private Member Functions | |
int | CacheIndex (int32_t hash_type) const noexcept |
Given a hash_type, find which of the 6 cache entries is to be used. More... | |
Private Attributes | |
std::optional< std::pair< CScript, HashWriter > > | m_cache_entries [6] |
For each sighash mode (ALL, SINGLE, NONE, ALL|ANYONE, SINGLE|ANYONE, NONE|ANYONE), optionally store a scriptCode which the hash is for, plus a midstate for the SHA256 computation just before adding the hash_type itself. More... | |
Data structure to cache SHA256 midstates for the ECDSA sighash calculations (bare, P2SH, P2WPKH, P2WSH).
Definition at line 244 of file interpreter.h.
|
privatenoexcept |
Given a hash_type, find which of the 6 cache entries is to be used.
Definition at line 1567 of file interpreter.cpp.
|
noexcept |
Load into writer the SHA256 midstate if found in this cache.
Definition at line 1576 of file interpreter.cpp.
|
noexcept |
Store into this cache object the provided SHA256 midstate.
Definition at line 1588 of file interpreter.cpp.
|
private |
For each sighash mode (ALL, SINGLE, NONE, ALL|ANYONE, SINGLE|ANYONE, NONE|ANYONE), optionally store a scriptCode which the hash is for, plus a midstate for the SHA256 computation just before adding the hash_type itself.
Definition at line 249 of file interpreter.h.