authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2024-06-04 09:10:46+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-06-04 10:10:46+02:00
log993885c04092a53791366edc7f3fe9fbf7c25b7d
tree26ae3774375ea6b4f8b35f66ae174a245e4a4d5e
parent7fc3fb955abf3d510079ad5e42027b90e897dc20
signaturebadge-check Signed by PGP key B5690EEEBB952194

sha3.keccak: allow Keccak[f=200] (#20181)

We support Keccak[f=200] just fine, so allow it.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/crypto/keccak_p.zig+2-2
......@@ -7,7 +7,7 @@ const native_endian = builtin.cpu.arch.endian();
77
88/// The Keccak-f permutation.
99pub fn KeccakF(comptime f: u11) type {
10 comptime assert(f > 200 and f <= 1600 and f % 200 == 0); // invalid bit size
10 comptime assert(f >= 200 and f <= 1600 and f % 200 == 0); // invalid bit size
1111 const T = std.meta.Int(.unsigned, f / 25);
1212 const Block = [25]T;
1313
......@@ -196,7 +196,7 @@ pub fn KeccakF(comptime f: u11) type {
196196
197197/// A generic Keccak-P state.
198198pub fn State(comptime f: u11, comptime capacity: u11, comptime rounds: u5) type {
199 comptime assert(f > 200 and f <= 1600 and f % 200 == 0); // invalid state size
199 comptime assert(f >= 200 and f <= 1600 and f % 200 == 0); // invalid state size
200200 comptime assert(capacity < f and capacity % 8 == 0); // invalid capacity size
201201
202202 return struct {