summaryrefslogtreecommitdiff
path: root/crypto/hmac.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-07-06 02:24:35 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2014-07-08 21:18:24 +0800
commit9409c96a23124905cf026c6ec26f58ff4f81f9aa (patch)
tree0d67ca2e2673441432aa9b15356ce35ea4d01b3a /crypto/hmac.c
parent38b4f46bf26ee0e69f14bb409ed3bc54ca7270d0 (diff)
downloadlinux-crypto-9409c96a23124905cf026c6ec26f58ff4f81f9aa.tar.gz
linux-crypto-9409c96a23124905cf026c6ec26f58ff4f81f9aa.zip
crypto: drbg - Call CTR DRBG DF function only once
The CTR DRBG requires the update function to be called twice when generating a random number. In both cases, update function must process the additional information string by using the DF function. As the DF produces the same result in both cases, we can save one invocation of the DF function when the first DF function result is reused. The result of the DF function is stored in the scratchpad storage. The patch ensures that the scratchpad is not cleared when we want to reuse the DF result. For achieving this, the CTR DRBG update function must know by whom and in which scenario it is called. This information is provided with the reseed parameter to the update function. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/hmac.c')
0 files changed, 0 insertions, 0 deletions