| ... | @@ -177,8 +177,9 @@ pub fn KeccakF(comptime f: u11) type { | ... | @@ -177,8 +177,9 @@ pub fn KeccakF(comptime f: u11) type { |
| 177 | | 177 | |
| 178 | /// Apply a (possibly) reduced-round permutation to the state. | 178 | /// Apply a (possibly) reduced-round permutation to the state. |
| 179 | pub fn permuteR(self: *Self, comptime rounds: u5) void { | 179 | pub fn permuteR(self: *Self, comptime rounds: u5) void { |
| | 180 | comptime assert(rounds <= max_rounds); // Keccak only supports up to 24 rounds |
| 180 | var i = RC.len - rounds; | 181 | var i = RC.len - rounds; |
| 181 | while (i < RC.len - RC.len % 3) : (i += 3) { | 182 | while (i < RC.len - rounds % 3) : (i += 3) { |
| 182 | self.round(RC[i]); | 183 | self.round(RC[i]); |
| 183 | self.round(RC[i + 1]); | 184 | self.round(RC[i + 1]); |
| 184 | self.round(RC[i + 2]); | 185 | self.round(RC[i + 2]); |