summaryrefslogtreecommitdiff
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-04-20 11:29:15 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-04-21 10:19:53 +0800
commit2a57e4241ec9a11ce89f43099a0f6b83a28058fa (patch)
tree1eeece5365a29d687a80ee842aa2fde7d96509cc /crypto/internal.h
parente11a754813e28dbfab63a23ae8fd22e9198489e1 (diff)
crypto: drbg - Do not seed RNG in drbg_kcapi_init
Initialising the RNG in drbg_kcapi_init is a waste of precious entropy because all users will immediately seed the RNG after the allocation. In fact, all users should seed the RNG before using it. So there is no point in doing the seeding in drbg_kcapi_init. This patch removes the initial seeding and the user must seed the RNG explicitly (as they all currently do). This patch also changes drbg_kcapi_reset to allow reseeding. That is, if you call it after a successful initial seeding, then it will not reset the internal state of the DRBG before mixing the new input and entropy. If you still wish to reset the internal state, you can always free the DRBG and allocate a new one. Finally this patch removes locking from drbg_uninstantiate because it's now only called from the destruction path which must not be executed in parallel with normal operations. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Stephan Mueller <smueller@chronox.de>
Diffstat (limited to 'crypto/internal.h')
0 files changed, 0 insertions, 0 deletions