Use arith_uint256 where necessary

Also add conversion from/to uint256 where needed.
This commit is contained in:
Wladimir J. van der Laan
2014-12-16 15:43:03 +01:00
parent 34cdc41128
commit 734f85c4f0
11 changed files with 44 additions and 33 deletions

View File

@@ -4,6 +4,7 @@
#include "key.h"
#include "arith_uint256.h"
#include "crypto/hmac_sha512.h"
#include "crypto/rfc6979_hmac_sha256.h"
#include "eccryptoverify.h"
@@ -81,7 +82,7 @@ bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_
do {
uint256 nonce;
prng.Generate((unsigned char*)&nonce, 32);
nonce += test_case;
nonce = ArithToUint256(UintToArith256(nonce) + test_case);
int nSigLen = 72;
int ret = secp256k1_ecdsa_sign((const unsigned char*)&hash, (unsigned char*)&vchSig[0], &nSigLen, begin(), (unsigned char*)&nonce);
nonce = uint256();