Re: [PATCH 2/3] [eSTREAM] stream: Wrapper for eSTREAM ciphers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 14, 2007 at 01:25:37AM +0800, Tan Swee Heng wrote:
>
> In fact, my "stream" template patch uses blkcipher in the same way.
> However unlike "cbc" and "ctr", "stream" cannot process the IV. It
> must pass it to the underlying eSTREAM cipher's setiv() because each
> cipher's setiv() manipulates the IV differently. (Salsa20 uses it in a
> counter block; other eSTREAM ciphers mix the IV with the key in their
> key expansion.)

I think we're talking past each other :)

What I'm suggesting is that you implement the stream ciphers that
use an IV directly using the blkcipher interface, and not the cipher
interface.  That way you can do whatever you want with the IV.

> So blkcipher is indeed fine for stream ciphers as you stated - I even
> use it in "stream". The problem is that cipher_alg and cipher_tfm do
> not have callbacks for eSTREAM ciphers to expose setiv(). The
> "estream" patch tries to address this issue by introducing
> crypto_estream_type, estream_alg and estream_tfm.

That's right.  Apart from Salsa you shouldn't have to use the cipher
interface at all.  Which means that what the cipher interface lacks
is not a problem :)

Salsa can use the cipher interface because deep down it's a block
cipher.  It's just being used in counter mode.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux