summaryrefslogtreecommitdiffstats
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu2015-04-20 05:29:15 +0200
committerHerbert Xu2015-04-21 04:19:53 +0200
commit2a57e4241ec9a11ce89f43099a0f6b83a28058fa (patch)
tree1eeece5365a29d687a80ee842aa2fde7d96509cc /crypto/internal.h
parentcrypto: drbg - Initialise mutex in drbg_healthcheck_sanity (diff)
downloadkernel-qcow2-linux-2a57e4241ec9a11ce89f43099a0f6b83a28058fa.tar.gz
kernel-qcow2-linux-2a57e4241ec9a11ce89f43099a0f6b83a28058fa.tar.xz
kernel-qcow2-linux-2a57e4241ec9a11ce89f43099a0f6b83a28058fa.zip
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