aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-09-10 00:21:52 -0700
committerPieter Wuille <pieter@wuille.net>2020-09-10 09:04:53 -0700
commit812037cb80f72096738cf2b0c15b39536c6c1e24 (patch)
treefcb2cb6d9e1ba0e071ffead76924c6d95661e567 /src/crypto
parent564e1ab0f3dc573bd3ea60a80f6649c361243df9 (diff)
downloadbitcoin-812037cb80f72096738cf2b0c15b39536c6c1e24.tar.xz
Change CSipHasher's count variable to uint8_t
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/siphash.cpp2
-rw-r--r--src/crypto/siphash.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/siphash.cpp b/src/crypto/siphash.cpp
index e81957111a..2e0106b165 100644
--- a/src/crypto/siphash.cpp
+++ b/src/crypto/siphash.cpp
@@ -49,7 +49,7 @@ CSipHasher& CSipHasher::Write(const unsigned char* data, size_t size)
{
uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];
uint64_t t = tmp;
- int c = count;
+ uint8_t c = count;
while (size--) {
t |= ((uint64_t)(*(data++))) << (8 * (c % 8));
diff --git a/src/crypto/siphash.h b/src/crypto/siphash.h
index b312f913f9..6b38950f8e 100644
--- a/src/crypto/siphash.h
+++ b/src/crypto/siphash.h
@@ -15,7 +15,7 @@ class CSipHasher
private:
uint64_t v[4];
uint64_t tmp;
- int count;
+ uint8_t count; // Only the low 8 bits of the input size matter.
public:
/** Construct a SipHash calculator initialized with 128-bit key (k0, k1) */