Skip to content

Commit d4d95a6

Browse files
committed
lib: Remove some unneeded zeroizing of memory.
1 parent a507b62 commit d4d95a6

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

lib/alg-gost3411-2012-hmac.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@ void
2929
gost_hash256 (const uint8_t *t, size_t n, uint8_t *out32,
3030
GOST34112012Context *ctx)
3131
{
32-
/* Clear the context state. */
33-
explicit_bzero (ctx, sizeof (GOST34112012Context));
34-
3532
GOST34112012Init (ctx, GOSTR3411_2012_BITS);
3633
GOST34112012Update (ctx, t, n);
3734
GOST34112012Final (ctx, out32);
38-
39-
/* Clear the context state. */
40-
explicit_bzero (ctx, sizeof (GOST34112012Context));
4135
}
4236

4337
/* HMAC_GOSTR3411_2012_256 */
@@ -47,9 +41,6 @@ gost_hmac256 (const uint8_t *k, size_t n, const uint8_t *t, size_t len,
4741
{
4842
size_t i;
4943

50-
/* Clear the context state. */
51-
explicit_bzero (gostbuf, sizeof (gost_hmac_256_t));
52-
5344
/* R 50.1.113-2016 only allowed N to be in range 256..512 bits */
5445
assert (n >= GOSTR3411_2012_L && n <= GOSTR3411_2012_B);
5546

lib/alg-hmac-sha1.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ hmac_sha1_process_data (const uint8_t *text, size_t text_len,
8181
sha1_process_bytes (key, &tctx, key_len);
8282
sha1_finish_ctx(&tctx, &tk);
8383

84-
/* Clean the stack. */
85-
explicit_bzero (&tctx, sizeof (struct sha1_ctx));
86-
8784
key = tk;
8885
key_len = HASH_LENGTH;
8986
}
@@ -124,7 +121,6 @@ hmac_sha1_process_data (const uint8_t *text, size_t text_len,
124121
sha1_finish_ctx(&ctx, resbuf);
125122

126123
/* Clean the stack. */
127-
explicit_bzero (&ctx, sizeof (struct sha1_ctx));
128124
explicit_bzero (k_ipad, HMAC_BLOCKSZ);
129125

130126
/*
@@ -138,7 +134,6 @@ hmac_sha1_process_data (const uint8_t *text, size_t text_len,
138134
sha1_finish_ctx(&ctx, resbuf);
139135

140136
/* Clean the stack. */
141-
explicit_bzero (&ctx, sizeof (struct sha1_ctx));
142137
explicit_bzero (k_opad, HMAC_BLOCKSZ);
143138
}
144139

0 commit comments

Comments
 (0)