Deterministic signing

This commit is contained in:
Pieter Wuille
2014-11-06 06:54:50 -08:00
parent 3060e36098
commit a53fd41485
4 changed files with 49 additions and 14 deletions

View File

@@ -248,8 +248,9 @@ public:
{
uint256 hash = SignatureHash(scriptPubKey, spendTx, 0, nHashType);
std::vector<unsigned char> vchSig, r, s;
uint32_t iter = 0;
do {
key.Sign(hash, vchSig);
key.Sign(hash, vchSig, iter++);
if ((lenS == 33) != (vchSig[5 + vchSig[3]] == 33)) {
NegateSignatureS(vchSig);
}