We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf3353d commit 08b17deCopy full SHA for 08b17de
src/arith_uint256.cpp
@@ -69,16 +69,16 @@ base_uint<BITS>& base_uint<BITS>::operator*=(uint32_t b32)
69
template <unsigned int BITS>
70
base_uint<BITS>& base_uint<BITS>::operator*=(const base_uint& b)
71
{
72
- base_uint<BITS> a = *this;
73
- *this = 0;
+ base_uint<BITS> a;
74
for (int j = 0; j < WIDTH; j++) {
75
uint64_t carry = 0;
76
for (int i = 0; i + j < WIDTH; i++) {
77
- uint64_t n = carry + pn[i + j] + (uint64_t)a.pn[j] * b.pn[i];
78
- pn[i + j] = n & 0xffffffff;
+ uint64_t n = carry + a.pn[i + j] + (uint64_t)pn[j] * b.pn[i];
+ a.pn[i + j] = n & 0xffffffff;
79
carry = n >> 32;
80
}
81
+ *this = a;
82
return *this;
83
84
0 commit comments