diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-28 22:08:23 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-28 22:08:23 +0300 |
commit | a2333c8938af4829a8eac8c09615e6652cd412f1 (patch) | |
tree | 480f2729015c99231325990516c74a47ee30d8cd /libbb/sha1.c | |
parent | 78f9d8eb7adc10f1af8977212f24ab3c418a9c2b (diff) |
randomtest fixes
Diffstat (limited to 'libbb/sha1.c')
-rw-r--r-- | libbb/sha1.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libbb/sha1.c b/libbb/sha1.c index a07435919..9fa095e85 100644 --- a/libbb/sha1.c +++ b/libbb/sha1.c @@ -196,12 +196,11 @@ static void FAST_FUNC sha256_process_block64(sha256_ctx_t *ctx) /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ for (t = 0; t < 64; ++t) { - /* Need to fetch upper half of sha_K[t] */ -#if BB_BIG_ENDIAN - uint32_t K_t = ((uint32_t*)(sha_K + t))[0]; -#else - uint32_t K_t = ((uint32_t*)(sha_K + t))[1]; -#endif + /* Need to fetch upper half of sha_K[t] + * (I hope compiler is clever enough to just fetch + * upper half) + */ + uint32_t K_t = sha_K[t] >> 32; uint32_t T1 = h + S1(e) + Ch(e, f, g) + K_t + W[t]; uint32_t T2 = S0(a) + Maj(a, b, c); h = g; |