]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: drbg - reduce number of setkey calls
authorStephan Mueller <smueller@chronox.de>
Tue, 31 May 2016 11:11:57 +0000 (13:11 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 2 Jun 2016 10:39:01 +0000 (18:39 +0800)
commitd7b1ed2119ce45d7862724619080fdc37dff8963
treef638837277d65abd82370e7749b3aecac569df99
parent677d0d5d58cc73670b8e11c41a38572d9a4ab93a
crypto: drbg - reduce number of setkey calls

The CTR DRBG code always set the key for each sym cipher invocation even
though the key has not been changed.

The patch ensures that the setkey is only invoked when a new key is
generated by the DRBG.

With this patch, the CTR DRBG performance increases by more than 150%.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/drbg.c