mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-05 07:13:08 +00:00
Fix bug in GMiMC
This commit is contained in:
parent
7793b5a956
commit
92c4bba2a3
@ -145,12 +145,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
.enumerate()
|
||||
{
|
||||
self.set_context(&format!("Verify {}-th initial Merkle proof.", i));
|
||||
if i == 0 {
|
||||
self.add_marked(Arc::new(evals.clone()), "Evals");
|
||||
self.add_marked(Arc::new(merkle_proof.siblings.clone()), "merkle proof");
|
||||
self.add_marked(Arc::new(root.clone()), "root");
|
||||
self.add_marked(Arc::new(x_index.clone()), "x_index");
|
||||
}
|
||||
self.verify_merkle_proof(evals.clone(), x_index, root, merkle_proof);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
//! Concrete instantiation of a hash function.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::circuit_builder::CircuitBuilder;
|
||||
use crate::field::extension_field::Extendable;
|
||||
use crate::field::field::Field;
|
||||
@ -218,7 +220,7 @@ pub fn hash_n_to_m<F: Field>(mut inputs: Vec<F>, num_outputs: usize, pad: bool)
|
||||
// Absorb all input chunks.
|
||||
for input_chunk in inputs.chunks(SPONGE_RATE) {
|
||||
for i in 0..input_chunk.len() {
|
||||
state[i] += input_chunk[i];
|
||||
state[i] = input_chunk[i];
|
||||
}
|
||||
state = permute(state);
|
||||
}
|
||||
|
||||
@ -76,7 +76,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
let mut acc_leaf_index = zero;
|
||||
|
||||
for (bit, &sibling) in purported_index_bits.into_iter().zip(&proof.siblings) {
|
||||
self.add_marked(Arc::new(state), "current digest");
|
||||
let gate = self
|
||||
.add_gate_no_constants(GMiMCGate::<F, D, GMIMC_ROUNDS>::with_automatic_constants());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user