Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Stephan Mueller <smueller@chronox.de>
Cc: linux-crypto@vger.kernel.org, David Howells <dhowells@redhat.com>,
	Mat Martineau <mathew.j.martineau@linux.intel.com>,
	keyrings@vger.kernel.org
Subject: Re: [PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function
Date: Wed, 8 Jun 2016 11:13:34 +0800	[thread overview]
Message-ID: <20160608031334.GC12283@gondor.apana.org.au> (raw)
In-Reply-To: <20634336.6yV5j7Wfmz@tauon.atsec.com>

On Thu, Jun 02, 2016 at 05:12:20PM +0200, Stephan Mueller wrote:
>
> The KDFs are usually used for output sizes between one and 4 keys. So, 
> commonly it is expected that not more than 200 or 300 bytes are generated by 
> one call. But you cannot be sure how much data a user wants. The spec allows 
> that the user generates up to 2^50 or so bytes. The implementation I offer is 
> limited to unsigned int bytes.
> 
> Note, if one would implement a key ladder, it can be expected that many keys 
> are generated from one KDF seed.
> 
> I tried to avoid memcpy for speed purposes. And all the user needs to do is to 
> not invoke an in-place crypto operation.
> 
> Maybe I should copy the input data into a private memory location so that the 
> KDF can be used like any other cipher: the caller uses a reference to the 
> instance to generate data where the caller does not need to ensure that some 
> initial data must be left at some specific place.

OK.  I don't think the RNG API really guarantees that you can do
in-place generation anyway.  So don't even bother checking for
src == dst.

When you submit this again can you please send it along with a
user?

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-06-08  3:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 11:50 [PATCH v2 0/4] crypto: Key Derivation Function (SP800-108) Stephan Mueller
2016-05-31 11:51 ` [PATCH v2 1/4] crypto: add template handling for RNGs Stephan Mueller
2016-05-31 11:52 ` [PATCH v2 2/4] crypto: kdf - add known answer tests Stephan Mueller
2016-05-31 11:52 ` [PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function Stephan Mueller
2016-06-02  8:55   ` Herbert Xu
2016-06-02 15:12     ` Stephan Mueller
2016-06-08  3:13       ` Herbert Xu [this message]
2016-06-08  4:58         ` Stephan Mueller
2016-05-31 11:53 ` [PATCH v2 4/4] crypto: kdf - enable compilation Stephan Mueller
2016-06-02  8:56 ` [PATCH v2 0/4] crypto: Key Derivation Function (SP800-108) 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=20160608031334.GC12283@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=dhowells@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=smueller@chronox.de \
    /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