Skip to content

Commit

Permalink
chore: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed Aug 17, 2023
1 parent a68609e commit 152e7cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions halo2-base/src/poseidon/mds.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::needless_range_loop)]
use crate::utils::ScalarField;

/// The type used to hold the MDS matrix
Expand Down
2 changes: 1 addition & 1 deletion halo2-base/src/poseidon/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl<F: ScalarField, const T: usize, const RATE: usize> PoseidonState<F, T, RATE
res.push(gate.mul_add(ctx, self.s[0], Constant(*e), *x));
}

for (x, new_x) in self.s.iter_mut().zip(res.into_iter()) {
for (x, new_x) in self.s.iter_mut().zip(res) {
*x = new_x
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn test_poseidon_against_test_vectors() {
"6549537674122432311777789598043107870002137484850126429160507761192163713804",
];
for (word, expected) in state_0.into_iter().zip(expected.iter()) {
assert_eq!(word.value.evaluate(), Fr::from_str_vartime(expected).unwrap());
assert_eq!(word.value(), &Fr::from_str_vartime(expected).unwrap());
}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ fn test_poseidon_against_test_vectors() {
"3372108894677221197912083238087960099443657816445944159266857514496320565191",
];
for (word, expected) in state_0.into_iter().zip(expected.iter()) {
assert_eq!(word.value.evaluate(), Fr::from_str_vartime(expected).unwrap());
assert_eq!(word.value(), &Fr::from_str_vartime(expected).unwrap());
}
}
}
Expand Down

0 comments on commit 152e7cd

Please sign in to comment.