Skip to content

Commit

Permalink
fix sha3.c file
Browse files Browse the repository at this point in the history
  • Loading branch information
manastasova committed Feb 1, 2025
1 parent 83df460 commit 24784c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crypto/fipsmodule/sha/sha3.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ static int FIPS202_Update(KECCAK1600_CTX *ctx, const void *data, size_t len) {

if (rem != 0) {
memcpy(ctx->buf, data_ptr_copy + len - rem, rem);
ctx->buf_load = rem;
}
ctx->buf_load = rem;

return 1;
}
Expand Down Expand Up @@ -316,8 +316,8 @@ int SHAKE_Squeeze(uint8_t *md, KECCAK1600_CTX *ctx, size_t len) {
if (len <= ctx->buf_load) {
memcpy(md, ctx->buf + ctx->block_size - ctx->buf_load, len);
md += len;
len = 0;
ctx->buf_load -= len;
len = 0;
return 1;
} else {
memcpy(md, ctx->buf + ctx->block_size - ctx->buf_load, ctx->buf_load);
Expand Down Expand Up @@ -353,9 +353,6 @@ int SHAKE_Squeeze(uint8_t *md, KECCAK1600_CTX *ctx, size_t len) {
ctx->state = KECCAK1600_STATE_SQUEEZE;
}

Keccak1600_Squeeze(ctx->A, md, len, ctx->block_size, ctx->state);
ctx->state = KECCAK1600_STATE_SQUEEZE;

//FIPS_service_indicator_update_state();
return 1;
}

0 comments on commit 24784c4

Please sign in to comment.