Skip to content

Commit

Permalink
Merge branch 'zkvm/keccak/indexcell' into zkvm/keccak/layout
Browse files Browse the repository at this point in the history
  • Loading branch information
querolita committed Oct 26, 2023
2 parents 43572f8 + 82fb7dc commit 3950f00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kimchi/src/circuits/polynomials/keccak/gadget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<F: PrimeField + SquareRootField> CircuitGate<F> {
}

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
Expand All @@ -66,10 +66,10 @@ impl<F: PrimeField + SquareRootField> CircuitGate<F> {
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
}
}
}
Expand Down

0 comments on commit 3950f00

Please sign in to comment.