summaryrefslogtreecommitdiffstats
path: root/src/lib/sha2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/sha2.c')
-rw-r--r--src/lib/sha2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/sha2.c b/src/lib/sha2.c
index 93dddfb..b6bef47 100644
--- a/src/lib/sha2.c
+++ b/src/lib/sha2.c
@@ -287,7 +287,7 @@ void sha256_result(struct sha256_ctx *ctx,
{
size_t block_nb;
size_t pm_len;
- size_t len_b;
+ uint64_t len_b;
int i;
block_nb = (1 + ((SHA256_BLOCK_SIZE - 9)
@@ -298,7 +298,7 @@ void sha256_result(struct sha256_ctx *ctx,
memset(ctx->block + ctx->len, 0, pm_len - ctx->len);
ctx->block[ctx->len] = 0x80;
- UNPACK32(len_b, ctx->block + pm_len - 4);
+ UNPACK64(len_b, ctx->block + pm_len - 8);
sha256_transf(ctx, ctx->block, block_nb);
@@ -414,7 +414,7 @@ void sha384_result(struct sha384_ctx *ctx,
{
unsigned int block_nb;
unsigned int pm_len;
- size_t len_b;
+ uint64_t len_b;
int i;
block_nb = 1 + ((SHA384_BLOCK_SIZE - 17)
@@ -425,7 +425,7 @@ void sha384_result(struct sha384_ctx *ctx,
memset(ctx->block + ctx->len, 0, pm_len - ctx->len);
ctx->block[ctx->len] = 0x80;
- UNPACK32(len_b, ctx->block + pm_len - 4);
+ UNPACK64(len_b, ctx->block + pm_len - 8);
sha384_transf(ctx, ctx->block, block_nb);
@@ -541,7 +541,7 @@ void sha512_result(struct sha512_ctx *ctx,
{
unsigned int block_nb;
unsigned int pm_len;
- size_t len_b;
+ uint64_t len_b;
int i;
block_nb = 1 + ((SHA512_BLOCK_SIZE - 17)
@@ -552,7 +552,7 @@ void sha512_result(struct sha512_ctx *ctx,
memset(ctx->block + ctx->len, 0, pm_len - ctx->len);
ctx->block[ctx->len] = 0x80;
- UNPACK32(len_b, ctx->block + pm_len - 4);
+ UNPACK64(len_b, ctx->block + pm_len - 8);
sha512_transf(ctx, ctx->block, block_nb);