diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2020-08-21 09:52:04 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-08-28 08:58:30 +0200 |
commit | 39340cf97fef32667e8714d0fcc247f02d8e2b97 (patch) | |
tree | c2891846d184b247c6d43cd6fa8e7963c3f05341 /drivers/crypto/mediatek/mtk-sha.c | |
parent | crypto: hifn_795x - Remove 64-bit build-time check (diff) | |
download | linux-39340cf97fef32667e8714d0fcc247f02d8e2b97.tar.xz linux-39340cf97fef32667e8714d0fcc247f02d8e2b97.zip |
crypto: mediatek - Fix endianness bugs and sparse warnings
This patch squashes all the sparse warnings in mediatek, some of
which appear to be genuine bugs. In particular, previously on
BE the keys and IVs all get 32-bit swabbed which can't be right
because they don't get swabbed on LE. I presume LE is the one
that actually works.
Another funky thing is that the GHASH key gets swabbed on LE.
This makes no sense but I'm presuming someone actually tested
this on LE so I'm preserving the swabbing. Someone needs to
test this though as it is entirely possible that GCM is the
only thing that worked on BE but not LE.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/mediatek/mtk-sha.c')
-rw-r--r-- | drivers/crypto/mediatek/mtk-sha.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c index da3f0b8814aa..3d5d7d68b03b 100644 --- a/drivers/crypto/mediatek/mtk-sha.c +++ b/drivers/crypto/mediatek/mtk-sha.c @@ -239,7 +239,7 @@ static int mtk_sha_append_sg(struct mtk_sha_reqctx *ctx) static void mtk_sha_fill_padding(struct mtk_sha_reqctx *ctx, u32 len) { u32 index, padlen; - u64 bits[2]; + __be64 bits[2]; u64 size = ctx->digcnt; size += ctx->bufcnt; |