OSDN Git Service

crypto: sha3-generic - fixes for alignment and big endian operation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 19 Jan 2018 12:04:33 +0000 (12:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:38:51 +0000 (17:38 +0100)
commitb9788e278cec29fef2e837633fa1b97030417e78
treed9df1dd7babc5b6de9fbf6fea4fca50fd309959e
parent199d97815d32acd0f1d20cbd04e39e3dead59a8b
crypto: sha3-generic - fixes for alignment and big endian operation

commit c013cee99d5a18aec8c71fee8f5f41369cd12595 upstream.

Ensure that the input is byte swabbed before injecting it into the
SHA3 transform. Use the get_unaligned() accessor for this so that
we don't perform unaligned access inadvertently on architectures
that do not support that.

Fixes: 53964b9ee63b7075 ("crypto: sha3 - Add SHA-3 hash algorithm")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/sha3_generic.c