Changeset View
Changeset View
Standalone View
Standalone View
src/test/data/script_tests.json
Show First 20 Lines • Show All 670 Lines • ▼ Show 20 Lines | |||||
["0 0x02 0x0000 0 1", "CHECKMULTISIG DROP 1", "", "OK"], | ["0 0x02 0x0000 0 1", "CHECKMULTISIG DROP 1", "", "OK"], | ||||
["0 0 0x02 0x0000", "CHECKMULTISIGVERIFY 1", "", "OK"], | ["0 0 0x02 0x0000", "CHECKMULTISIGVERIFY 1", "", "OK"], | ||||
["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", "", "OK"], | ["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", "", "OK"], | ||||
["While not really correctly DER encoded, the empty signature is allowed by"], | ["While not really correctly DER encoded, the empty signature is allowed by"], | ||||
["STRICTENC to provide a compact way to provide a delibrately invalid signature."], | ["STRICTENC to provide a compact way to provide a delibrately invalid signature."], | ||||
["0", "0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIG NOT", "STRICTENC", "OK"], | ["0", "0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIG NOT", "STRICTENC", "OK"], | ||||
["0 0", "1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIG NOT", "STRICTENC", "OK"], | ["0 0", "1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIG NOT", "STRICTENC", "OK"], | ||||
["0", "0x02 0xBEEF CHECKSIG NOT", "STRICTENC", "PUBKEYTYPE", "Even with a null signature, the public key has to be correctly encoded."], | |||||
["0 0", "1 0x02 0xBEEF 1 CHECKMULTISIG NOT", "STRICTENC", "PUBKEYTYPE"], | |||||
["0", "0x21 0x020000000000000000000000000000000000000000000000000000000000000000 CHECKSIG NOT", "STRICTENC", "OK", "Invalid public keys are fine, as long as correctly encoded."], | |||||
["0 0", "1 0x21 0x020000000000000000000000000000000000000000000000000000000000000000 1 CHECKMULTISIG NOT", "STRICTENC", "OK"], | |||||
["Introducing NULLFAIL doesn't change any of the above behaviour since signature is null"], | |||||
["0", "0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIG NOT", "STRICTENC,NULLFAIL", "OK"], | |||||
["0 0", "1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIG NOT", "STRICTENC,NULLFAIL", "OK"], | |||||
["0", "0x02 0xBEEF CHECKSIG NOT", "STRICTENC,NULLFAIL", "PUBKEYTYPE"], | |||||
["0 0", "1 0x02 0xBEEF 1 CHECKMULTISIG NOT", "STRICTENC,NULLFAIL", "PUBKEYTYPE"], | |||||
["0", "0x21 0x020000000000000000000000000000000000000000000000000000000000000000 CHECKSIG NOT", "STRICTENC,NULLFAIL", "OK"], | |||||
["0 0", "1 0x21 0x020000000000000000000000000000000000000000000000000000000000000000 1 CHECKMULTISIG NOT", "STRICTENC,NULLFAIL", "OK"], | |||||
["CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and"], | ["CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and"], | ||||
["pubkeys in a specific order, and will exit early if the number of signatures"], | ["pubkeys in a specific order, and will exit early if the number of signatures"], | ||||
["left to check is greater than the number of keys left. As STRICTENC fails the"], | ["left to check is greater than the number of keys left. As STRICTENC fails the"], | ||||
["script when it reaches an invalidly encoded signature or pubkey, we can use it"], | ["script when it reaches an invalidly encoded signature or pubkey, we can use it"], | ||||
["to test the exact order in which signatures and pubkeys are evaluated by"], | ["to test the exact order in which signatures and pubkeys are evaluated by"], | ||||
["distinguishing CHECKMULTISIG returning false on the stack and the script as a"], | ["distinguishing CHECKMULTISIG returning false on the stack and the script as a"], | ||||
["whole failing."], | ["whole failing."], | ||||
Show All 26 Lines | |||||
], | ], | ||||
[ | [ | ||||
"0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f", | "0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f", | ||||
"2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG", | "2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG", | ||||
"P2SH,STRICTENC", | "P2SH,STRICTENC", | ||||
"SIG_DER", | "SIG_DER", | ||||
"2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs" | "2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs" | ||||
], | ], | ||||
["STRICTENC+NULLFAIL ordering tests with null signatures"], | |||||
[ | |||||
"0 0 0", | |||||
"2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", | |||||
"P2SH,STRICTENC,NULLFAIL", | |||||
"OK", | |||||
"Nulled 2-of-2 with valid pubkeys" | |||||
], | |||||
[ | |||||
"0 0 0", | |||||
"2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x02 0xBEEF 2 CHECKMULTISIG NOT", | |||||
"P2SH,STRICTENC,NULLFAIL", | |||||
"PUBKEYTYPE", | |||||
"Nulled 2-of-2 with top pubkey invalidly encoded" | |||||
], | |||||
[ | |||||
"0 0 0", | |||||
"2 0x02 0xBEEF 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", | |||||
"P2SH,STRICTENC,NULLFAIL", | |||||
"OK", | |||||
"Nulled 2-of-2 with top pubkey validly encoded, but another pubkey is invalidly encoded" | |||||
], | |||||
["Increase test coverage for DERSIG"], | ["Increase test coverage for DERSIG"], | ||||
["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0 CHECKSIG NOT", "", "OK", "Overly long signature is correctly encoded"], | ["0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0 CHECKSIG NOT", "", "OK", "Overly long signature is correctly encoded"], | ||||
["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000", "0 CHECKSIG NOT", "", "OK", "Missing S is correctly encoded"], | ["0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000", "0 CHECKSIG NOT", "", "OK", "Missing S is correctly encoded"], | ||||
["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "S with invalid S length is correctly encoded"], | ["0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "S with invalid S length is correctly encoded"], | ||||
["0x27 0x302403107777777777777777777777777777777702107777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "Non-integer R is correctly encoded"], | ["0x27 0x302403107777777777777777777777777777777702107777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "Non-integer R is correctly encoded"], | ||||
["0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "Non-integer S is correctly encoded"], | ["0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "Non-integer S is correctly encoded"], | ||||
["0x17 0x3014020002107777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "Zero-length R is correctly encoded"], | ["0x17 0x3014020002107777777777777777777777777777777701", "0 CHECKSIG NOT", "", "OK", "Zero-length R is correctly encoded"], | ||||
▲ Show 20 Lines • Show All 2,228 Lines • Show Last 20 Lines |