Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: x86/ghash - use le128 instead of u128

The u128 struct type is going away, so make ghash-clmulni-intel use
le128 instead. Note that the field names a and b swapped, as they were
backwards with u128. (a is meant to be high-order and b low-order.)

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
f1740751 116db270

+8 -8
+2 -2
arch/x86/crypto/ghash-clmulni-intel_asm.S
··· 88 88 RET 89 89 SYM_FUNC_END(__clmul_gf128mul_ble) 90 90 91 - /* void clmul_ghash_mul(char *dst, const u128 *shash) */ 91 + /* void clmul_ghash_mul(char *dst, const le128 *shash) */ 92 92 SYM_FUNC_START(clmul_ghash_mul) 93 93 FRAME_BEGIN 94 94 movups (%rdi), DATA ··· 104 104 105 105 /* 106 106 * void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, 107 - * const u128 *shash); 107 + * const le128 *shash); 108 108 */ 109 109 SYM_FUNC_START(clmul_ghash_update) 110 110 FRAME_BEGIN
+6 -6
arch/x86/crypto/ghash-clmulni-intel_glue.c
··· 24 24 #define GHASH_BLOCK_SIZE 16 25 25 #define GHASH_DIGEST_SIZE 16 26 26 27 - void clmul_ghash_mul(char *dst, const u128 *shash); 27 + void clmul_ghash_mul(char *dst, const le128 *shash); 28 28 29 29 void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, 30 - const u128 *shash); 30 + const le128 *shash); 31 31 32 32 struct ghash_async_ctx { 33 33 struct cryptd_ahash *cryptd_tfm; 34 34 }; 35 35 36 36 struct ghash_ctx { 37 - u128 shash; 37 + le128 shash; 38 38 }; 39 39 40 40 struct ghash_desc_ctx { ··· 64 64 a = get_unaligned_be64(key); 65 65 b = get_unaligned_be64(key + 8); 66 66 67 - ctx->shash.a = (b << 1) | (a >> 63); 68 - ctx->shash.b = (a << 1) | (b >> 63); 67 + ctx->shash.a = cpu_to_le64((a << 1) | (b >> 63)); 68 + ctx->shash.b = cpu_to_le64((b << 1) | (a >> 63)); 69 69 70 70 if (a >> 63) 71 - ctx->shash.b ^= ((u64)0xc2) << 56; 71 + ctx->shash.a ^= cpu_to_le64((u64)0xc2 << 56); 72 72 73 73 return 0; 74 74 }