linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH 3/4] crypto: drbg - replace spinlock with mutex
Date: Sat, 18 Apr 2015 13:35:40 +0200	[thread overview]
Message-ID: <1809889.qql3aDFiri@myon.chronox.de> (raw)
In-Reply-To: <20150418105523.GB5408@gondor.apana.org.au>

Am Samstag, 18. April 2015, 18:55:23 schrieb Herbert Xu:

Hi Herbert,

> 
> Incidentally the whole reset concept seems redundant as you could
> always free and allocate a new RNG instead.  So I'm planning on
> replacing it with a seed/reseed function instead.  IOW it will
> keep the existing state and just add in new data if it's already
> seeded.

Very good.

When you do that, may I ask you to also update the crypto_alloc_rng. This 
function has one major drawback at the moment: we are wasting precious 
entropy. The testmgr must allocate the RNG for performing its testing using 
crypto_alloc_rng. As the RNG implementation has no knowledge at allocation 
time that it will be used for testing, it will seed itself for the real work. 
Then comes testing: the seeded RNG is now reset with the test "entropy" and 
thereby wasting the initial seed.

IMHO such change in the allocation function must happen when you remove the 
reset function, because the reset function currently is the way to perform 
testing of the RNGs.

-- 
Ciao
Stephan

  reply	other threads:[~2015-04-18 11:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 12:53 [PATCH 0/4] crypto: drbg - revamp locking Stephan Mueller
2015-04-17 12:54 ` [PATCH 1/4] cryoto: drbg - clear all temporary memory Stephan Mueller
2015-04-18 10:59   ` Herbert Xu
2015-04-17 12:54 ` [PATCH 2/4] crypto: drbg - do not create shadow copy Stephan Mueller
2015-04-18 10:49   ` Herbert Xu
2015-04-18 12:51     ` Stephan Mueller
2015-04-17 12:55 ` [PATCH 3/4] crypto: drbg - replace spinlock with mutex Stephan Mueller
2015-04-18 10:55   ` Herbert Xu
2015-04-18 11:35     ` Stephan Mueller [this message]
2015-04-19  5:48       ` Herbert Xu
2015-04-19 15:37         ` Stephan Mueller
2015-04-20  0:27           ` Herbert Xu
2015-04-20  0:45             ` Stephan Mueller
2015-04-20  0:48               ` Herbert Xu
2015-04-20  0:51                 ` Stephan Mueller
2015-04-17 12:56 ` [PATCH 4/4] crypto: drbg - leave cipher handles operational Stephan Mueller

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=1809889.qql3aDFiri@myon.chronox.de \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /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).