Skip to content

Commit 2bca654

Browse files
authored
add WIDTH constant to Poseidon2 types for compile-time safety (#96)
2 parents ab140ce + bacc78a commit 2bca654

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/poseidon2/poseidon2.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ pub fn poseidon2_24_plonky3_with_mds_light(state: []F, apply_mds_light: bool) vo
570570

571571
// Wrapper structs for compatibility
572572
pub const Poseidon2KoalaBear16Plonky3 = struct {
573+
pub const WIDTH = 16;
573574
pub const Field = F;
574575

575576
pub fn permutation(state: []F) void {
@@ -620,6 +621,7 @@ pub const Poseidon2KoalaBear16Plonky3 = struct {
620621
};
621622

622623
pub const Poseidon2KoalaBear24Plonky3 = struct {
624+
pub const WIDTH = 24;
623625
pub const Field = F;
624626

625627
pub fn permutation(state: []F) void {

0 commit comments

Comments
 (0)