[PATCH 6/6] crypto: cast6 - add x86_64/avx assembler implementation

2012-07-11 Thread Johannes Goetzfried
: Johannes Goetzfried --- arch/x86/crypto/Makefile |2 + arch/x86/crypto/cast6-avx-x86_64-asm_64.S | 336 +++ arch/x86/crypto/cast6_avx_glue.c | 648 + crypto/Kconfig| 17 + crypto/testmgr.c

[PATCH 4/6] crypto: cast6 - prepare generic module for optimized implementations

2012-07-11 Thread Johannes Goetzfried
Rename cast6 module to cast6_generic to allow autoloading of optimized implementations. Generic functions and s-boxes are exported to be able to use them within optimized implementations. Signed-off-by: Johannes Goetzfried --- crypto/Makefile|2 +- crypto/cast6.c | 547

[PATCH 2/6] crypto: testmgr - add larger cast5 testvectors

2012-07-11 Thread Johannes Goetzfried
New ECB, CBC and CTR testvectors for cast5. We need larger testvectors to check parallel code paths in the optimized implementation. Tests have also been added to the tcrypt module. Signed-off-by: Johannes Goetzfried --- crypto/tcrypt.c | 32 +++ crypto/tcrypt.h |1 + crypto/testmgr.c

[PATCH 3/6] crypto: cast5 - add x86_64/avx assembler implementation

2012-07-11 Thread Johannes Goetzfried
2.32x 0.95x 2.35x 2.39x 2.39x Signed-off-by: Johannes Goetzfried --- arch/x86/crypto/Makefile |2 + arch/x86/crypto/cast5-avx-x86_64-asm_64.S | 323 ++ arch/x86/crypto/cast5_avx_glue.c | 530 + crypto/Kconfig

[PATCH 0/6] crypto: add x86_64/avx assembler implementation of cast5 and cast6

2012-07-11 Thread Johannes Goetzfried
This patchset adds x86_64/avx assembler implementations of the Cast5 and the Cast6 cipher. Johannes Goetzfried (6): crypto: cast5 - prepare generic module for optimized implementations crypto: testmgr - add larger cast5 testvectors crypto: cast5 - add x86_64/avx assembler implementation

Re: [PATCH] crypto: twofish-avx - remove useless instruction

2012-07-05 Thread Johannes Goetzfried
On Thu, Jul 05, 2012 at 08:46:12PM -0300, Henrique de Moraes Holschuh wrote: > Is it useless, or is it there to harden against some side-channel > attack? When writing this implementation, I first had a different approach with more data getting read in and I just forgot to delete this instruction

[PATCH] crypto: twofish-avx - remove useless instruction

2012-07-05 Thread Johannes Goetzfried
The register %rdx is written, but never read till the end of the encryption routine. Therefore let's delete the useless instruction. Signed-off-by: Johannes Goetzfried --- arch/x86/crypto/twofish-avx-x86_64-asm_64.S |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a

Re: linux-next: Tree for Jun 13 (crypto)

2012-06-13 Thread Johannes Goetzfried
On Wed, Jun 13, 2012 at 08:03:17PM +0300, Jussi Kivilinna wrote: > >arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_decrypt': > >(.text+0x856c): multiple definition of `serpent_xts_decrypt' > >arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xae8): first defined here > > Reverting comm

