|
|
@ -82,7 +82,7 @@ bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_ |
|
|
|
prng.Generate((unsigned char*)&nonce, 32); |
|
|
|
prng.Generate((unsigned char*)&nonce, 32); |
|
|
|
nonce += test_case; |
|
|
|
nonce += test_case; |
|
|
|
int nSigLen = 72; |
|
|
|
int nSigLen = 72; |
|
|
|
int ret = secp256k1_ecdsa_sign((const unsigned char*)&hash, 32, (unsigned char*)&vchSig[0], &nSigLen, begin(), (unsigned char*)&nonce); |
|
|
|
int ret = secp256k1_ecdsa_sign((const unsigned char*)&hash, (unsigned char*)&vchSig[0], &nSigLen, begin(), (unsigned char*)&nonce); |
|
|
|
nonce = 0; |
|
|
|
nonce = 0; |
|
|
|
if (ret) { |
|
|
|
if (ret) { |
|
|
|
vchSig.resize(nSigLen); |
|
|
|
vchSig.resize(nSigLen); |
|
|
@ -114,7 +114,7 @@ bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) |
|
|
|
do { |
|
|
|
do { |
|
|
|
uint256 nonce; |
|
|
|
uint256 nonce; |
|
|
|
prng.Generate((unsigned char*)&nonce, 32); |
|
|
|
prng.Generate((unsigned char*)&nonce, 32); |
|
|
|
int ret = secp256k1_ecdsa_sign_compact((const unsigned char*)&hash, 32, &vchSig[1], begin(), (unsigned char*)&nonce, &rec); |
|
|
|
int ret = secp256k1_ecdsa_sign_compact((const unsigned char*)&hash, &vchSig[1], begin(), (unsigned char*)&nonce, &rec); |
|
|
|
nonce = 0; |
|
|
|
nonce = 0; |
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
break; |
|
|
|
break; |
|
|
|