[dm-devel] [PATCH] crypto/arc4: convert this stream cipher into a block cipher
Herbert Xu
herbert at gondor.apana.org.au
Sun Mar 14 09:06:23 UTC 2010
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.
First add a new arc4 blkcipher, then convert the users, and
finally delete the old arc4.
> static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key,
> unsigned int key_len)
> {
> - struct arc4_ctx *ctx = crypto_tfm_ctx(tfm);
> + /*
> + * ARC4 is special: The user should supply an IV as struct arc4_iv and
> + * fill either the key or the iv.
> + */
> + return -EOPNOTSUPP;
> +}
You should return 0 here. You should also set the min/max key
size to zero. The new arc4 no longer has a key as far as the
API is concerned.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the dm-devel
mailing list