aboutsummaryrefslogtreecommitdiff
path: root/src/arith_uint256.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-16 15:47:29 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-05 15:45:36 +0100
commit30007fda76aa7ba4e4090f7a16298874a7722926 (patch)
tree9b2a2e70e0ac9169aac94ea70a8d539d467c7874 /src/arith_uint256.cpp
parentedc720479d0749a000d5a6970da6d2d72657cf38 (diff)
downloadbitcoin-30007fda76aa7ba4e4090f7a16298874a7722926.tar.xz
Remove now-unused methods from arith_uint256 and base_uint
- Methods that access the guts of arith_uint256 are removed, as these are incompatible between endians. Use uint256 instead - Serialization is no longer needed as arith_uint256's are never read or written - GetHash is never used on arith_uint256
Diffstat (limited to 'src/arith_uint256.cpp')
-rw-r--r--src/arith_uint256.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/arith_uint256.cpp b/src/arith_uint256.cpp
index 12f9e7d1b1..11df3b05c0 100644
--- a/src/arith_uint256.cpp
+++ b/src/arith_uint256.cpp
@@ -278,68 +278,6 @@ uint32_t arith_uint256::GetCompact(bool fNegative) const
return nCompact;
}
-static void inline HashMix(uint32_t& a, uint32_t& b, uint32_t& c)
-{
- // Taken from lookup3, by Bob Jenkins.
- a -= c;
- a ^= ((c << 4) | (c >> 28));
- c += b;
- b -= a;
- b ^= ((a << 6) | (a >> 26));
- a += c;
- c -= b;
- c ^= ((b << 8) | (b >> 24));
- b += a;
- a -= c;
- a ^= ((c << 16) | (c >> 16));
- c += b;
- b -= a;
- b ^= ((a << 19) | (a >> 13));
- a += c;
- c -= b;
- c ^= ((b << 4) | (b >> 28));
- b += a;
-}
-
-static void inline HashFinal(uint32_t& a, uint32_t& b, uint32_t& c)
-{
- // Taken from lookup3, by Bob Jenkins.
- c ^= b;
- c -= ((b << 14) | (b >> 18));
- a ^= c;
- a -= ((c << 11) | (c >> 21));
- b ^= a;
- b -= ((a << 25) | (a >> 7));
- c ^= b;
- c -= ((b << 16) | (b >> 16));
- a ^= c;
- a -= ((c << 4) | (c >> 28));
- b ^= a;
- b -= ((a << 14) | (a >> 18));
- c ^= b;
- c -= ((b << 24) | (b >> 8));
-}
-
-uint64_t arith_uint256::GetHash(const arith_uint256& salt) const
-{
- uint32_t a, b, c;
- a = b = c = 0xdeadbeef + (WIDTH << 2);
-
- a += pn[0] ^ salt.pn[0];
- b += pn[1] ^ salt.pn[1];
- c += pn[2] ^ salt.pn[2];
- HashMix(a, b, c);
- a += pn[3] ^ salt.pn[3];
- b += pn[4] ^ salt.pn[4];
- c += pn[5] ^ salt.pn[5];
- HashMix(a, b, c);
- a += pn[6] ^ salt.pn[6];
- b += pn[7] ^ salt.pn[7];
- HashFinal(a, b, c);
-
- return ((((uint64_t)b) << 32) | c);
-}
-
uint256 ArithToUint256(const arith_uint256 &a)
{
uint256 b;