This commit is contained in:
Nicholas Ward 2022-06-01 09:20:39 -07:00
parent 2c285ca2cd
commit e6d0275f2a
2 changed files with 22 additions and 22 deletions

View File

@ -63,7 +63,7 @@ mod tests {
use crate::cpu;
use crate::cpu::cpu_stark::CpuStark;
use crate::cross_table_lookup::CrossTableLookup;
use crate::keccak::keccak_stark::{KeccakStark, NUM_ROUNDS, INPUT_LIMBS};
use crate::keccak::keccak_stark::{KeccakStark, INPUT_LIMBS, NUM_ROUNDS};
use crate::proof::AllProof;
use crate::prover::prove;
use crate::recursive_verifier::{

View File

@ -39,7 +39,10 @@ pub struct KeccakStark<F, const D: usize> {
impl<F: RichField + Extendable<D>, const D: usize> KeccakStark<F, D> {
/// Generate the rows of the trace. Note that this does not generate the permuted columns used
/// in our lookup arguments, as those are computed after transposing to column-wise form.
pub(crate) fn generate_trace_rows(&self, inputs: Vec<[u64; INPUT_LIMBS]>) -> Vec<[F; NUM_REGISTERS]> {
pub(crate) fn generate_trace_rows(
&self,
inputs: Vec<[u64; INPUT_LIMBS]>,
) -> Vec<[F; NUM_REGISTERS]> {
let num_rows = (inputs.len() * NUM_ROUNDS).next_power_of_two();
info!("{} rows", num_rows);
let mut rows = Vec::with_capacity(num_rows);
@ -57,10 +60,7 @@ impl<F: RichField + Extendable<D>, const D: usize> KeccakStark<F, D> {
rows
}
fn generate_trace_rows_for_perm(
&self,
input: [u64; INPUT_LIMBS],
) -> Vec<[F; NUM_REGISTERS]> {
fn generate_trace_rows_for_perm(&self, input: [u64; INPUT_LIMBS]) -> Vec<[F; NUM_REGISTERS]> {
let mut rows = vec![[F::ZERO; NUM_REGISTERS]; NUM_ROUNDS];
for x in 0..5 {
@ -139,7 +139,7 @@ impl<F: RichField + Extendable<D>, const D: usize> KeccakStark<F, D> {
// // ])
// };
let lo = F::ZERO;//row[reg_b(x, y, 0)];
let lo = F::ZERO; //row[reg_b(x, y, 0)];
// let hi = (32..64)
// .rev()
// .fold(F::ZERO, |acc, z| acc.double() + get_bit(z));
@ -253,7 +253,7 @@ impl<F: RichField + Extendable<D>, const D: usize> Stark<F, D> for KeccakStark<F
let reg_hi = reg_lo + 1;
let lo = vars.local_values[reg_lo];
// let hi = vars.local_values[reg_hi];
let computed_lo = P::ZEROS;// vars.local_values[reg_b(x, y, 0)];//(0..32)
let computed_lo = P::ZEROS; // vars.local_values[reg_b(x, y, 0)];//(0..32)
// .rev()
// .fold(P::ZEROS, |acc, z| acc.doubles() + get_bit(z));
let computed_hi = (32..64)