diff options
author | Paul Selkirk <paul@psgd.org> | 2018-03-10 08:10:12 -0500 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2018-03-10 08:10:12 -0500 |
commit | 0ff06f408c6e6f48bd3c844bddff10fe1b180290 (patch) | |
tree | 9625c85eb63f1874275a9e62a3e75b24bd7fa34a | |
parent | b26b375956a0f5b472b9b7f180ee78b0c64fc256 (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 */ |