diff --git a/kimchi/src/circuits/polynomials/keccak/gadget.rs b/kimchi/src/circuits/polynomials/keccak/gadget.rs index 83b75e3294..a620645d81 100644 --- a/kimchi/src/circuits/polynomials/keccak/gadget.rs +++ b/kimchi/src/circuits/polynomials/keccak/gadget.rs @@ -56,7 +56,7 @@ impl CircuitGate { } fn create_keccak_absorb(new_row: usize, root: bool, pad: bool, pad_bytes: usize) -> Self { - let mut coeffs = vec![F::zero(); 336]; + let mut coeffs = vec![F::zero(); SPONGE_COEFFS]; coeffs[0] = F::one(); // absorb if root { coeffs[2] = F::one(); // root @@ -66,10 +66,10 @@ impl CircuitGate { for i in 0..pad_bytes { coeffs[140 - i] = F::one(); // flag for padding if i == 0 { - coeffs[335 - i] += F::from(0x80u8); // pad + coeffs[SPONGE_COEFFS - 1 - i] += F::from(0x80u8); // pad } if i == pad_bytes - 1 { - coeffs[335 - i] += F::one(); // pad + coeffs[SPONGE_COEFFS - 1 - i] += F::one(); // pad } } }