aboutsummaryrefslogtreecommitdiff
path: root/src/script
AgeCommit message (Collapse)Author
2015-03-21Abstract out Ctransaction-specific signing into TransactionSignatureCreatorPieter Wuille
2015-03-06src/script/script.h: endian compatibility for PUSHDATA sizesWladimir J. van der Laan
2015-02-03Merge pull request #5286Wladimir J. van der Laan
44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon) a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
2015-02-03Merge pull request #5713Wladimir J. van der Laan
bf6cdeb Increase coverage of DERSIG edge cases (Pieter Wuille) 819bcf9 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille) 5a47811 BIP66 changeover logic (Pieter Wuille) 092e9fe Example unit tests from BIP66 (Pieter Wuille) 80ad135 Change IsDERSignature to BIP66 implementation (Pieter Wuille)
2015-02-02Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille
2015-02-02Use separate SignatureChecker for CMutableTransactionPieter Wuille
2015-02-01BIP66 changeover logicPieter Wuille
2015-02-01Change IsDERSignature to BIP66 implementationPieter Wuille
2015-01-31Remove whitespaces before double colon in errors and logsPavel Janík
2015-01-09Make empty byte arrays pass CheckSignatureEncoding()Peter Todd
Makes it possible to compactly provide a delibrately invalid signature for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid signatures need to be provided in the scriptSig; prior to this change those invalid signatures would need to be large DER-encoded signatures. Note that we may want to further expand on this change in the future by saying that only OP_0 is a "valid" invalid signature; BIP19 even with this change is inherently malleable as the invalid signatures can be any validly encoded DER signature.
2015-01-08Merge pull request #5143Wladimir J. van der Laan
da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille) b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille) ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
2015-01-05String conversions uint256 -> uint256SWladimir J. van der Laan
If uint256() constructor takes a string, uint256(0) will become dangerous when uint256 does not take integers anymore (it will go through std::string(const char*) making a NULL string, and the explicit keyword is no help).
2015-01-05Replace uint256(1) with static constantWladimir J. van der Laan
SignatureHash and its test function SignatureHashOld return uint256(1) as a special error signaling value. Return a local static constant with the same value instead.
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2014-12-25Fix CScriptID(const CScript& in) in empty script casePeter Todd
Previously an empty script wouldn't be hashed, and CScriptID would be assigned the incorrect value of 0 instead. This bug can be seen in the RPC decodescript command: $ btc decodescript "" { "asm" : "", "type" : "nonstandard", "p2sh" : "31h1vYVSYuKP6AhS86fbRdMw9XHieotbST" } Correct output: $ btc decodescript "" { "asm" : "", "type" : "nonstandard", "p2sh" : "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy" }
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-17make all catch() arguments constPhilip Kaufmann
- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
2014-12-05Normalize header guard of script_error.hPavel Janík
2014-12-03MOVEONLY: core/ -> primitives/Luke Dashjr
2014-12-01Merge pull request #5227Wladimir J. van der Laan
4cdaa95 Resize after succesful result (Pieter Wuille) 9d8604f Header define style cleanups (Pieter Wuille) a53fd41 Deterministic signing (Pieter Wuille) 3060e36 Add the RFC6979 PRNG (Pieter Wuille) a8f5087 Add HMAC-SHA256 (Pieter Wuille) 36fa4a7 Split up crypto/sha2 (Pieter Wuille)
2014-11-25Make SCRIPT_VERIFY_CLEANSTACK a standardness requirementPieter Wuille
2014-11-25Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6)Pieter Wuille
Based on an earlier patch by Peter Todd, though the rules here are different (P2SH scripts should not have a CLEANSTACK check before the P2SH evaluation).
2014-11-25No semantic change: reuse stack variable in P2SH evaluationPieter Wuille
2014-11-24libbitcoinconsensus: don't require any global constructorsCory Fields
These static objects are only used in once place, so declare them there instead.
2014-11-20Split up crypto/sha2Pieter Wuille
2014-11-20Test the exact order of CHECKMULTISIG sig/pubkey evaluationPeter Todd
Possible with STRICTENC
2014-11-20Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille
This turns STRICTENC turn into a softforking-safe change (even though it is not intended as a consensus rule), and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool.
2014-11-20Merge pull request #5000Pieter Wuille
0391423 Discourage NOPs reserved for soft-fork upgrades (Peter Todd)
2014-11-19build: add libbitcoinconsensus files and hook up the lib buildCory Fields
Credit BlueMatt for libbitcoinsonsensus.h/cpp
2014-11-17Discourage NOPs reserved for soft-fork upgradesPeter Todd
NOP1 to NOP10 are reserved for future soft-fork upgrades. In the event of an upgrade such NOPs have *VERIFY behavior, meaning that if their arguments are not correct the script fails. Discouraging these NOPs by rejecting transactions containing them from the mempool ensures that we'll never accept transactions, nor mine blocks, with scripts that are now invalid according to the majority of hashing power even if we're not yet upgraded. Previously this wasn't an issue as the IsStandard() rules didn't allow upgradable NOPs anyway, but 7f3b4e95 relaxed the IsStandard() rules for P2SH redemptions allowing any redeemScript to be spent. We *do* allow upgradable NOPs in scripts so long as they are not executed. This is harmless as there is no opportunity for the script to be invalid post-upgrade.
2014-11-14script: create sane error return codes for script validation and remove loggingCory Fields
Attempt to codify the possible error statuses associated with script validation. script/types.h has been created with the expectation that it will be part of the public lib interface. The other flag enums will be moved here in a future commit. Logging has also been removed in order to drop the dependency on core.h. It can be re-added to bitcoind as-needed. This makes script verification finally free of application state and boost!
2014-11-14Change the default maximum OP_RETURN size to 80 bytesFlavien Charlon
The value can be changed through the '-datacarriersize' option, this is modifying the default value for that option.
2014-11-10Make comments in /src/script doxygen compatibleMichael Ford
2014-11-04Avoid a bunch of copying/conversion in script/signPieter Wuille
2014-11-04minor code style cleanup after recent mergesPhilip Kaufmann
- add a missing license header - correct some header orderings etc.
2014-11-04Merge pull request #5196Wladimir J. van der Laan
8473862 Fix all header defines (Pavel Janík)
2014-11-04Merge pull request #5162Wladimir J. van der Laan
d2e74c5 boost: moveonly: split CPubKey and friends to new files (Cory Fields) 78c228c boost: moveonly: move BIP32Hash to hash.h (Cory Fields) 900078a boost: moveonly: create eccryptoverify.h|cpp and move helper functions there (Cory Fields)
2014-11-03Fix all header definesPavel Janík
2014-10-31Merge pull request #5077Wladimir J. van der Laan
2aa6329 Enable customising node policy for datacarrier data size with a -datacarriersize option (Luke Dashjr)
2014-10-31boost: moveonly: split CPubKey and friends to new filesCory Fields
2014-10-31boost: moveonly: create eccryptoverify.h|cpp and move helper functions thereCory Fields
Eventually (after 0.10) these files will hold the logic for crypto verification routines, and CKey/CPubKey will call into them.
2014-10-28Merge pull request #5100Pieter Wuille
99f41b9 MOVEONLY: core.o -> core/block.o (jtimon) 561e9e9 MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (from core) with it (jtimon) 999a2ab MOVEONLY: separate CTxUndo out of core (jtimon) 4a3587d MOVEONLY: Separate CTransaction and dependencies from core (jtimon) eda3733 MOVEONLY: Move CFeeRate and Amount constants to amount.o (jtimon)
2014-10-27MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (fromjtimon
core) with it
2014-10-27MOVEONLY: Separate CTransaction and dependencies from corejtimon
2014-10-27Enable customising node policy for datacarrier data size with a ↵Luke Dashjr
-datacarriersize option
2014-10-25Improve CScriptNum() commentPeter Todd
Edited-by: Pieter Wuille <pieter.wuille@gmail.com>
2014-10-25Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille
Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
2014-10-25Add SCRIPT_VERIFY_SIGPUSHONLY (BIP62 rule 2)Pieter Wuille
2014-10-23fix build with libc++ after 85c579eCory Fields
2014-10-17script: add a slew of includes all around and drop includes from script.hCory Fields
Lots of files ended up with indirect includes from script.h.