Re: [PATCH] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32

2012-05-31 Thread Mathias Krause
On Thu, May 31, 2012 at 7:27 AM, Herbert Xu herb...@gondor.apana.org.au wrote: On Wed, May 30, 2012 at 01:43:08AM +0200, Mathias Krause wrote: The 32 bit variant of cbc(aes) decrypt is using instructions requiring 128 bit aligned memory locations but fails to ensure this constraint in the

Re: [PATCH] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32

2012-05-31 Thread Herbert Xu
On Thu, May 31, 2012 at 08:45:58AM +0200, Mathias Krause wrote: No, but the latter will likely be much slower as it would need to memmove the data if it's not aligned, right? Most crypto users should already be providing aligned data. After all, padlock-aes requires 16-byte alignment and it

Re: [PATCH] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32

2012-05-31 Thread Herbert Xu
On Wed, May 30, 2012 at 01:43:08AM +0200, Mathias Krause wrote: The 32 bit variant of cbc(aes) decrypt is using instructions requiring 128 bit aligned memory locations but fails to ensure this constraint in the code. Fix this by loading the data into intermediate registers with load unaligned

Re: [PATCH] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32

2012-05-30 Thread Herbert Xu
On Wed, May 30, 2012 at 01:43:08AM +0200, Mathias Krause wrote: The 32 bit variant of cbc(aes) decrypt is using instructions requiring 128 bit aligned memory locations but fails to ensure this constraint in the code. Fix this by loading the data into intermediate registers with load unaligned

[PATCH] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32

2012-05-29 Thread Mathias Krause
The 32 bit variant of cbc(aes) decrypt is using instructions requiring 128 bit aligned memory locations but fails to ensure this constraint in the code. Fix this by loading the data into intermediate registers with load unaligned instructions. This fixes reported general protection faults related