1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-01-18 13:26:08 +01:00

BIP66: Number Examples To Match Implementation Tests

The Bitcoin Core tests in script_tests.cpp refer to these examples by
number, but these BIP66 examples are in an unordered list, making them
hard to follow.  This changes the list to an ordered list.
This commit is contained in:
David A. Harding 2015-01-30 09:45:55 -05:00
parent f9ba813c7b
commit 6c3ea6735a
No known key found for this signature in database
GPG Key ID: 4B29C30FF29EC4B7

View File

@ -102,19 +102,19 @@ bool static IsValidSignatureEncoding(const std::vector<unsigned char> &sig) {
Notation: P1 and P2 are valid, serialized, public keys. S1 and S2 are valid signatures using respective keys P1 and P2. S1' and S2' are non-DER but otherwise valid signatures using those same keys. F is any invalid but DER-compliant signature (including 0, the empty string). F' is any invalid and non-DER-compliant signature.
* <code>S1' P1 CHECKSIG</code> fails (<b>changed</b>)
* <code>S1' P1 CHECKSIG NOT</code> fails (unchanged)
* <code>F P1 CHECKSIG</code> fails (unchanged)
* <code>F P1 CHECKSIG NOT</code> can succeed (unchanged)
* <code>F' P1 CHECKSIG</code> fails (unchanged)
* <code>F' P1 CHECKSIG NOT</code> fails (<b>changed</b>)
# <code>S1' P1 CHECKSIG</code> fails (<b>changed</b>)
# <code>S1' P1 CHECKSIG NOT</code> fails (unchanged)
# <code>F P1 CHECKSIG</code> fails (unchanged)
# <code>F P1 CHECKSIG NOT</code> can succeed (unchanged)
# <code>F' P1 CHECKSIG</code> fails (unchanged)
# <code>F' P1 CHECKSIG NOT</code> fails (<b>changed</b>)
* <code>0 S1' S2 2 P1 P2 2 CHECKMULTISIG</code> fails (<b>changed</b>)
* <code>0 S1' S2 2 P1 P2 2 CHECKMULTISIG NOT</code> fails (unchanged)
* <code>0 F S2' 2 P1 P2 2 CHECKMULTISIG</code> fails (unchanged)
* <code>0 F S2' 2 P1 P2 2 CHECKMULTISIG NOT</code> fails (<b>changed</b>)
* <code>0 S1' F 2 P1 P2 2 CHECKMULTISIG</code> fails (unchanged)
* <code>0 S1' F 2 P1 P2 2 CHECKMULTISIG NOT</code> can succeed (unchanged)
# <code>0 S1' S2 2 P1 P2 2 CHECKMULTISIG</code> fails (<b>changed</b>)
# <code>0 S1' S2 2 P1 P2 2 CHECKMULTISIG NOT</code> fails (unchanged)
# <code>0 F S2' 2 P1 P2 2 CHECKMULTISIG</code> fails (unchanged)
# <code>0 F S2' 2 P1 P2 2 CHECKMULTISIG NOT</code> fails (<b>changed</b>)
# <code>0 S1' F 2 P1 P2 2 CHECKMULTISIG</code> fails (unchanged)
# <code>0 S1' F 2 P1 P2 2 CHECKMULTISIG NOT</code> can succeed (unchanged)
Note that the examples above show that only additional failures are required by this change, as required for a soft forking change.