mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUGFIX 1/3] crypto: Fix AES-NI cbc mode IV saving
@ 2009-06-15  9:04 Huang Ying
  2009-06-18 11:45 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Huang Ying @ 2009-06-15  9:04 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-kernel, linux-crypto

Original implementation of aesni_cbc_dec do not save IV if input
length % 4 == 0. This will make decryption of next block failed.

Signed-off-by: Huang Ying <ying.huang@intel.com>

---
 arch/x86/crypto/aesni-intel_asm.S |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/arch/x86/crypto/aesni-intel_asm.S
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -845,7 +845,7 @@ ENTRY(aesni_cbc_enc)
  */
 ENTRY(aesni_cbc_dec)
 	cmp $16, LEN
-	jb .Lcbc_dec_ret
+	jb .Lcbc_dec_just_ret
 	mov 480(KEYP), KLEN
 	add $240, KEYP
 	movups (IVP), IV
@@ -891,6 +891,7 @@ ENTRY(aesni_cbc_dec)
 	add $16, OUTP
 	cmp $16, LEN
 	jge .Lcbc_dec_loop1
-	movups IV, (IVP)
 .Lcbc_dec_ret:
+	movups IV, (IVP)
+.Lcbc_dec_just_ret:
 	ret



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

* Re: [BUGFIX 1/3] crypto: Fix AES-NI cbc mode IV saving
  2009-06-15  9:04 [BUGFIX 1/3] crypto: Fix AES-NI cbc mode IV saving Huang Ying
@ 2009-06-18 11:45 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2009-06-18 11:45 UTC (permalink / raw)
  To: Huang Ying; +Cc: linux-kernel, linux-crypto

On Mon, Jun 15, 2009 at 05:04:44PM +0800, Huang Ying wrote:
> Original implementation of aesni_cbc_dec do not save IV if input
> length % 4 == 0. This will make decryption of next block failed.
> 
> Signed-off-by: Huang Ying <ying.huang@intel.com>

All three patches applied to crypto-2.6.

Thanks,
-- 
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:[~2009-06-18 11:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-15  9:04 [BUGFIX 1/3] crypto: Fix AES-NI cbc mode IV saving Huang Ying
2009-06-18 11:45 ` 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®