git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
2d3c161
)
Use BN_set_word if current word size is sufficient for uint64_t.
author
CryptoManiac
<balthazar@yandex.ru>
Sun, 28 Dec 2014 20:36:43 +0000 (12:36 -0800)
committer
CryptoManiac
<balthazar@yandex.ru>
Sun, 28 Dec 2014 20:36:43 +0000 (12:36 -0800)
src/bignum.h
patch
|
blob
|
history
diff --git
a/src/bignum.h
b/src/bignum.h
index
e3e60f5
..
58da20c
100644
(file)
--- a/
src/bignum.h
+++ b/
src/bignum.h
@@
-208,6
+208,13
@@
public:
void setuint64(uint64_t n)
{
+ if (sizeof(n) == sizeof(size_t))
+ {
+ if (!BN_set_word(this, n))
+ throw bignum_error("CBigNum conversion from uint64_t : BN_set_word failed");
+ return;
+ }
+
unsigned char pch[sizeof(n) + 6];
unsigned char* p = pch + 4;
bool fLeadingZeroes = true;