public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: twofish-avx - remove useless instruction
@ 2012-07-05 18:43 Johannes Goetzfried
  2012-07-05 23:46 ` Henrique de Moraes Holschuh
  2012-07-11  3:26 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Goetzfried @ 2012-07-05 18:43 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-kernel, linux-crypto

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 <Johannes.Goetzfried@informatik.stud.uni-erlangen.de>
---
 arch/x86/crypto/twofish-avx-x86_64-asm_64.S |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
index fc31b89..35f4557 100644
--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
@@ -243,7 +243,6 @@ __twofish_enc_blk_8way:
 	popq %rbx;
 
 	leaq (4*4*4)(%rsi), %rax;
-	leaq (4*4*4)(%rax), %rdx;
 
 	testb %cl, %cl;
 	jnz __enc_xor8;
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: twofish-avx - remove useless instruction
  2012-07-05 18:43 [PATCH] crypto: twofish-avx - remove useless instruction Johannes Goetzfried
@ 2012-07-05 23:46 ` Henrique de Moraes Holschuh
  2012-07-06  0:13   ` Johannes Goetzfried
  2012-07-11  3:26 ` Herbert Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2012-07-05 23:46 UTC (permalink / raw)
  To: Johannes Goetzfried; +Cc: Herbert Xu, linux-kernel, linux-crypto

On Thu, 05 Jul 2012, Johannes Goetzfried wrote:
> The register %rdx is written, but never read till the end of the encryption
> routine. Therefore let's delete the useless instruction.

Is it useless, or is it there to harden against some side-channel
attack?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: twofish-avx - remove useless instruction
  2012-07-05 23:46 ` Henrique de Moraes Holschuh
@ 2012-07-06  0:13   ` Johannes Goetzfried
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Goetzfried @ 2012-07-06  0:13 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: Herbert Xu, linux-kernel, linux-crypto

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 in the end.
The instruction didn't have any purpose regarding side-channel attacks. In the
decryption routine the instruction has been correctly deleted in the same
place.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: twofish-avx - remove useless instruction
  2012-07-05 18:43 [PATCH] crypto: twofish-avx - remove useless instruction Johannes Goetzfried
  2012-07-05 23:46 ` Henrique de Moraes Holschuh
@ 2012-07-11  3:26 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2012-07-11  3:26 UTC (permalink / raw)
  To: Johannes Goetzfried; +Cc: linux-kernel, linux-crypto

On Thu, Jul 05, 2012 at 08:43:58PM +0200, Johannes Goetzfried wrote:
> 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 <Johannes.Goetzfried@informatik.stud.uni-erlangen.de>

Patch applied.  Thanks!
-- 
Email: Herbert Xu <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] 4+ messages in thread

end of thread, other threads:[~2012-07-11  3:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-05 18:43 [PATCH] crypto: twofish-avx - remove useless instruction Johannes Goetzfried
2012-07-05 23:46 ` Henrique de Moraes Holschuh
2012-07-06  0:13   ` Johannes Goetzfried
2012-07-11  3:26 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox