]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
random: initialize ChaCha20 constants with correct endianness
authorEric Biggers <ebiggers@google.com>
Mon, 22 Mar 2021 05:13:47 +0000 (22:13 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:32:01 +0000 (10:32 +0200)
commit0852f6b428419cca0f518f977c9b146247a7d057
tree84ab6a3f625aa8b41d27d90d3804fdbadd1d14c1
parent6b101dce84432ced30cf8c2f58da72c369417490
random: initialize ChaCha20 constants with correct endianness

BugLink: https://bugs.launchpad.net/bugs/1928857
[ Upstream commit a181e0fdb2164268274453b5b291589edbb9b22d ]

On big endian CPUs, the ChaCha20-based CRNG is using the wrong
endianness for the ChaCha20 constants.

This doesn't matter cryptographically, but technically it means it's not
ChaCha20 anymore.  Fix it to always use the standard constants.

Cc: linux-crypto@vger.kernel.org
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/char/random.c
include/crypto/chacha.h