decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
731 stars 289 forks source link

peer/uprng: Remove unneeded carry add. #3369

Closed davecgh closed 1 month ago

davecgh commented 1 month ago

This removes an unnecessary and technically incorrect carry add on the nonce increment. While there really isn't a security concern since the wraparound will never actually be hit in practice given it's working modulo 2^96 and only incremented once on each reseed, removing it to have the correct wraparound behavior also has the benefit of one less addition on every invocation.