]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: drbg - advance output buffer pointer
authorStephan Mueller <smueller@chronox.de>
Fri, 18 Nov 2016 11:27:56 +0000 (12:27 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 21 Nov 2016 14:50:24 +0000 (22:50 +0800)
commitab7d6ef69f188ea18f79418b4682aff26b8c777e
tree534f7ab1c873752c3d9c06b34462a25a0ec8e770
parent992a9de2bf9fe38b48866702368fcec3ea37ee02
crypto: drbg - advance output buffer pointer

The CTR DRBG segments the number of random bytes to be generated into
128 byte blocks. The current code misses the advancement of the output
buffer pointer when the requestor asks for more than 128 bytes of data.
In this case, the next 128 byte block of random numbers is copied to
the beginning of the output buffer again. This implies that only the
first 128 bytes of the output buffer would ever be filled.

The patch adds the advancement of the buffer pointer to fill the entire
buffer.

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