diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 01:01:27 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 01:01:27 -0500 |
| commit | 4f58cb90bcb04cfe18f524d1c9a65edef5eb3f51 (patch) | |
| tree | 8c686e8b736eed7258921909282c0955543c7d2f | |
| parent | e7691a1ce341c80ed9504244a36b31c025217391 (diff) | |
| parent | 08c70fc3a239475122e20b7a21dfae4c264c24f7 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (54 commits)
crypto: gf128mul - remove leftover "(EXPERIMENTAL)" in Kconfig
crypto: serpent-sse2 - remove unneeded LRW/XTS #ifdefs
crypto: serpent-sse2 - select LRW and XTS
crypto: twofish-x86_64-3way - remove unneeded LRW/XTS #ifdefs
crypto: twofish-x86_64-3way - select LRW and XTS
crypto: xts - remove dependency on EXPERIMENTAL
crypto: lrw - remove dependency on EXPERIMENTAL
crypto: picoxcell - fix boolean and / or confusion
crypto: caam - remove DECO access initialization code
crypto: caam - fix polarity of "propagate error" logic
crypto: caam - more desc.h cleanups
crypto: caam - desc.h - convert spaces to tabs
crypto: talitos - convert talitos_error to struct device
crypto: talitos - remove NO_IRQ references
crypto: talitos - fix bad kfree
crypto: convert drivers/crypto/* to use module_platform_driver()
char: hw_random: convert drivers/char/hw_random/* to use module_platform_driver()
crypto: serpent-sse2 - should select CRYPTO_CRYPTD
crypto: serpent - rename serpent.c to serpent_generic.c
crypto: serpent - cleanup checkpatch errors and warnings
...
44 files changed, 8684 insertions, 2049 deletions
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile index 3537d4b91f74..2b0b9631474b 100644 --- a/arch/x86/crypto/Makefile +++ b/arch/x86/crypto/Makefile | |||
| @@ -5,12 +5,14 @@ | |||
| 5 | obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o | 5 | obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o |
| 6 | obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o | 6 | obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o |
| 7 | obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o | 7 | obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o |
| 8 | obj-$(CONFIG_CRYPTO_SERPENT_SSE2_586) += serpent-sse2-i586.o | ||
| 8 | 9 | ||
| 9 | obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o | 10 | obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o |
| 10 | obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o | 11 | obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o |
| 11 | obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o | 12 | obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o |
| 12 | obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o | 13 | obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o |
| 13 | obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o | 14 | obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o |
| 15 | obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o | ||
| 14 | obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o | 16 | obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o |
| 15 | obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o | 17 | obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o |
| 16 | 18 | ||
| @@ -20,12 +22,14 @@ obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o | |||
| 20 | aes-i586-y := aes-i586-asm_32.o aes_glue.o | 22 | aes-i586-y := aes-i586-asm_32.o aes_glue.o |
| 21 | twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o | 23 | twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o |
| 22 | salsa20-i586-y := salsa20-i586-asm_32.o salsa20_glue.o | 24 | salsa20-i586-y := salsa20-i586-asm_32.o salsa20_glue.o |
| 25 | serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o | ||
| 23 | 26 | ||
| 24 | aes-x86_64-y := aes-x86_64-asm_64.o aes_glue.o | 27 | aes-x86_64-y := aes-x86_64-asm_64.o aes_glue.o |
| 25 | blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o | 28 | blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o |
| 26 | twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o | 29 | twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o |
| 27 | twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o | 30 | twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o |
| 28 | salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o | 31 | salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o |
| 32 | serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o | ||
| 29 | 33 | ||
| 30 | aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o | 34 | aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o |
| 31 | 35 | ||
diff --git a/arch/x86/crypto/serpent-sse2-i586-asm_32.S b/arch/x86/crypto/serpent-sse2-i586-asm_32.S new file mode 100644 index 000000000000..4e37677ca851 --- /dev/null +++ b/arch/x86/crypto/serpent-sse2-i586-asm_32.S | |||
| @@ -0,0 +1,638 @@ | |||
| 1 | /* | ||
| 2 | * Serpent Cipher 4-way parallel algorithm (i586/SSE2) | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | ||
| 5 | * | ||
| 6 | * Based on crypto/serpent.c by | ||
| 7 | * Copyright (C) 2002 Dag Arne Osvik <osvik@ii.uib.no> | ||
| 8 | * 2003 Herbert Valerio Riedel <hvr@gnu.org> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, | ||
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | * GNU General Public License for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License | ||
| 21 | * along with this program; if not, write to the Free Software | ||
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
| 23 | * USA | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | .file "serpent-sse2-i586-asm_32.S" | ||
| 28 | .text | ||
| 29 | |||
| 30 | #define arg_ctx 4 | ||
| 31 | #define arg_dst 8 | ||
| 32 | #define arg_src 12 | ||
| 33 | #define arg_xor 16 | ||
| 34 | |||
| 35 | /********************************************************************** | ||
| 36 | 4-way SSE2 serpent | ||
| 37 | **********************************************************************/ | ||
| 38 | #define CTX %edx | ||
| 39 | |||
| 40 | #define RA %xmm0 | ||
| 41 | #define RB %xmm1 | ||
| 42 | #define RC %xmm2 | ||
| 43 | #define RD %xmm3 | ||
| 44 | #define RE %xmm4 | ||
| 45 | |||
| 46 | #define RT0 %xmm5 | ||
| 47 | #define RT1 %xmm6 | ||
| 48 | |||
| 49 | #define RNOT %xmm7 | ||
| 50 | |||
| 51 | #define get_key(i, j, t) \ | ||
| 52 | movd (4*(i)+(j))*4(CTX), t; \ | ||
| 53 | pshufd $0, t, t; | ||
| 54 | |||
| 55 | #define K(x0, x1, x2, x3, x4, i) \ | ||
| 56 | get_key(i, 0, x4); \ | ||
| 57 | get_key(i, 1, RT0); \ | ||
| 58 | get_key(i, 2, RT1); \ | ||
| 59 | pxor x4, x0; \ | ||
| 60 | pxor RT0, x1; \ | ||
| 61 | pxor RT1, x2; \ | ||
| 62 | get_key(i, 3, x4); \ | ||
| 63 | pxor x4, x3; | ||
| 64 | |||
| 65 | #define LK(x0, x1, x2, x3, x4, i) \ | ||
| 66 | movdqa x0, x4; \ | ||
| 67 | pslld $13, x0; \ | ||
| 68 | psrld $(32 - 13), x4; \ | ||
| 69 | por x4, x0; \ | ||
| 70 | pxor x0, x1; \ | ||
| 71 | movdqa x2, x4; \ | ||
| 72 | pslld $3, x2; \ | ||
| 73 | psrld $(32 - 3), x4; \ | ||
