Skip to content

Commit

Permalink
Include the PoseidonHasher in the fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Oct 11, 2024
1 parent 8232bfa commit 6920c28
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tooling/nargo_cli/tests/stdlib-props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@ fn fuzz_poseidon_equivalence() {
for len in 1..light_poseidon::MAX_X5_LEN {
let source = format!(
"fn main(input: [Field; {len}]) -> pub Field {{
std::hash::poseidon::bn254::hash_{len}(input)
let h1 = std::hash::poseidon::bn254::hash_{len}(input);
let h2 = {{
let mut hasher = std::hash::poseidon::PoseidonHasher::default();
input.hash(&mut hasher);
hasher.finish()
}};
assert_eq(h1, h2);
h1
}}"
);

Expand Down

0 comments on commit 6920c28

Please sign in to comment.