1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-06-30 12:42:43 +00:00

Merge pull request #138 from harding/bip66-number-examples

BIP66: Number Examples To Match Implementation Tests
This commit is contained in:
Wladimir J. van der Laan 2015-03-11 14:17:59 +00:00
commit 50b1e356ca

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. 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</code> fails (<b>changed</b>)
* <code>S1' P1 CHECKSIG NOT</code> fails (unchanged) # <code>S1' P1 CHECKSIG NOT</code> fails (unchanged)
* <code>F P1 CHECKSIG</code> fails (unchanged) # <code>F P1 CHECKSIG</code> fails (unchanged)
* <code>F P1 CHECKSIG NOT</code> can succeed (unchanged) # <code>F P1 CHECKSIG NOT</code> can succeed (unchanged)
* <code>F' P1 CHECKSIG</code> fails (unchanged) # <code>F' P1 CHECKSIG</code> fails (unchanged)
* <code>F' P1 CHECKSIG NOT</code> fails (<b>changed</b>) # <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</code> fails (<b>changed</b>)
* <code>0 S1' S2 2 P1 P2 2 CHECKMULTISIG NOT</code> fails (unchanged) # <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</code> fails (unchanged)
* <code>0 F S2' 2 P1 P2 2 CHECKMULTISIG NOT</code> fails (<b>changed</b>) # <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</code> fails (unchanged)
* <code>0 S1' F 2 P1 P2 2 CHECKMULTISIG NOT</code> can succeed (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. Note that the examples above show that only additional failures are required by this change, as required for a soft forking change.