Skip to content

Commit

Permalink
removed unneeded permutes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli Margolin authored and Eli Margolin committed Oct 8, 2024
1 parent 6b19555 commit 1181bd6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto-primitives/src/sponge/poseidon/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ impl<F: PrimeField> CryptographicSpongeVar<F, PoseidonSponge<F>> for PoseidonSpo
DuplexSpongeMode::Squeezing {
next_squeeze_index: _,
} => {
self.permute()?;
self.absorb_internal(0, input.as_slice())?;
}
};
Expand Down Expand Up @@ -279,8 +278,8 @@ impl<F: PrimeField> CryptographicSpongeVar<F, PoseidonSponge<F>> for PoseidonSpo
}
DuplexSpongeMode::Squeezing { next_squeeze_index } => {
let mut squeeze_index = next_squeeze_index;
self.permute()?;
if squeeze_index == self.parameters.rate {
self.permute()?;
squeeze_index = 0;
}
self.squeeze_internal(squeeze_index, &mut squeezed_elems)?;
Expand Down

0 comments on commit 1181bd6

Please sign in to comment.