Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/crypto/salsa20: keystream loop in amd64 implementation after 256GiB #30965
If more than 256 GiB of keystream is generated, or if the counter otherwise grows greater than 32 bits, the amd64 implementation will first generate incorrect output, and then cycle back to previously generated keystream. Repeated keystream bytes can lead to loss of confidentiality in encryption applications, or to predictability in CSPRNG applications.
The issue might affect uses of golang.org/x/crypto/nacl with extremely large messages.
Architectures other than amd64 and uses that generate less than 256 GiB of keystream for a single salsa20.XORKeyStream invocation are unaffected.
This issue was discovered and reported by Michael McLoughlin.
CVE has been assigned to this https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11840. Please make sure to get CVE for a security fix in future.