]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: chacha20 - Fix unaligned access when loading constants
authorEric Biggers <ebiggers@google.com>
Wed, 22 Nov 2017 19:51:35 +0000 (11:51 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Nov 2017 06:33:31 +0000 (17:33 +1100)
commit40c6ec2bcc1ef0c0face7d37e1977632e2e4f2e0
tree06a021d9e6773ea5f6511ee6e68d4522406b2380
parent47f042dcb5139622e6e7b983e7b497f2a6cb4975
crypto: chacha20 - Fix unaligned access when loading constants

The four 32-bit constants for the initial state of ChaCha20 were loaded
from a char array which is not guaranteed to have the needed alignment.

Fix it by just assigning the constants directly instead.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/chacha20_generic.c