From 0ff06f408c6e6f48bd3c844bddff10fe1b180290 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Sat, 10 Mar 2018 08:10:12 -0500 Subject: Fix coef4, which was swapping digits --- hashsig.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hashsig.c b/hashsig.c index 13f20c6..e32358d 100644 --- a/hashsig.c +++ b/hashsig.c @@ -284,10 +284,7 @@ static uint8_t coef2(const uint8_t * const S, const size_t i) /* w = 4 */ static uint8_t coef4(const uint8_t * const S, const size_t i) { - uint8_t byte = S[i/2]; - if (i % 2) - byte >>= 4; - return byte & 0x0f; + return (S[i/2] >> (4 - (4 * (i % 2)))) & 0x0f; } /* w = 8 */ -- cgit v1.2.3