aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-04-09 07:39:35 +0200
committerWladimir J. van der Laan <[email protected]>2016-04-15 16:44:23 +0200
commit9ad1a518574b9afed3e66a1e1658ead1d3d7ce54 (patch)
tree357e837d9111fdec2530a750ce323a80c0b23183 /src
parentMerge #7603: Build System: Use PACKAGE_TARNAME in NSIS script (diff)
downloaddiscoin-9ad1a518574b9afed3e66a1e1658ead1d3d7ce54.tar.xz
discoin-9ad1a518574b9afed3e66a1e1658ead1d3d7ce54.zip
crypto: bytes counts are 64 bit
Byte counts for SHA256, SHA512, SHA1 and RIPEMD160 must be 64 bits. `size_t` has a different size per platform, causing divergent results when hashing more than 4GB of data.
Diffstat (limited to 'src')
-rw-r--r--src/crypto/ripemd160.h2
-rw-r--r--src/crypto/sha1.h2
-rw-r--r--src/crypto/sha256.h2
-rw-r--r--src/crypto/sha512.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h
index 687204fda..bd41f0250 100644
--- a/src/crypto/ripemd160.h
+++ b/src/crypto/ripemd160.h
@@ -14,7 +14,7 @@ class CRIPEMD160
private:
uint32_t s[5];
unsigned char buf[64];
- size_t bytes;
+ uint64_t bytes;
public:
static const size_t OUTPUT_SIZE = 20;
diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h
index 7b2a21bc6..8fb20810b 100644
--- a/src/crypto/sha1.h
+++ b/src/crypto/sha1.h
@@ -14,7 +14,7 @@ class CSHA1
private:
uint32_t s[5];
unsigned char buf[64];
- size_t bytes;
+ uint64_t bytes;
public:
static const size_t OUTPUT_SIZE = 20;
diff --git a/src/crypto/sha256.h b/src/crypto/sha256.h
index 85cf33739..5b15b6a23 100644
--- a/src/crypto/sha256.h
+++ b/src/crypto/sha256.h
@@ -14,7 +14,7 @@ class CSHA256
private:
uint32_t s[8];
unsigned char buf[64];
- size_t bytes;
+ uint64_t bytes;
public:
static const size_t OUTPUT_SIZE = 32;
diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h
index f1f17caf9..614681fae 100644
--- a/src/crypto/sha512.h
+++ b/src/crypto/sha512.h
@@ -14,7 +14,7 @@ class CSHA512
private:
uint64_t s[8];
unsigned char buf[128];
- size_t bytes;
+ uint64_t bytes;
public:
static const size_t OUTPUT_SIZE = 64;