Re: [PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-30 Thread Johannes Goetzfried
On Wed, May 30, 2012 at 06:26:45PM +0200, Andi Kleen wrote: > > I tried to be consistent with the existing ciphers in arch/x86/crypto. > > In serpent_sse2_glue.c and sha1_ssse3_glue.c it is done exactly that way, > > so if > > it will be decided to remove the printk in this patch it probably shoul

Re: [PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-30 Thread Johannes Goetzfried
On Wed, May 30, 2012 at 05:39:49PM +0200, Andi Kleen wrote: > > I agree with that. Currently when I boot my PC with a new 3.4 kernel all the > > ciphers from the intel-aesni module get loaded whether I need them or not. > > As > > Jussi stated most people using distros probably won't need the > >

Re: [PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-30 Thread Johannes Goetzfried
On Tue, May 29, 2012 at 07:27:43PM -0700, Andi Kleen wrote: > Also drivers should never print anything when they cannot find hardware. > Remove that printk. I tried to be consistent with the existing ciphers in arch/x86/crypto. In serpent_sse2_glue.c and sha1_ssse3_glue.c it is done exactly that w

Re: [PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-30 Thread Johannes Goetzfried
On Wed, May 30, 2012 at 10:30:25AM +0300, Jussi Kivilinna wrote: > Quoting Andi Kleen : > > > > >The driver needs CPUID annotations now (since 3.3), so that it can be > >autoloaded. Something like: > > > > Is it really good idea to autoload crypto modules? Currently loading > different cipher im

[PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-28 Thread Johannes Goetzfried
): 128bit 256bit ecb-enc 1.26x 1.73x ecb-dec 1.20x 1.64x cbc-enc 0.33x 0.45x cbc-dec 1.24x 1.67x ctr-enc 1.32x 1.76x ctr-dec 1.32x 1.76x lrw-enc 1.20x 1.60x lrw-dec 1.15x 1.54x xts-enc 1.22x 1.64x xts-dec 1.17x 1.57x Signed-off-by: Johannes Goetzfried --- arch/x86

Re: [PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-28 Thread Johannes Goetzfried
Hello, > Should be serpent_sse2_glue.c? Yeah, same error as in the other patch :-) > >+}, { > >+.cra_name = "ecb(serpent)", > >+.cra_driver_name= "ecb-serpent-avx", > >+.cra_priority = 400, > > serpent_sse2_glue.c has priority 400 too, so you should i

[PATCH] crypto: testmgr - expand twofish test vectors

2012-05-28 Thread Johannes Goetzfried
The AVX implementation of the twofish cipher processes 8 blocks parallel, so we need to make test vectors larger to check parallel code paths. Test vectors are also large enough to deal with 16 block parallel implementations which may occur in the future. Signed-off-by: Johannes Goetzfried

[PATCH] crypto: twofish - add x86_64/avx assembler implementation

2012-05-28 Thread Johannes Goetzfried
-dec 1.16x 1.56x Signed-off-by: Johannes Goetzfried --- arch/x86/crypto/Makefile|2 + arch/x86/crypto/twofish-avx-x86_64-asm_64.S | 302 arch/x86/crypto/twofish_avx_glue.c | 1086 +++ arch/x86/crypto/twofish_glue_3way.c

Re: [PATCH] crypto: twofish - add x86_64/avx assembler implementation

2012-05-28 Thread Johannes Goetzfried
Hello, > It would be benefical to expand the twofish vectors in > crypto/testmgr.h from 3 blocks > to 8 blocks so that 8-way algorithm(s) can be checked runtime. And > while at expanding > test-vectors, why not just expand to 16 blocks... AVX2 is just one year away: > https://github.com/jkivilin/c

[PATCH] crypto: serpent - add x86_64/avx assembler implementation

2012-05-27 Thread Johannes Goetzfried
): 128bit 256bit ecb-enc 1.26x 1.73x ecb-dec 1.20x 1.64x cbc-enc 0.33x 0.45x cbc-dec 1.24x 1.67x ctr-enc 1.32x 1.76x ctr-dec 1.32x 1.76x lrw-enc 1.20x 1.60x lrw-dec 1.15x 1.54x xts-enc 1.22x 1.64x xts-dec 1.17x 1.57x Signed-off-by: Johannes Goetzfried --- arch/x86

[PATCH] crypto: twofish - add x86_64/avx assembler implementation

2012-05-27 Thread Johannes Goetzfried
-dec 1.16x 1.56x Signed-off-by: Johannes Goetzfried --- arch/x86/crypto/Makefile|2 + arch/x86/crypto/twofish-avx-x86_64-asm_64.S | 302 arch/x86/crypto/twofish_avx_glue.c | 1086 +++ arch/x86/crypto/twofish_glue_3way.c