Re: [patch/rfc] crypto: padlock-aes use crypto API

2007-08-02 Thread Herbert Xu
On Thu, Aug 02, 2007 at 03:09:33PM +0200, Sebastian Siewior wrote: > > If this is that important, isn't it better to add/ replace the current > _aligned call with such an optimized one? Or applies this kind of > optimization only to this special driver where it is very expensive > otherwise? In t

Re: [patch/rfc] crypto: padlock-aes use crypto API

2007-08-02 Thread Sebastian Siewior
* Herbert Xu | 2007-08-02 17:28:25 [+0800]: >On Thu, Aug 02, 2007 at 11:23:51AM +0200, Sebastian Siewior wrote: >> >> The only difference I can see is, that crypto_tfm_alg_alignmask() is >> replaced with a static defined number instead of a lookup in a struct. >> IS this the optimization? > >Yes,

Re: [crypto] fix writting into unallocated memory in setkey_aligned

2007-08-02 Thread Sebastian Siewior
* Sebastian Siewior | 2007-08-02 14:57:43 [+0200]: >setkey_unaligned() commited in ca7c39385ce1a7b44894a4b225a4608624e90730 >overwrites unallocated memory in the following memset() because I used the >wrong buffer length. Herbert, I am really sorry for introducing new bugs. Sebastian - To unsubs

[crypto] fix writting into unallocated memory in setkey_aligned

2007-08-02 Thread Sebastian Siewior
setkey_unaligned() commited in ca7c39385ce1a7b44894a4b225a4608624e90730 overwrites unallocated memory in the following memset() because I used the wrong buffer length. Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -35,7 +35,7 @@ static

Re: [patch] crypto: retrieve private ctx aligned

2007-08-02 Thread Herbert Xu
On Thu, Aug 02, 2007 at 09:47:58AM +0200, Sebastian Siewior wrote: > This is function does the same thing for ablkcipher that is done for > blkcipher by crypto_blkcipher_ctx_aligned(): it returns an aligned > address of the private ctx. > > Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> Pat

Re: [patch/rfc] crypto: padlock-aes use crypto API

2007-08-02 Thread Herbert Xu
On Thu, Aug 02, 2007 at 11:23:51AM +0200, Sebastian Siewior wrote: > > The only difference I can see is, that crypto_tfm_alg_alignmask() is > replaced with a static defined number instead of a lookup in a struct. > IS this the optimization? Yes, the fact that the alignment mask is a constant allo

Re: [patch/rfc] crypto: padlock-aes use crypto API

2007-08-02 Thread Sebastian Siewior
* Herbert Xu | 2007-08-02 16:58:16 [+0800]: >On Thu, Aug 02, 2007 at 10:10:09AM +0200, Sebastian Siewior wrote: >> It seems that the driver uses something like crypto_.*_ctx_aligned() of his >> own. >> Replace it with the API's functions. Compile tested. >> >> Signed-off-by: Sebastian Siewior <[

Re: [patch/rfc] crypto: padlock-aes use crypto API

2007-08-02 Thread Herbert Xu
On Thu, Aug 02, 2007 at 10:10:09AM +0200, Sebastian Siewior wrote: > It seems that the driver uses something like crypto_.*_ctx_aligned() of his > own. > Replace it with the API's functions. Compile tested. > > Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> Actually this is intentional as

[patch/rfc] crypto: padlock-aes use crypto API

2007-08-02 Thread Sebastian Siewior
It seems that the driver uses something like crypto_.*_ctx_aligned() of his own. Replace it with the API's functions. Compile tested. Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c @@ -297,30 +297,10 @@ aes_hw_extkey_avai

Re: Alignment in the API, once again

2007-08-02 Thread Herbert Xu
On Thu, Aug 02, 2007 at 09:41:22AM +0200, Sebastian Siewior wrote: > > Okey this makes sense. What about crypto_ctxsize()? Isn't a bug there? > I can't specify an alignmask of 16 (what I assumed yesterday after a > part of brain switched to sleep()) because this brakes the ALIGN() > macro. Isn't s

[patch] crypto: retrieve private ctx aligned

2007-08-02 Thread Sebastian Siewior
This is function does the same thing for ablkcipher that is done for blkcipher by crypto_blkcipher_ctx_aligned(): it returns an aligned address of the private ctx. Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -160,6 +160,11 @@

Re: Alignment in the API, once again

2007-08-02 Thread Sebastian Siewior
* Herbert Xu | 2007-08-02 10:30:06 [+0800]: >> I noticed this, after my code did not work properly. The reason was, >> that my private ctx was not retrieved with >> crypto_ablkcipher_ctx_aligned() (attached) but with >> crypto_ablkcipher_ctx() (and it was not properly aligned anymore). >> My fault