Skip to content

Commit 812037c

Browse files
committed
Change CSipHasher's count variable to uint8_t
1 parent 564e1ab commit 812037c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/crypto/siphash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CSipHasher& CSipHasher::Write(const unsigned char* data, size_t size)
4949
{
5050
uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];
5151
uint64_t t = tmp;
52-
int c = count;
52+
uint8_t c = count;
5353

5454
while (size--) {
5555
t |= ((uint64_t)(*(data++))) << (8 * (c % 8));

src/crypto/siphash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class CSipHasher
1515
private:
1616
uint64_t v[4];
1717
uint64_t tmp;
18-
int count;
18+
uint8_t count; // Only the low 8 bits of the input size matter.
1919

2020
public:
2121
/** Construct a SipHash calculator initialized with 128-bit key (k0, k1) */

0 commit comments

Comments
 (0)