diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2015-02-09 15:28:35 -0500 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2015-02-10 13:23:57 -0500 |
commit | 6f50dbd2fdeef7bc24317a487936502e25a05de9 (patch) | |
tree | cffe21b53032fc9faa6f55b090cf2222c7a03857 /src/test/script_tests.cpp | |
parent | 1c4e3f99f05273e4d0fae7246d3afe5a33c52ee0 (diff) |
Fix NegateSignatureS to not duplicate last byte of S
NegateSignatureS is called with a signature without a hashtype, so
do not save the last byte and append it after S negation.
Updates the two tests which were affected by this bug.
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r-- | src/test/script_tests.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 6092afd782..35a7f6639a 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -107,7 +107,6 @@ void static NegateSignatureS(std::vector<unsigned char>& vchSig) { std::vector<unsigned char> r, s; r = std::vector<unsigned char>(vchSig.begin() + 4, vchSig.begin() + 4 + vchSig[3]); s = std::vector<unsigned char>(vchSig.begin() + 6 + vchSig[3], vchSig.begin() + 6 + vchSig[3] + vchSig[5 + vchSig[3]]); - unsigned char hashtype = vchSig.back(); // Really ugly to implement mod-n negation here, but it would be feature creep to expose such functionality from libsecp256k1. static const unsigned char order[33] = { @@ -141,7 +140,6 @@ void static NegateSignatureS(std::vector<unsigned char>& vchSig) { vchSig.push_back(0x02); vchSig.push_back(s.size()); vchSig.insert(vchSig.end(), s.begin(), s.end()); - vchSig.push_back(hashtype); } namespace |