From: Jason A. Donenfeld Date: Mon, 7 Sep 2020 16:51:49 +0000 (+0200) Subject: replay: divide by bits-per-byte X-Git-Tag: 0.0.20201118~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cfa3314ee2740cd94cf7064cc79fdea7b1e0dde;p=thirdparty%2Fwireguard-go.git replay: divide by bits-per-byte Bits / Bytes-per-Word misses the step of also dividing by Bits-per-Byte, which we need in order for this to make sense. Reported-by: Riobard Zhan Signed-off-by: Jason A. Donenfeld --- diff --git a/replay/replay.go b/replay/replay.go index e5c7391..85647f5 100644 --- a/replay/replay.go +++ b/replay/replay.go @@ -26,7 +26,7 @@ const ( ) const ( - BacktrackWords = CounterBitsTotal / _WordSize + BacktrackWords = CounterBitsTotal / 8 / _WordSize ) func minUint64(a uint64, b uint64) uint64 {