mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Implement Streaming SHA256 opcodes
Co-authored-by: roconnor-blockstream <roconnor@blockstream.com>
This commit is contained in:
parent
0b8174b1fe
commit
2df8e99813
8 changed files with 149 additions and 6 deletions
|
|
@ -147,6 +147,10 @@ std::string GetOpName(opcodetype opcode)
|
|||
// Opcode added by BIP 342 (Tapscript)
|
||||
case OP_CHECKSIGADD : return "OP_CHECKSIGADD";
|
||||
|
||||
// Elements Tapscript opcodes
|
||||
case OP_SHA256INITIALIZE : return "OP_SHA256INITIALIZE";
|
||||
case OP_SHA256UPDATE : return "OP_SHA256UPDATE";
|
||||
case OP_SHA256FINALIZE : return "OP_SHA256FINALIZE";
|
||||
case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE";
|
||||
|
||||
default:
|
||||
|
|
@ -415,6 +419,7 @@ bool IsOpSuccess(const opcodetype& opcode)
|
|||
return opcode == 80 || opcode == 98 || (opcode >= 137 && opcode <= 138) ||
|
||||
// ELEMENTS: Don't mark OP_INVERT , OP_AND, OP_OR, OP_XOR. OP_LSHIFT, OP_RSHIFT as success
|
||||
(opcode >= 141 && opcode <= 142) || (opcode >= 149 && opcode <= 151) ||
|
||||
// ELEMENTS: Exclude OP_DETERMINISTICRANDOM, OP_CHECKSIGFROMSTACK(VERIFY), OP_SUBSTRLAZY
|
||||
(opcode >= 187 && opcode <= 191) || (opcode >= 196 && opcode <= 254);
|
||||
// ELEMENTS: Exclude OP_DETERMINISTICRANDOM(192), OP_CHECKSIGFROMSTACK(VERIFY)(192-193), OP_SUBSTRLAZY(195)
|
||||
// ELEMENTS: Tapscript extension from OP_SHA256INITIALIZE(196) till OP_TWEAKVERIFY(228)
|
||||
(opcode >= 187 && opcode <= 191) || (opcode >= 229 && opcode <= 254);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue