Skip to content

Commit

Permalink
Fix non-doit ROLs in Keccak in Dilithium.
Browse files Browse the repository at this point in the history
  • Loading branch information
J08nY committed May 8, 2024
1 parent e874ab0 commit 27b5e77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/crypto_sign/dilithium/common/amd64/fips202.jinc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from Jade require "common/doit.jinc"
/* -- Stolen and modified from the Kyber repo -- */

param int SHAKE128_RATE = 168;
Expand All @@ -24,7 +25,7 @@ fn theta(reg ptr u64[25] a) -> reg ptr u64[25] {

for x = 0 to 5 {
d[x] = c[(x + 1) % 5];
?{}, d[x] = #ROL_64(d[x], 1);
d[x] = __ROL64(d[x], 1);
d[x] ^= c[(x + 4) % 5];
}

Expand Down Expand Up @@ -66,7 +67,7 @@ fn rho(reg ptr u64[25] a) -> reg ptr u64[25] {
for y = 0 to 5 {
i = index(x, y);
z = keccakRhoOffsets(i);
_, _, a[i] = #ROL_64(a[i], z);
a[i] = __ROL64(a[i], z);
}
}

Expand Down

0 comments on commit 27b5e77

Please sign in to comment.