mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 00:33:06 +00:00
Merge pull request #891 from mir-protocol/fix_hash_or_noop
Fix `hash_or_noop` for general hash sizes
This commit is contained in:
commit
7908471913
@ -53,7 +53,7 @@ pub trait Hasher<F: RichField>: Sized + Clone + Debug + Eq + PartialEq {
|
||||
/// Hash the slice if necessary to reduce its length to ~256 bits. If it already fits, this is a
|
||||
/// no-op.
|
||||
fn hash_or_noop(inputs: &[F]) -> Self::Hash {
|
||||
if inputs.len() <= 4 {
|
||||
if inputs.len() * 8 <= Self::HASH_SIZE {
|
||||
let mut inputs_bytes = vec![0u8; Self::HASH_SIZE];
|
||||
for i in 0..inputs.len() {
|
||||
inputs_bytes[i * 8..(i + 1) * 8]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user