Skip to content

Commit

Permalink
chore: add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed Jan 21, 2025
1 parent 522734e commit 9b0b7f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions extensions/native/circuit/src/poseidon2/air.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Borrow, sync::Arc};
use std::{array::from_fn, borrow::Borrow, sync::Arc};

use openvm_circuit::{
arch::{ExecutionBridge, ExecutionState},
Expand Down Expand Up @@ -85,16 +85,16 @@ impl<AB: InteractionBuilder, const SBOX_REGISTERS: usize> Air<AB>
specific,
} = local;

let left_input = std::array::from_fn::<_, CHUNK, _>(|i| local.inner.inputs[i]);
let right_input = std::array::from_fn::<_, CHUNK, _>(|i| local.inner.inputs[i + CHUNK]);
let left_output = std::array::from_fn::<_, CHUNK, _>(|i| {
let left_input = from_fn::<_, CHUNK, _>(|i| local.inner.inputs[i]);
let right_input = from_fn::<_, CHUNK, _>(|i| local.inner.inputs[i + CHUNK]);
let left_output = from_fn::<_, CHUNK, _>(|i| {
local.inner.ending_full_rounds[BABY_BEAR_POSEIDON2_HALF_FULL_ROUNDS - 1].post[i]
});
let right_output = std::array::from_fn::<_, CHUNK, _>(|i| {
let right_output = from_fn::<_, CHUNK, _>(|i| {
local.inner.ending_full_rounds[BABY_BEAR_POSEIDON2_HALF_FULL_ROUNDS - 1].post[i + CHUNK]
});
let next_left_input = std::array::from_fn::<_, CHUNK, _>(|i| next.inner.inputs[i]);
let next_right_input = std::array::from_fn::<_, CHUNK, _>(|i| next.inner.inputs[i + CHUNK]);
let next_left_input = from_fn::<_, CHUNK, _>(|i| next.inner.inputs[i]);
let next_right_input = from_fn::<_, CHUNK, _>(|i| next.inner.inputs[i + CHUNK]);

builder.assert_bool(incorporate_row);
builder.assert_bool(incorporate_sibling);
Expand Down
8 changes: 8 additions & 0 deletions extensions/native/compiler/src/ir/verify_batch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::ir::{Array, Builder, Config, DslIr, Ext, Felt, Usize, Var};

impl<C: Config> Builder<C> {
/// - Requires `dimensions.len() == opened_values.len()`
/// - `proof` is an array of arrays where inner arrays are of length `CHUNK`
/// - `commit.len() = CHUNK`
pub fn verify_batch_felt(
&mut self,
dimensions: &Array<C, Usize<C::F>>,
Expand All @@ -17,6 +20,11 @@ impl<C: Config> Builder<C> {
commit.clone(),
));
}

/// Version of [`verify_batch_felt`] where `opened_values` are extension field elements.
/// - Requires `dimensions.len() == opened_values.len()`
/// - `proof` is an array of arrays where inner arrays are of length `CHUNK`
/// - `commit.len() = CHUNK`
pub fn verify_batch_ext(
&mut self,
dimensions: &Array<C, Usize<C::F>>,
Expand Down

0 comments on commit 9b0b7f4

Please sign in to comment.