1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Fix last patch for big-endian machines

This commit is contained in:
Ulrich Drepper
2011-07-02 13:03:53 -04:00
parent fcfc776bc6
commit feea4948bc
4 changed files with 28 additions and 15 deletions

View File

@@ -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. */