From: Eric Biggers Date: Sat, 30 May 2015 20:48:14 +0000 (-0500) Subject: sha1.c: annotate load which may be unaligned X-Git-Tag: v1.8.2~107 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=ec8cb371eb2497af3d002d9072ce2e05dfc63868 sha1.c: annotate load which may be unaligned --- diff --git a/src/sha1.c b/src/sha1.c index 1b2abb2f..24f9b682 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -51,7 +51,7 @@ sprint_hash(const u8 hash[SHA1_HASH_SIZE], tchar strbuf[SHA1_HASH_SIZE * 2 + 1]) #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) -#define blk0(i) (tmp[i] = be32_to_cpu(((const be32 *)block)[i])) +#define blk0(i) (tmp[i] = be32_to_cpu(load_be32_unaligned(&(block)[(i) * 4]))) #define blk(i) (tmp[i & 15] = rol(tmp[(i + 13) & 15] ^ \ tmp[(i + 8) & 15] ^ \