diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-08 23:57:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-08 23:57:08 -0400 |
commit | 4d2fa8b44b891f0da5ceda3e5a1402ccf0ab6f26 (patch) | |
tree | cbb763ec5e74cfbaac6ce53df277883cb78a8a1a /crypto/ghash-generic.c | |
parent | 8b68150883ca466a23e90902dd4113b22e692f04 (diff) | |
parent | f3880a23564e3172437285ebcb5b8a124539fdae (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu:
"Here is the crypto update for 5.3:
API:
- Test shash interface directly in testmgr
- cra_driver_name is now mandatory
Algorithms:
- Replace arc4 crypto_cipher with library helper
- Implement 5 way interleave for ECB, CBC and CTR on arm64
- Add xxhash
- Add continuous self-test on noise source to drbg
- Update jitter RNG
Drivers:
- Add support for SHA204A random number generator
- Add support for 7211 in iproc-rng200
- Fix fuzz test failures in inside-secure
- Fix fuzz test failures in talitos
- Fix fuzz test failures in qat"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (143 commits)
crypto: stm32/hash - remove interruptible condition for dma
crypto: stm32/hash - Fix hmac issue more than 256 bytes
crypto: stm32/crc32 - rename driver file
crypto: amcc - remove memset after dma_alloc_coherent
crypto: ccp - Switch to SPDX license identifiers
crypto: ccp - Validate the the error value used to index error messages
crypto: doc - Fix formatting of new crypto engine content
crypto: doc - Add parameter documentation
crypto: arm64/aes-ce - implement 5 way interleave for ECB, CBC and CTR
crypto: arm64/aes-ce - add 5 way interleave routines
crypto: talitos - drop icv_ool
crypto: talitos - fix hash on SEC1.
crypto: talitos - move struct talitos_edesc into talitos.h
lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE
crypto/NX: Set receive window credits to max number of CRBs in RxFIFO
crypto: asymmetric_keys - select CRYPTO_HASH where needed
crypto: serpent - mark __serpent_setkey_sbox noinline
crypto: testmgr - dynamically allocate crypto_shash
crypto: testmgr - dynamically allocate testvec_config
crypto: talitos - eliminate unneeded 'done' functions at build time
...
Diffstat (limited to 'crypto/ghash-generic.c')
-rw-r--r-- | crypto/ghash-generic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c index 6425b9cd718e..dad9e1f91a78 100644 --- a/crypto/ghash-generic.c +++ b/crypto/ghash-generic.c | |||
@@ -31,6 +31,7 @@ static int ghash_setkey(struct crypto_shash *tfm, | |||
31 | const u8 *key, unsigned int keylen) | 31 | const u8 *key, unsigned int keylen) |
32 | { | 32 | { |
33 | struct ghash_ctx *ctx = crypto_shash_ctx(tfm); | 33 | struct ghash_ctx *ctx = crypto_shash_ctx(tfm); |
34 | be128 k; | ||
34 | 35 | ||
35 | if (keylen != GHASH_BLOCK_SIZE) { | 36 | if (keylen != GHASH_BLOCK_SIZE) { |
36 | crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); | 37 | crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); |
@@ -39,7 +40,12 @@ static int ghash_setkey(struct crypto_shash *tfm, | |||
39 | 40 | ||
40 | if (ctx->gf128) | 41 | if (ctx->gf128) |
41 | gf128mul_free_4k(ctx->gf128); | 42 | gf128mul_free_4k(ctx->gf128); |
42 | ctx->gf128 = gf128mul_init_4k_lle((be128 *)key); | 43 | |
44 | BUILD_BUG_ON(sizeof(k) != GHASH_BLOCK_SIZE); | ||
45 | memcpy(&k, key, GHASH_BLOCK_SIZE); /* avoid violating alignment rules */ | ||
46 | ctx->gf128 = gf128mul_init_4k_lle(&k); | ||
47 | memzero_explicit(&k, GHASH_BLOCK_SIZE); | ||
48 | |||
43 | if (!ctx->gf128) | 49 | if (!ctx->gf128) |
44 | return -ENOMEM; | 50 | return -ENOMEM; |
45 | 51 | ||