aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-16 15:43:03 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-05 15:45:35 +0100
commit734f85c4f0b40efd3f6c0367683c1bab1a2a7b19 (patch)
tree664e41303a76e2154972af1347f18f4de3368473 /src/key.cpp
parent34cdc41128eee5da0be9c5e17b3c24b1f91a1957 (diff)
Use arith_uint256 where necessary
Also add conversion from/to uint256 where needed.
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 50ccb09213..2235c271d1 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -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();