Changeset View
Changeset View
Standalone View
Standalone View
src/test/script_tests.cpp
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | private: | ||||
} | } | ||||
std::vector<uint8_t> DoSignECDSA(const CKey &key, const uint256 &hash, | std::vector<uint8_t> DoSignECDSA(const CKey &key, const uint256 &hash, | ||||
unsigned int lenR = 32, | unsigned int lenR = 32, | ||||
unsigned int lenS = 32) const { | unsigned int lenS = 32) const { | ||||
std::vector<uint8_t> vchSig, r, s; | std::vector<uint8_t> vchSig, r, s; | ||||
uint32_t iter = 0; | uint32_t iter = 0; | ||||
do { | do { | ||||
key.SignECDSA(hash, vchSig, iter++); | key.SignECDSA(hash, vchSig, false, iter++); | ||||
if ((lenS == 33) != (vchSig[5 + vchSig[3]] == 33)) { | if ((lenS == 33) != (vchSig[5 + vchSig[3]] == 33)) { | ||||
NegateSignatureS(vchSig); | NegateSignatureS(vchSig); | ||||
} | } | ||||
r = std::vector<uint8_t>(vchSig.begin() + 4, | r = std::vector<uint8_t>(vchSig.begin() + 4, | ||||
vchSig.begin() + 4 + vchSig[3]); | vchSig.begin() + 4 + vchSig[3]); | ||||
s = std::vector<uint8_t>(vchSig.begin() + 6 + vchSig[3], | s = std::vector<uint8_t>(vchSig.begin() + 6 + vchSig[3], | ||||
vchSig.begin() + 6 + vchSig[3] + | vchSig.begin() + 6 + vchSig[3] + | ||||
▲ Show 20 Lines • Show All 2,792 Lines • Show Last 20 Lines |