aboutsummaryrefslogtreecommitdiff
path: root/crypt/sha256.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-02 13:03:53 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-02 13:03:53 -0400
commitfeea4948bca7e442edad3f995696f33450549e80 (patch)
treef0d06f3188f1179aa50dd5281234ed4167422db4 /crypt/sha256.c
parentfcfc776bc6242fdefde0efd7b0c315fbeca08555 (diff)
downloadglibc-feea4948bca7e442edad3f995696f33450549e80.zip
glibc-feea4948bca7e442edad3f995696f33450549e80.tar.gz
glibc-feea4948bca7e442edad3f995696f33450549e80.tar.bz2
Fix last patch for big-endian machines
Diffstat (limited to 'crypt/sha256.c')
-rw-r--r--crypt/sha256.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypt/sha256.c b/crypt/sha256.c
index 0ca3355..1a3aca6 100644
--- a/crypt/sha256.c
+++ b/crypt/sha256.c
@@ -224,9 +224,11 @@ __sha256_finish_ctx (ctx, resbuf)
#ifdef _STRING_ARCH_unaligned
*(uint64_t *) &ctx->buffer[bytes + pad] = SWAP64 (ctx->total64 << 3);
#else
- *(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
- *(uint32_t *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
- (ctx->total[0] >> 29));
+ *(uint32_t *) &ctx->buffer[bytes + pad + 4]
+ = SWAP (ctx->total[TOTAL64_low] << 3);
+ *(uint32_t *) &ctx->buffer[bytes + pad]
+ = SWAP ((ctx->total[TOTAL64_high] << 3) |
+ (ctx->total[TOTAL64_low] >> 29));
#endif
/* Process last bytes. */