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: Thu, 2 Jun 2016 16:55:26 +0800	[thread overview]
Message-ID: <20160602085526.GA15919@gondor.apana.org.au> (raw)
In-Reply-To: <4593825.q48Y9K9RSZ@positron.chronox.de>

On Tue, May 31, 2016 at 01:52:32PM +0200, Stephan Mueller wrote:
>
> + * NOTE: Technically you can use one buffer for holding the label_context and
> + *	 the outbuf in the example above. Howerver, multiple rounds of the
> + *	 KDF are to be expected with the input must always be the same.
> + *	 The first round would replace the input in case of one buffer, and the
> + *	 KDF would calculate a cryptographically strong result which, however,
> + *	 is not portable to other KDF implementations! Thus, always use
> + *	 different buffers for the label_context and the outbuf. A safe
> + *	 in-place operation can only be done when only one round of the KDF
> + *	 is executed (i.e. the size of the requested buffer is equal to the
> + *	 digestsize of the used MAC).

Why don't you put the result in a temporary buffer and then copy
it? These things are tiny, right?

Cheers,
-- 
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-02  8:55 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 [this message]
2016-06-02 15:12     ` Stephan Mueller
2016-06-08  3:13       ` Herbert Xu
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=20160602085526.GA15919@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