HomePhabricator

Change CSipHasher's count variable to uint8_t

Description

Change CSipHasher's count variable to uint8_t

Summary:

SipHash technically supports arbitrarily long inputs (at least, I couldn't find a limit in the paper), but only the low 8 bits of the length matter. Because of that we should use an unsigned type to track the length (as any signed type could overflow, which is UB). uint8_t is sufficient, however.

This is a backport of core#19931

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10241

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Sep 10 2020, 07:21
PiRKCommitted on Oct 5 2021, 06:39
PiRKPushed on Oct 5 2021, 06:39
Reviewer
Restricted Project
Differential Revision
D10241: Change CSipHasher's count variable to uint8_t
Parents
rABCa331135a588f: [avalanche] Extract the vote status in an enum class
Branches
Unknown
Tags
Unknown