mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-10 01:33:07 +00:00
Fix constraint
This commit is contained in:
parent
10ac355d06
commit
51f66d4dac
@ -87,15 +87,16 @@ mod tests {
|
||||
let keccak_stark = KeccakStark::<F, D> {
|
||||
f: Default::default(),
|
||||
};
|
||||
let keccak_rows = (NUM_ROUNDS + 1).next_power_of_two();
|
||||
let keccak_rows = (2 * NUM_ROUNDS + 1).next_power_of_two();
|
||||
let keccak_looked_col = 3;
|
||||
|
||||
let mut rng = ChaCha8Rng::seed_from_u64(0x6feb51b7ec230f25);
|
||||
let num_inputs = 1;
|
||||
let num_inputs = 2;
|
||||
let keccak_inputs = (0..num_inputs)
|
||||
.map(|_| [0u64; INPUT_LIMBS].map(|_| rng.gen()))
|
||||
.collect_vec();
|
||||
let keccak_trace = keccak_stark.generate_trace(keccak_inputs);
|
||||
dbg!(keccak_trace[0].len(), keccak_rows);
|
||||
let column_to_copy: Vec<_> = keccak_trace[keccak_looked_col].values[..].into();
|
||||
|
||||
let default = vec![F::ONE; 1];
|
||||
|
||||
@ -345,8 +345,13 @@ impl<F: RichField + Extendable<D>, const D: usize> Stark<F, D> for KeccakStark<F
|
||||
let input_bits_combined_hi = (32..64)
|
||||
.rev()
|
||||
.fold(P::ZEROS, |acc, z| acc.doubles() + input_bits[z]);
|
||||
yield_constr.constraint_transition(output_lo - input_bits_combined_lo);
|
||||
yield_constr.constraint_transition(output_hi - input_bits_combined_hi);
|
||||
let is_last_round = vars.local_values[reg_step(NUM_ROUNDS - 1)];
|
||||
yield_constr.constraint_transition(
|
||||
(P::ONES - is_last_round) * (output_lo - input_bits_combined_lo),
|
||||
);
|
||||
yield_constr.constraint_transition(
|
||||
(P::ONES - is_last_round) * (output_hi - input_bits_combined_hi),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user