[Cryptech-Commits] [sw/libhal] 01/04: Fix coef4, which was swapping digits
git at cryptech.is
git at cryptech.is
Sat Mar 10 15:00:41 UTC 2018
This is an automated email from the git hooks/post-receive script.
paul at psgd.org pushed a commit to branch hashsig
in repository sw/libhal.
commit 0ff06f408c6e6f48bd3c844bddff10fe1b180290
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Sat Mar 10 08:10:12 2018 -0500
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 */
More information about the Commits
mailing list