Re: [PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function

2016-06-07 Thread Stephan Mueller
Am Mittwoch, 8. Juni 2016, 11:13:34 schrieb Herbert Xu: Hi Herbert, > 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. Ok, I will remove the check. > > When you submit this again can you please send

Re: [PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function

2016-06-07 Thread Herbert Xu
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

Re: [PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function

2016-06-02 Thread Stephan Mueller
Am Donnerstag, 2. Juni 2016, 16:55:26 schrieb Herbert Xu: Hi Herbert, > > Why don't you put the result in a temporary buffer and then copy > it? These things are tiny, right? The KDFs are usually used for output sizes between one and 4 keys. So, commonly it is expected that not more than 200

Re: [PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function

2016-06-02 Thread Herbert Xu
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. > +

[PATCH v2 3/4] crypto: kdf - SP800-108 Key Derivation Function

2016-05-31 Thread Stephan Mueller
The SP800-108 compliant Key Derivation Function is implemented as a random number generator considering that it behaves like a deterministic RNG. All three KDF types specified in SP800-108 are implemented. The code comments provide details about how to invoke the different KDF types.