We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d701e4f commit 0f7eacdCopy full SHA for 0f7eacd
components/util/src/sha512.c
@@ -256,9 +256,10 @@ int esp_sha384_finish(esp_sha384_t *ctx, void *dest)
256
257
ctx->buffer[used++] = 0x80;
258
259
- memset(ctx->buffer + used, 0, 112 - used);
260
-
261
- if (used > 112) {
+ if (used <= 112)
+ memset(ctx->buffer + used, 0, 112 - used);
+ else {
262
+ memset(ctx->buffer + used, 0, 128 - used);
263
esp_sha512_transform(ctx, ctx->buffer);
264
memset(ctx->buffer, 0, 112);
265
}
0 commit comments