diff options
author | Ondrej Mosnáček <omosnacek@gmail.com> | 2017-04-02 21:19:14 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-04-05 21:58:37 +0800 |
commit | e55318c84f199d6056a0bcd98bc4612d01ccfe80 (patch) | |
tree | b77991aaa7d895773d631dbbdfc10ba960d96dfc /arch/x86/crypto/serpent_sse2_glue.c | |
parent | acb9b159c784dc0033ede0dadde876ebd93aca4c (diff) | |
download | linux-stable-e55318c84f199d6056a0bcd98bc4612d01ccfe80.tar.gz linux-stable-e55318c84f199d6056a0bcd98bc4612d01ccfe80.tar.bz2 linux-stable-e55318c84f199d6056a0bcd98bc4612d01ccfe80.zip |
crypto: gf128mul - switch gf128mul_x_ble to le128
Currently, gf128mul_x_ble works with pointers to be128, even though it
actually interprets the words as little-endian. Consequently, it uses
cpu_to_le64/le64_to_cpu on fields of type __be64, which is incorrect.
This patch fixes that by changing the function to accept pointers to
le128 and updating all users accordingly.
Signed-off-by: Ondrej Mosnacek <omosnacek@gmail.com>
Reviewd-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86/crypto/serpent_sse2_glue.c')
-rw-r--r-- | arch/x86/crypto/serpent_sse2_glue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c index 644f97ab8cac..ac0e831943f5 100644 --- a/arch/x86/crypto/serpent_sse2_glue.c +++ b/arch/x86/crypto/serpent_sse2_glue.c @@ -328,7 +328,7 @@ static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct serpent_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); - be128 buf[SERPENT_PARALLEL_BLOCKS]; + le128 buf[SERPENT_PARALLEL_BLOCKS]; struct crypt_priv crypt_ctx = { .ctx = &ctx->crypt_ctx, .fpu_enabled = false, @@ -355,7 +355,7 @@ static int xts_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct serpent_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); - be128 buf[SERPENT_PARALLEL_BLOCKS]; + le128 buf[SERPENT_PARALLEL_BLOCKS]; struct crypt_priv crypt_ctx = { .ctx = &ctx->crypt_ctx, .fpu_enabled = false, |