diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-18 11:39:47 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-18 11:39:47 +0200 |
commit | b102e12253078e8c0ebdeeb5e1893ea6a025a700 (patch) | |
tree | 63ad7f83781bea9185d72b75c28a9cb19cb04515 /libbb/hash_md5.c | |
parent | 06f719fd79fe15ce6fd5431bc58fcb22851de24d (diff) | |
download | busybox-b102e12253078e8c0ebdeeb5e1893ea6a025a700.tar.gz |
*: use SWAP_BE64 instead of open-coding it
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'libbb/hash_md5.c')
-rw-r--r-- | libbb/hash_md5.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libbb/hash_md5.c b/libbb/hash_md5.c index 051c8ede4..9de27f1d9 100644 --- a/libbb/hash_md5.c +++ b/libbb/hash_md5.c @@ -417,11 +417,9 @@ void FAST_FUNC md5_end(md5_ctx_t *ctx, void *resbuf) if (remaining >= 8) { /* Store the 64-bit counter of bits in the buffer in BE format */ uint64_t t = ctx->total64 << 3; - unsigned i; - for (i = 0; i < 8; i++) { - ctx->wbuffer[56 + i] = t; - t >>= 8; - } + t = SWAP_BE64(t); + /* wbuffer is suitably aligned for this */ + *(uint64_t *) (&ctx->wbuffer[64 - 8]) = t; } md5_process_block64(ctx); if (remaining >= 8) |