diff --git a/lib/alg-gost3411-2012-hmac.c b/lib/alg-gost3411-2012-hmac.c index beb2eb46..dd4396b5 100644 --- a/lib/alg-gost3411-2012-hmac.c +++ b/lib/alg-gost3411-2012-hmac.c @@ -29,15 +29,9 @@ void gost_hash256 (const uint8_t *t, size_t n, uint8_t *out32, GOST34112012Context *ctx) { - /* Clear the context state. */ - explicit_bzero (ctx, sizeof (GOST34112012Context)); - GOST34112012Init (ctx, GOSTR3411_2012_BITS); GOST34112012Update (ctx, t, n); GOST34112012Final (ctx, out32); - - /* Clear the context state. */ - explicit_bzero (ctx, sizeof (GOST34112012Context)); } /* HMAC_GOSTR3411_2012_256 */ @@ -47,9 +41,6 @@ gost_hmac256 (const uint8_t *k, size_t n, const uint8_t *t, size_t len, { size_t i; - /* Clear the context state. */ - explicit_bzero (gostbuf, sizeof (gost_hmac_256_t)); - /* R 50.1.113-2016 only allowed N to be in range 256..512 bits */ assert (n >= GOSTR3411_2012_L && n <= GOSTR3411_2012_B); diff --git a/lib/alg-hmac-sha1.c b/lib/alg-hmac-sha1.c index 5c19984c..3c798453 100644 --- a/lib/alg-hmac-sha1.c +++ b/lib/alg-hmac-sha1.c @@ -81,9 +81,6 @@ hmac_sha1_process_data (const uint8_t *text, size_t text_len, sha1_process_bytes (key, &tctx, key_len); sha1_finish_ctx(&tctx, &tk); - /* Clean the stack. */ - explicit_bzero (&tctx, sizeof (struct sha1_ctx)); - key = tk; key_len = HASH_LENGTH; } @@ -124,7 +121,6 @@ hmac_sha1_process_data (const uint8_t *text, size_t text_len, sha1_finish_ctx(&ctx, resbuf); /* Clean the stack. */ - explicit_bzero (&ctx, sizeof (struct sha1_ctx)); explicit_bzero (k_ipad, HMAC_BLOCKSZ); /* @@ -138,7 +134,6 @@ hmac_sha1_process_data (const uint8_t *text, size_t text_len, sha1_finish_ctx(&ctx, resbuf); /* Clean the stack. */ - explicit_bzero (&ctx, sizeof (struct sha1_ctx)); explicit_bzero (k_opad, HMAC_BLOCKSZ); }