Pad according to RATE rather than WIDTH (#1299)

This commit is contained in:
Linda Guiga 2023-10-21 07:51:26 -04:00 committed by GitHub
parent 49976ea2a9
commit 05006deb44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ pub trait Hasher<F: RichField>: Sized + Copy + Debug + Eq + PartialEq {
fn hash_pad(input: &[F]) -> Self::Hash {
let mut padded_input = input.to_vec();
padded_input.push(F::ONE);
while (padded_input.len() + 1) % Self::Permutation::WIDTH != 0 {
while (padded_input.len() + 1) % Self::Permutation::RATE != 0 {
padded_input.push(F::ZERO);
}
padded_input.push(F::ONE);