From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org,
Sebastian Siewior <linux-crypto@ml.breakpoint.cc>
Subject: Re: IV copy strategy
Date: Mon, 19 Nov 2007 13:38:41 +0300 [thread overview]
Message-ID: <20071119103840.GC2048@2ka.mipt.ru> (raw)
In-Reply-To: <20071118065237.GA26456@gondor.apana.org.au>
On Sun, Nov 18, 2007 at 02:52:37PM +0800, Herbert Xu (herbert@gondor.apana.org.au) wrote:
> On Fri, Nov 16, 2007 at 02:11:10PM +0300, Evgeniy Polyakov wrote:
> >
> > That's a question - should it copy IV back or not?
> > Currently it is not required by crypto users.
>
> OK I've changed my mind :)
>
> The reason is CTR, or rather the CTR as used by IPsec. CTR
> itself should be able to chain, in fact one of the things I'll
> do later is to move most of the current CTR code into a chainable
> CTR with just the algorithm parameter, i.e., ctr(aes) which would
> be what we currently call ctr(0,16,16). We can then put a non-
> chainable wrapper around that, perhaps ctr-ipsec(aes).
>
> In any case, it is clear that some algorithms simply won't be
> able to chain because the IV exposed to the outside is not the
> complete IV.
>
> So my plan is to add a new flag, CRYPTO_ALG_CIPHER_NOCHAIN that
> you would set on algorithms that cannot be chained. The semantics
> is that everything else remains the same except that on encrypt
> calls, the req->info after completion is undefined.
>
> Users requiring chaining would then do
>
> crypto_alloc_blkcipher("foo", 0, CRYPTO_ALG_CIPHER_NOCHAIN)
Hmm, users who want chaining will set flag _NOCHAIN :)
I would call it something more informative...
> For hardware offload devices such as yours where chaining does
> not come naturally you could then elect to not implement chaining
> and just set the flag.
>
> Please let me know if you see any problems with this approach.
I'm not sure what user will do, when it request chaining, but driver
will set CRYPTO_ALG_CIPHER_NOCHAIN itself and return wrong/old in
req->info?
For IPsec it is not an issue though, but I can not say that for all.
--
Evgeniy Polyakov
next prev parent reply other threads:[~2007-11-19 10:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 23:11 IV copy strategy Sebastian Siewior
2007-11-14 14:22 ` Herbert Xu
2007-11-15 21:10 ` Sebastian Siewior
2007-11-16 2:08 ` Herbert Xu
2007-11-16 8:19 ` Sebastian Siewior
2007-11-16 9:30 ` Herbert Xu
2007-11-16 11:11 ` Evgeniy Polyakov
2007-11-16 11:25 ` Herbert Xu
2007-11-16 11:42 ` Evgeniy Polyakov
2007-11-16 13:47 ` Herbert Xu
2007-11-18 6:52 ` Herbert Xu
2007-11-18 6:53 ` Herbert Xu
2007-11-19 10:38 ` Evgeniy Polyakov [this message]
2007-11-19 11:56 ` Herbert Xu
2007-11-20 14:23 ` Evgeniy Polyakov
2007-11-26 9:10 ` Sebastian Siewior
2007-11-15 21:23 ` [PATCH] [crypto] geode: do not copy the IV too often Sebastian Siewior
2007-11-18 13:41 ` Herbert Xu
2007-11-26 9:25 ` Sebastian Siewior
2007-11-26 9:28 ` Herbert Xu
2007-11-26 9:42 ` Sebastian Siewior
2007-11-27 19:33 ` Sebastian Siewior
2007-11-30 5:37 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071119103840.GC2048@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@ml.breakpoint.cc \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox