From af45e73f5c7de517c8376e3aba93bc12000c6065 Mon Sep 17 00:00:00 2001 From: sfluhrer Date: Tue, 2 May 2023 09:16:17 -0400 Subject: [PATCH] Implement changes to hash-to-FORS-leaves transform This is the change to the Sphincs+ definition by NIST --- ref/fors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ref/fors.c b/ref/fors.c index a4f2a199..3599e5b6 100644 --- a/ref/fors.c +++ b/ref/fors.c @@ -56,7 +56,7 @@ static void message_to_indices(uint32_t *indices, const unsigned char *m) for (i = 0; i < SPX_FORS_TREES; i++) { indices[i] = 0; for (j = 0; j < SPX_FORS_HEIGHT; j++) { - indices[i] ^= ((m[offset >> 3] >> (offset & 0x7)) & 0x1) << j; + indices[i] ^= ((m[offset >> 3] >> (~offset & 0x7)) & 0x1) << j; offset++; } }