diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 12:28:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 12:28:16 -0400 |
| commit | 59ecc26004e77e100c700b1d0da7502b0fdadb46 (patch) | |
| tree | 1faec47bda8439cc2cbe3bd9bf15756e67808e63 | |
| parent | bea803183e12a1c78a12ec70907174d13d958333 (diff) | |
| parent | 8ceee72808d1ae3fb191284afc2257a2be964725 (diff) | |
Merge 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 3.15:
- Added 3DES driver for OMAP4/AM43xx
- Added AVX2 acceleration for SHA
- Added hash-only AEAD algorithms in caam
- Removed tegra driver as it is not functioning and the hardware is
too slow
- Allow blkcipher walks over AEAD (needed for ARM)
- Fixed unprotected FPU/SSE access in ghash-clmulni-intel
- Fixed highmem crash in omap-sham
- Add (zero entropy) randomness when initialising hardware RNGs
- Fixed unaligned ahash comletion functions
- Added soft module depedency for crc32c for initrds that use crc32c"
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (60 commits)
crypto: ghash-clmulni-intel - use C implementation for setkey()
crypto: x86/sha1 - reduce size of the AVX2 asm implementation
crypto: x86/sha1 - fix stack alignment of AVX2 variant
crypto: x86/sha1 - re-enable the AVX variant
crypto: sha - SHA1 transform x86_64 AVX2
crypto: crypto_wq - Fix late crypto work queue initialization
crypto: caam - add missing key_dma unmap
crypto: caam - add support for aead null encryption
crypto: testmgr - add aead null encryption test vectors
crypto: export NULL algorithms defines
crypto: caam - remove error propagation handling
crypto: hash - Simplify the ahash_finup implementation
crypto: hash - Pull out the functions to save/restore request
crypto: hash - Fix the pointer voodoo in unaligned ahash
crypto: caam - Fix first parameter to caam_init_rng
crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing
crypto: caam - Dynamic memory allocation for caam_rng_ctx object
crypto: allow blkcipher walks over AEAD data
crypto: remove direct blkcipher_walk dependency on transform
hwrng: add randomness to system from rng sources
...
51 files changed, 3140 insertions, 1907 deletions
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile index 6ba54d640383..61d6e281898b 100644 --- a/arch/x86/crypto/Makefile +++ b/arch/x86/crypto/Makefile | |||
| @@ -79,6 +79,9 @@ aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o | |||
| 79 | aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o | 79 | aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o |
| 80 | ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o | 80 | ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o |
| 81 | sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o | 81 | sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o |
| 82 | ifeq ($(avx2_supported),yes) | ||
| 83 | sha1-ssse3-y += sha1_avx2_x86_64_asm.o | ||
| 84 | endif | ||
| 82 | crc32c-intel-y := crc32c-intel_glue.o | 85 | crc32c-intel-y := crc32c-intel_glue.o |
| 83 | crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o | 86 | crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o |
| 84 | crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o | 87 | crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o |
diff --git a/arch/x86/crypto/blowfish_glue.c b/arch/x86/crypto/blowfish_glue.c index 50ec333b70e6..8af519ed73d1 100644 --- a/arch/x86/crypto/blowfish_glue.c +++ b/arch/x86/crypto/blowfish_glue.c | |||
| @@ -223,9 +223,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc, | |||
| 223 | src -= 1; | 223 | src -= 1; |
| 224 | dst -= 1; | 224 | dst -= 1; |
| 225 | } while (nbytes >= bsize * 4); | 225 | } while (nbytes >= bsize * 4); |
| 226 | |||
| 227 | if (nbytes < bsize) | ||
| 228 | goto done; | ||
| 229 | } | 226 | } |
| 230 | 227 | ||
| 231 | /* Handle leftovers */ | 228 | /* Handle leftovers */ |
diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c index e6a3700489b9..e57e20ab5e0b 100644 --- a/arch/x86/crypto/cast5_avx_glue.c +++ b/arch/x86/crypto/cast5_avx_glue.c | |||
| @@ -203,9 +203,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc, | |||
| 203 | src -= 1; | 203 | src -= 1; |
| 204 | dst -= 1; | 204 | dst -= 1; |
| 205 | } while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS); | 205 | } while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS); |
| 206 | |||
| 207 | if (nbytes < bsize) | ||
| 208 | goto done; | ||
| 209 | } | 206 | } |
| 210 | 207 | ||
| 211 | /* Handle leftovers */ | 208 | /* Handle leftovers */ |
diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S index 586f41aac361..185fad49d86f 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_asm.S +++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S | |||
| @@ -24,10 +24,6 @@ | |||
| 24 | .align 16 | 24 | .align 16 |
| 25 | .Lbswap_mask: | 25 | .Lbswap_mask: |
| 26 | .octa 0x000102030405060708090a0b0c0d0e0f | 26 | .octa 0x000102030405060708090a0b0c0d0e0f |
| 27 | .Lpoly: | ||
| 28 | .octa 0xc2000000000000000000000000000001 | ||
| 29 | .Ltwo_one: | ||
| 30 | .octa 0x00000001000000000000000000000001 | ||
| 31 | 27 | ||
| 32 | #define DATA %xmm0 | 28 | #define DATA %xmm0 |
| 33 | #define SHASH %xmm1 | 29 | #define SHASH %xmm1 |
| @@ -134,28 +130,3 @@ ENTRY(clmul_ghash_update) | |||
| 134 | .Lupdate_just_ret: | 130 | .Lupdate_just_ret: |
| 135 | ret | 131 | ret |
| 136 | ENDPROC(clmul_ghash_update) | 132 | ENDPROC(clmul_ghash_update) |
| 137 | |||
| 138 | /* | ||
| 139 | * void clmul_ghash_setkey(be128 *shash, const u8 *key); | ||
| 140 | * | ||
| 141 | * Calculate hash_key << 1 mod poly | ||
| 142 | */ | ||
| 143 | ENTRY(clmul_ghash_setkey) | ||
| 144 | movaps .Lbswap_mask, BSWAP | ||
| 145 | movups (%rsi), %xmm0 | ||
| 146 | PSHUFB_XMM BSWAP %xmm0 | ||
| 147 | movaps %xmm0, %xmm1 | ||
| 148 | psllq $1, %xmm0 | ||
| 149 | psrlq $63, %xmm1 | ||
| 150 | movaps %xmm1, %xmm2 | ||
| 151 | pslldq $8, %xmm1 | ||
| 152 | psrldq $8, %xmm2 | ||
| 153 | por %xmm1, %xmm0 | ||
| 154 | # reduction | ||
| 155 | pshufd $0b00100100, %xmm2, %xmm1 | ||
| 156 | pcmpeqd .Ltwo_one, %xmm1 | ||
| 157 | pand .Lpoly, %xmm1 | ||
| 158 | pxor %xmm1, %xmm0 | ||
| 159 | movups %xmm0, (%rdi) | ||
| 160 | ret | ||
| 161 | ENDPROC(clmul_ghash_setkey) | ||
diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c index 6759dd1135be..d785cf2c529c 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_glue.c +++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c | |||
| @@ -30,8 +30,6 @@ void clmul_ghash_mul(char *dst, const be128 *shash); | |||
| 30 | void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, | 30 | void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, |
| 31 | const be128 *shash); | 31 | const be128 *shash); |
| 32 | 32 | ||
| 33 | void clmul_ghash_setkey(be128 *shash, const u8 *key); | ||
| 34 | |||
| 35 | struct ghash_async_ctx { | 33 | struct ghash_async_ctx { |
| 36 | struct cryptd_ahash *cryptd_tfm; | 34 | struct cryptd_ahash *cryptd_tfm; |
| 37 | }; | 35 | }; |
| @@ -58,13 +56,23 @@ static int ghash_setkey(struct crypto_shash *tfm, | |||
| 58 | const u8 *key, unsigned int keylen) | 56 | const u8 *key, |
