Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Jul 11, 2024
1 parent 5874771 commit 18abe90
Show file tree
Hide file tree
Showing 9 changed files with 633 additions and 106 deletions.
21 changes: 3 additions & 18 deletions gkr/examples/keccak256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ use ff_ext::ExtensionField;
use gkr::{
gadgets::keccak256::{keccak256_circuit, prove_keccak256, verify_keccak256},
structs::CircuitWitness,
util::ceil_log2,
};
use goldilocks::GoldilocksExt2;
use itertools::{izip, Itertools};
use multilinear_extensions::mle::DenseMultilinearExtension;
use multilinear_extensions::mle::IntoMLE;
use sumcheck::util::is_power_of_2;
use tracing_flame::FlameLayer;
use tracing_subscriber::{fmt, layer::SubscriberExt, EnvFilter, Registry};
Expand Down Expand Up @@ -52,28 +51,14 @@ fn main() {
vec![<GoldilocksExt2 as ExtensionField>::BaseField::ZERO; 17 * 64],
]
.into_iter()
.map(|mut wit_in| {
let next_pow_2 = ceil_log2(wit_in.len());
wit_in.resize(
1 << next_pow_2,
<GoldilocksExt2 as ExtensionField>::BaseField::ZERO,
);
DenseMultilinearExtension::from_evaluations_vec(ceil_log2(wit_in.len()), wit_in)
})
.map(|wit_in| wit_in.into_mle())
.collect();
let all_one = vec![
vec![<GoldilocksExt2 as ExtensionField>::BaseField::ONE; 25 * 64],
vec![<GoldilocksExt2 as ExtensionField>::BaseField::ZERO; 17 * 64],
]
.into_iter()
.map(|mut wit_in| {
let next_pow_2 = ceil_log2(wit_in.len());
wit_in.resize(
1 << next_pow_2,
<GoldilocksExt2 as ExtensionField>::BaseField::ZERO,
);
DenseMultilinearExtension::from_evaluations_vec(ceil_log2(wit_in.len()), wit_in)
})
.map(|wit_in| wit_in.into_mle())
.collect();
let mut witness = CircuitWitness::new(&circuit, Vec::new());
witness.add_instance(&circuit, all_zero);
Expand Down
5 changes: 1 addition & 4 deletions gkr/src/circuit/circuit_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,7 @@ impl<E: ExtensionField> Circuit<E> {
|| circuit_builder.n_witness_out() == 1 && output_copy_to[0] != seg
|| !output_assert_const.is_empty()
{
curr_sc_steps.extend([
SumcheckStepType::OutputPhase1Step1,
SumcheckStepType::OutputPhase1Step2,
]);
curr_sc_steps.extend([SumcheckStepType::OutputPhase1Step1]);
}
} else {
let last_layer = &layers[(layer_id - 1) as usize];
Expand Down
Loading

0 comments on commit 18abe90

Please sign in to comment.