]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
replay: divide by bits-per-byte
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 7 Sep 2020 16:51:49 +0000 (18:51 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 7 Sep 2020 16:51:49 +0000 (18:51 +0200)
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 <me@riobard.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
replay/replay.go

index e5c7391ccca4a1dd62165e5d81cb3d03a9bd6bae..85647f5aacda5a2ae52a81db7814e7f467412130 100644 (file)
@@ -26,7 +26,7 @@ const (
 )
 
 const (
-       BacktrackWords = CounterBitsTotal / _WordSize
+       BacktrackWords = CounterBitsTotal / 8 / _WordSize
 )
 
 func minUint64(a uint64, b uint64) uint64 {