Skip to content

Commit

Permalink
chore: Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
storojs72 committed Sep 24, 2024
1 parent 35085fb commit 61fa060
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 33 deletions.
2 changes: 0 additions & 2 deletions core/src/syscall/precompiles/blake2s/air.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ where
);
}

self.constrain_shuffled_indices(builder, &local.shuffled_indices, local.is_real);

for i in 0..4usize {
// 3x

Expand Down
2 changes: 0 additions & 2 deletions core/src/syscall/precompiles/blake2s/columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ pub struct Blake2sRoundCols<T> {
pub a_ptr: T,
pub b_ptr: T,

pub shuffled_indices: [T; 16],

/// Memory layout:
/// a: v0[0] || v0[1] || v0[2] || v0[3] ||
/// v1[0] || v1[1] || v1[2] || v1[3] ||
Expand Down
20 changes: 0 additions & 20 deletions core/src/syscall/precompiles/blake2s/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ mod trace;
pub use columns::*;

use crate::runtime::{MemoryReadRecord, MemoryWriteRecord};
use crate::stark::SphinxAirBuilder;
use p3_air::AirBuilder;
use p3_field::AbstractField;
use serde::Deserialize;
use serde::Serialize;

Expand All @@ -31,23 +28,6 @@ impl Blake2sRoundChip {
pub fn new() -> Self {
Blake2sRoundChip
}
pub fn constrain_shuffled_indices<AB: SphinxAirBuilder>(
&self,
builder: &mut AB,
indices: &[AB::Var],
is_real: AB::Var,
) {
for index in 0..4 {
builder
.when(is_real)
.assert_eq(indices[index], AB::F::from_canonical_usize(0));
}
for index in 4..indices.len() {
builder
.when(is_real)
.assert_eq(indices[index], AB::F::from_canonical_usize(1));
}
}
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
4 changes: 0 additions & 4 deletions core/src/syscall/precompiles/blake2s/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ impl<F: PrimeField32> MachineAir<F> for Blake2sRoundChip {

// 3x (m2, R1, R2)
for i in 0..4usize {
cols.shuffled_indices[i + 4] = F::from_canonical_u32(1);
cols.shuffled_indices[i + 8] = F::from_canonical_u32(1);
cols.shuffled_indices[i + 12] = F::from_canonical_u32(1);

let v0 = v0_outer[i];
let v1 = v1_outer[i];
let v2 = v2_outer[i];
Expand Down
10 changes: 5 additions & 5 deletions core/src/utils/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ where
OpeningProof<SC>: Send + Sync,
ShardMainData<SC>: Serialize + DeserializeOwned,
{
//#[cfg(debug_assertions)]
//{
let record_clone = record.clone();
machine.debug_constraints(pk, record_clone);
//}
#[cfg(debug_assertions)]
{
let record_clone = record.clone();
machine.debug_constraints(pk, record_clone);
}
let stats = record.stats().clone();
let cycles = stats.get("cpu_events").unwrap();

Expand Down

0 comments on commit 61fa060

Please sign in to comment.