linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Binoy Jayan <binoy.jayan@linaro.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Milan Broz <gmazyland@gmail.com>, Oded <oded.golombek@arm.com>,
	Ofir <Ofir.Drang@arm.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	dm-devel@redhat.com, Shaohua Li <shli@kernel.org>,
	linux-raid@vger.kernel.org, Rajendra <rnayak@codeaurora.org>
Subject: Re: [RFC PATCH v2] crypto: Add IV generation algorithms
Date: Thu, 5 Jan 2017 11:36:52 +0530	[thread overview]
Message-ID: <CAHv-k_9G=iWe_CWNEcKxq0Q1=XhUAPDE88NvvkCOu5q=pNSgrA@mail.gmail.com> (raw)
In-Reply-To: <20170102065325.GA19553@gondor.apana.org.au>

Hi Herbert,

On 2 January 2017 at 12:23, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Mon, Jan 02, 2017 at 12:16:45PM +0530, Binoy Jayan wrote:
>
> Right.  The actual number of underlying tfms that do the work
> won't change compared to the status quo.  We're just structuring
> it such that if the overall scheme is supported by the hardware
> then we can feed more than one sector at a time to it.

I was thinking of continuing to have the iv generation algorithms as template
ciphers instead of regular 'skcipher' as it is easier to inherit the parameters
from the underlying cipher (e.g. aes) like cra_blocksize, cra_alignmask,
ivsize, chunksize etc.

Usually, the underlying cipher for the template ciphers are instantiated
in the following function:

skcipher_instance:skcipher_alg:init()

Since the number of such cipher instances depend on the key count, which is
not known at the time of creation of the cipher (it's passed to as an argument
to the setkey api), the creation of those have to be delayed until the setkey
operation of the template cipher. But as Mark pointed out, the users of this
cipher may get confused if the creation of the underlying cipher fails while
trying to do a 'setkey' on the template cipher. I was wondering if I can create
a single instance of the cipher and assign it to tfms[0] and allocate the
remaining instances when the setkey operation is called later with the encoded
key_count so that errors during cipher creation are uncovered earlier.

Thanks,
Binoy

  parent reply	other threads:[~2017-01-05  6:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  8:49 [RFC PATCH v2] IV Generation algorithms for dm-crypt Binoy Jayan
2016-12-13  8:49 ` [RFC PATCH v2] crypto: Add IV generation algorithms Binoy Jayan
2016-12-13 10:01   ` Milan Broz
2016-12-14  6:09     ` Binoy Jayan
2016-12-16  5:55     ` Binoy Jayan
2016-12-22  8:55     ` Herbert Xu
2016-12-22 10:55       ` Binoy Jayan
2016-12-23  7:51         ` Herbert Xu
2016-12-29  9:23           ` Binoy Jayan
2016-12-30 10:27             ` Herbert Xu
2017-01-02  6:46               ` Binoy Jayan
2017-01-02  6:53                 ` Herbert Xu
2017-01-02  7:05                   ` Binoy Jayan
2017-01-05  6:06                   ` Binoy Jayan [this message]
2017-01-03 14:23   ` Gilad Ben-Yossef
2017-01-04  5:20     ` Binoy Jayan
2017-01-11 14:55   ` Ondrej Mosnáček

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='CAHv-k_9G=iWe_CWNEcKxq0Q1=XhUAPDE88NvvkCOu5q=pNSgrA@mail.gmail.com' \
    --to=binoy.jayan@linaro.org \
    --cc=Ofir.Drang@arm.com \
    --cc=agk@redhat.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dm-devel@redhat.com \
    --cc=gmazyland@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=oded.golombek@arm.com \
    --cc=rnayak@codeaurora.org \
    --cc=shli@kernel.org \
    --cc=snitzer@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).