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 <herb...@gondor.apana.org.au>
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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to