linux/include/crypto
Eric Biggers ad28c2ba43 crypto: chacha20 - Fix chacha20_block() keystream alignment (again)
[ Upstream commit a5e9f55709 ]

In commit 9f480faec5 ("crypto: chacha20 - Fix keystream alignment for
chacha20_block()"), I had missed that chacha20_block() can be called
directly on the buffer passed to get_random_bytes(), which can have any
alignment.  So, while my commit didn't break anything, it didn't fully
solve the alignment problems.

Revert my solution and just update chacha20_block() to use
put_unaligned_le32(), so the output buffer need not be aligned.
This is simpler, and on many CPUs it's the same speed.

But, I kept the 'tmp' buffers in extract_crng_user() and
_get_random_bytes() 4-byte aligned, since that alignment is actually
needed for _crng_backtrack_protect() too.

Reported-by: Stephan Müller <smueller@chronox.de>
Cc: Theodore Ts'o <tytso@mit.edu>
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>
2019-11-20 18:47:11 +01:00
..
internal crypto: simd - allow registering multiple algorithms at once 2018-03-03 00:03:17 +08:00
acompress.h
aead.h
aes.h
akcipher.h
algapi.h crypto: api - laying defines and checks for statically allocated buffers 2018-04-21 00:58:32 +08:00
authenc.h
b128ops.h
blowfish.h
cast_common.h
cast5.h
cast6.h
cbc.h
chacha20.h crypto: chacha20 - Fix chacha20_block() keystream alignment (again) 2019-11-20 18:47:11 +01:00
cryptd.h
crypto_wq.h
ctr.h
des.h
dh.h crypto: dh - add public key verification test 2018-07-09 00:26:22 +08:00
drbg.h crypto: drbg - in-place cipher operation for CTR 2018-08-03 18:05:48 +08:00
ecdh.h
engine.h crypto: engine - Permit to enqueue all async requests 2018-02-15 23:26:50 +08:00
gcm.h
gf128mul.h
ghash.h
hash_info.h
hash.h crypto: hash - Prevent use of req->result in ahash update 2018-03-16 23:35:52 +08:00
hmac.h
if_alg.h Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL 2018-06-28 10:40:47 -07:00
kpp.h
mcryptd.h
md5.h
morus_common.h crypto: morus - Add generic MORUS AEAD implementations 2018-05-19 00:15:00 +08:00
morus640_glue.h crypto: morus - Add common SIMD glue code for MORUS 2018-05-19 00:15:18 +08:00
morus1280_glue.h crypto: morus - Add common SIMD glue code for MORUS 2018-05-19 00:15:18 +08:00
null.h
padlock.h
pcrypt.h
pkcs7.h
poly1305.h
public_key.h
rng.h
scatterwalk.h crypto: scatterwalk - remove scatterwalk_samebuf() 2018-08-03 18:06:04 +08:00
serpent.h
sha.h crypto: sha512_generic - add a sha384 0-length pre-computed hash 2018-06-22 23:03:05 +08:00
sha1_base.h
sha3.h
sha256_base.h
sha512_base.h
skcipher.h
sm3_base.h
sm3.h
sm4.h crypto: sm4 - export encrypt/decrypt routines to other drivers 2018-05-05 14:52:51 +08:00
twofish.h
xts.h crypto: xts - remove xts_crypt() 2018-03-03 00:03:33 +08:00