diff options
author | Paul Selkirk <paul@psgd.org> | 2018-03-10 08:10:12 -0500 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2018-04-19 18:59:01 -0400 |
commit | d5bd7787b214e0c10354c4cdabfcca92abd0aad6 (patch) | |
tree | 1a26677e990200a0c5d3b5aea19b1ab7938203d9 | |
parent | a478fe1230efae768c72b8cdb29e2887e4226312 (diff) |
Fix coef4, which was swapping digits
-rw-r--r-- | hashsig.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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 */ |