Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-03-14 Thread Herbert Xu
On Sun, Mar 14, 2010 at 09:24:32AM +0100, Sebastian Andrzej Siewior wrote: > > Okay. So so are we talking about something like that below then? This is Pretty much. > untested and I break other users bexcept lib80211_crypt_tkip. For the sake of compatibility please do this as a 3-step dance. F

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-03-14 Thread Sebastian Andrzej Siewior
* Herbert Xu | 2010-02-23 08:32:39 [+0800]: >If you can find a way that allows arc4 to be used by multiple >threads at the same time while storing less than 258 bytes in >each thread, please let me know :) :) >No, what you could do is structure the IV differently based on the >flag: > >struct arc

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-22 Thread Herbert Xu
On Mon, Feb 22, 2010 at 11:08:35PM +0100, Sebastian Andrzej Siewior wrote: > * Herbert Xu | 2010-02-22 08:52:17 [+0800]: > > >On Mon, Feb 22, 2010 at 08:45:47AM +0800, Herbert Xu wrote: > >> > >> How about this? You extend the IV by one more byte, and use that > >> byte as a boolean flag to indic

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-22 Thread Herbert Xu
On Mon, Feb 22, 2010 at 02:40:49PM -0500, Mikulas Patocka wrote: > > > So what we could do is simply add a new blkcipher arc4, alongside > > the existing cipher arc4. Then we can convert the existing users > > across, and finally remove the old arc4. > > arc4 can't be used as a block cipher --- s

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-22 Thread Sebastian Andrzej Siewior
* Herbert Xu | 2010-02-22 08:52:17 [+0800]: >On Mon, Feb 22, 2010 at 08:45:47AM +0800, Herbert Xu wrote: >> >> How about this? You extend the IV by one more byte, and use that >> byte as a boolean flag to indicate whether the IV is valid. All So I trick the crypto api to allocate more bytes than

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-22 Thread Mikulas Patocka
On Tue, 16 Feb 2010, Herbert Xu wrote: > On Fri, Feb 12, 2010 at 09:42:28AM +0100, Sebastian Andrzej Siewior wrote: > > > > -static void arc4_crypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) > > +static void arc4_ivsetup(struct arc4_ctx *ctx, u8 *iv) > > { > > - struct arc4_ctx *ctx = cry

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-21 Thread Herbert Xu
On Mon, Feb 22, 2010 at 08:45:47AM +0800, Herbert Xu wrote: > > How about this? You extend the IV by one more byte, and use that > byte as a boolean flag to indicate whether the IV is valid. All > users that cannot supply their own IVs can then set the IV to zero. > > When you see the zero flag

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-21 Thread Herbert Xu
On Sun, Feb 21, 2010 at 09:01:40PM +0100, Sebastian Andrzej Siewior wrote: > > I also destroy the user supplied IV. You don't care about that? :) > So I have to know that someone called setkey() on this ctx but I can't > leave hints. How about this? You extend the IV by one more byte, and use that

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-21 Thread Sebastian Andrzej Siewior
* Herbert Xu | 2010-02-16 20:51:25 [+0800]: >On Fri, Feb 12, 2010 at 09:42:28AM +0100, Sebastian Andrzej Siewior wrote: >> >> -static void arc4_crypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) >> +static void arc4_ivsetup(struct arc4_ctx *ctx, u8 *iv) >> { >> -struct arc4_ctx *ctx = crypt

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-16 Thread Herbert Xu
On Fri, Feb 12, 2010 at 09:42:28AM +0100, Sebastian Andrzej Siewior wrote: > > -static void arc4_crypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) > +static void arc4_ivsetup(struct arc4_ctx *ctx, u8 *iv) > { > - struct arc4_ctx *ctx = crypto_tfm_ctx(tfm); > + if (unlikely(!ctx->new_key

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-15 Thread Sebastian Andrzej Siewior
* Herbert Xu | 2010-02-15 08:10:08 [+0800]: >How about we just remove it? It's not on a hot path anyway. Sure. >I can do this when integrating the patch so you don't have to >resend. Okay, thanks. >Thanks, Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in t

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-14 Thread Herbert Xu
On Sun, Feb 14, 2010 at 09:42:54PM +0100, Sebastian Andrzej Siewior wrote: > * Sebastian Andrzej Siewior | 2010-02-12 09:42:28 [+0100]: > > >+static void arc4_ivsetup(struct arc4_ctx *ctx, u8 *iv) > > { > >-struct arc4_ctx *ctx = crypto_tfm_ctx(tfm); > >+if (unlikely(!ctx->new_key)) > > T

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-14 Thread Sebastian Andrzej Siewior
* Sebastian Andrzej Siewior | 2010-02-12 09:42:28 [+0100]: >+static void arc4_ivsetup(struct arc4_ctx *ctx, u8 *iv) > { >- struct arc4_ctx *ctx = crypto_tfm_ctx(tfm); >+ if (unlikely(!ctx->new_key)) That should be likely(). Do you want me resend the whole thing? Haven't noticed anything

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-12 Thread Sebastian Andrzej Siewior
* Adrian-Ken Rueegsegger | 2010-02-12 10:34:27 [+0100]: >Hi, Hi, >Sebastian Andrzej Siewior schrieb: >> The name is still ecb(aes) but since this is provided by the blkcipher >> itself, >Just to avoid any confusion you meant ecb(arc4) not ecb(aes) here right? Yes, I do. Not sure how I got aes i

Re: [PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-12 Thread Adrian-Ken Rueegsegger
Hi, Sebastian Andrzej Siewior schrieb: > the state has been moved from ctx into iv. That way encrypt()/decrypt() can > deliver the same result for a given IV. This patch makes the cipher work with > dm-crypt not that it is a good thing. However, the performance may have > improved :) > The name is

[PATCH] crypto/arc4: convert this stream cipher into a block cipher

2010-02-12 Thread Sebastian Andrzej Siewior
the state has been moved from ctx into iv. That way encrypt()/decrypt() can deliver the same result for a given IV. This patch makes the cipher work with dm-crypt not that it is a good thing. However, the performance may have improved :) The name is still ecb(aes) but since this is provided by the