crypto: drbg - remove superflowous memset(0)
authorStephan Mueller <smueller@chronox.de>
Sun, 17 Aug 2014 15:38:58 +0000 (17:38 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 25 Aug 2014 12:34:10 +0000 (20:34 +0800)
Remove memset(0) which is not needed due to the kzalloc of the memory.

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

index 212d260220e3a3d30069d672b2adc41436450e20..86cffc600acdb4fc15bd92ea1a3f4836dd5043b5 100644 (file)
@@ -728,11 +728,9 @@ static int drbg_hmac_update(struct drbg_state *drbg, struct list_head *seed,
        LIST_HEAD(seedlist);
        LIST_HEAD(vdatalist);
 
-       if (!reseed) {
-               /* 10.1.2.3 step 2 */
-               memset(drbg->C, 0, drbg_statelen(drbg));
+       if (!reseed)
+               /* 10.1.2.3 step 2 -- memset(0) of C is implicit with kzalloc */
                memset(drbg->V, 1, drbg_statelen(drbg));
-       }
 
        drbg_string_fill(&seed1, drbg->V, drbg_statelen(drbg));
        list_add_tail(&seed1.list, &seedlist);