* [PATCH] i386 aes asm typo fix
@ 2005-11-24 13:07 Denis Vlasenko
2005-11-29 11:24 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Denis Vlasenko @ 2005-11-24 13:07 UTC (permalink / raw)
To: Herbert Xu; +Cc: Linux kernel
[-- Attachment #1: Type: text/plain, Size: 94 bytes --]
* fix typo (128 -> 192,256 bits)
* nano-optimization (copied from x86_86)
Run tested.
--
vda
[-- Attachment #2: aes-i586-asm.patch --]
[-- Type: text/x-diff, Size: 4043 bytes --]
* fix typo (128 -> 192,256 bits)
* nano-optimization (taken from x86_86)
Run tested:
2005-11-24_12:51:47.65292 kern.info: testing tnepres ECB decryption across pages (chunking)
2005-11-24_12:51:47.65295 kern.info:
2005-11-24_12:51:47.65298 kern.info: testing aes ECB encryption
2005-11-24_12:51:47.91579 kern.info: test 1 (128 bit key):
2005-11-24_12:51:47.91599 kern.info: 69c4e0d86a7b0430d8cdb78070b4c55a
2005-11-24_12:51:47.91602 kern.info: pass
2005-11-24_12:51:47.91605 kern.info: test 2 (192 bit key):
2005-11-24_12:51:47.91608 kern.info: dda97ca4864cdfe06eaf70a0ec0d7191
2005-11-24_12:51:47.91611 kern.info: pass
2005-11-24_12:51:47.91613 kern.info: test 3 (256 bit key):
2005-11-24_12:51:47.91616 kern.info: 8ea2b7ca516745bfeafc49904b496089
2005-11-24_12:51:47.91620 kern.info: pass
2005-11-24_12:51:47.91622 kern.info:
2005-11-24_12:51:47.91625 kern.info: testing aes ECB encryption across pages (chunking)
2005-11-24_12:51:47.91629 kern.info:
2005-11-24_12:51:47.91631 kern.info: testing aes ECB decryption
2005-11-24_12:51:47.91634 kern.info: test 1 (128 bit key):
2005-11-24_12:51:47.91637 kern.info: 00112233445566778899aabbccddeeff
2005-11-24_12:51:47.91640 kern.info: pass
2005-11-24_12:51:47.91643 kern.info: test 2 (192 bit key):
2005-11-24_12:51:47.91646 kern.info: 00112233445566778899aabbccddeeff
2005-11-24_12:51:47.91649 kern.info: pass
2005-11-24_12:51:47.91652 kern.info: test 3 (256 bit key):
2005-11-24_12:51:47.91655 kern.info: 00112233445566778899aabbccddeeff
2005-11-24_12:51:47.91658 kern.info: pass
2005-11-24_12:51:47.91660 kern.info:
2005-11-24_12:51:47.91663 kern.info: testing aes ECB decryption across pages (chunking)
2005-11-24_12:51:47.91667 kern.info:
2005-11-24_12:51:47.91669 kern.info: testing cast5 ECB encryption
--- linux-2.6.14.org/arch/i386/crypto/aes-i586-asm.S.org Mon Aug 29 02:41:01 2005
+++ linux-2.6.14.org/arch/i386/crypto/aes-i586-asm.S Thu Nov 24 12:44:52 2005
@@ -255,18 +255,17 @@ aes_enc_blk:
xor 8(%ebp),%r4
xor 12(%ebp),%r5
- sub $8,%esp // space for register saves on stack
- add $16,%ebp // increment to next round key
- sub $10,%r3
- je 4f // 10 rounds for 128-bit key
- add $32,%ebp
- sub $2,%r3
- je 3f // 12 rounds for 128-bit key
- add $32,%ebp
+ sub $8,%esp // space for register saves on stack
+ add $16,%ebp // increment to next round key
+ cmp $12,%r3
+ jb 4f // 10 rounds for 128-bit key
+ lea 32(%ebp),%ebp
+ je 3f // 12 rounds for 192-bit key
+ lea 32(%ebp),%ebp
-2: fwd_rnd1( -64(%ebp) ,ft_tab) // 14 rounds for 128-bit key
+2: fwd_rnd1( -64(%ebp) ,ft_tab) // 14 rounds for 256-bit key
fwd_rnd2( -48(%ebp) ,ft_tab)
-3: fwd_rnd1( -32(%ebp) ,ft_tab) // 12 rounds for 128-bit key
+3: fwd_rnd1( -32(%ebp) ,ft_tab) // 12 rounds for 192-bit key
fwd_rnd2( -16(%ebp) ,ft_tab)
4: fwd_rnd1( (%ebp) ,ft_tab) // 10 rounds for 128-bit key
fwd_rnd2( +16(%ebp) ,ft_tab)
@@ -334,18 +333,17 @@ aes_dec_blk:
xor 8(%ebp),%r4
xor 12(%ebp),%r5
- sub $8,%esp // space for register saves on stack
- sub $16,%ebp // increment to next round key
- sub $10,%r3
- je 4f // 10 rounds for 128-bit key
- sub $32,%ebp
- sub $2,%r3
- je 3f // 12 rounds for 128-bit key
- sub $32,%ebp
+ sub $8,%esp // space for register saves on stack
+ sub $16,%ebp // increment to next round key
+ cmp $12,%r3
+ jb 4f // 10 rounds for 128-bit key
+ lea -32(%ebp),%ebp
+ je 3f // 12 rounds for 192-bit key
+ lea -32(%ebp),%ebp
-2: inv_rnd1( +64(%ebp), it_tab) // 14 rounds for 128-bit key
+2: inv_rnd1( +64(%ebp), it_tab) // 14 rounds for 256-bit key
inv_rnd2( +48(%ebp), it_tab)
-3: inv_rnd1( +32(%ebp), it_tab) // 12 rounds for 128-bit key
+3: inv_rnd1( +32(%ebp), it_tab) // 12 rounds for 192-bit key
inv_rnd2( +16(%ebp), it_tab)
4: inv_rnd1( (%ebp), it_tab) // 10 rounds for 128-bit key
inv_rnd2( -16(%ebp), it_tab)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i386 aes asm typo fix
2005-11-24 13:07 [PATCH] i386 aes asm typo fix Denis Vlasenko
@ 2005-11-29 11:24 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2005-11-29 11:24 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Linux kernel
On Thu, Nov 24, 2005 at 03:07:01PM +0200, Denis Vlasenko wrote:
> * fix typo (128 -> 192,256 bits)
> * nano-optimization (copied from x86_86)
>
> Run tested.
Patch looks good. I've applied it to cryptodev. Thanks Denis.
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-29 11:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-24 13:07 [PATCH] i386 aes asm typo fix Denis Vlasenko
2005-11-29 11:24 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®