diff --git a/extensions/native/circuit/src/poseidon2/air.rs b/extensions/native/circuit/src/poseidon2/air.rs index f84ec4dca9..1a2bb0286c 100644 --- a/extensions/native/circuit/src/poseidon2/air.rs +++ b/extensions/native/circuit/src/poseidon2/air.rs @@ -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}, @@ -85,16 +85,16 @@ impl Air 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); diff --git a/extensions/native/compiler/src/ir/verify_batch.rs b/extensions/native/compiler/src/ir/verify_batch.rs index c8df8c156b..a099351a9e 100644 --- a/extensions/native/compiler/src/ir/verify_batch.rs +++ b/extensions/native/compiler/src/ir/verify_batch.rs @@ -1,6 +1,9 @@ use crate::ir::{Array, Builder, Config, DslIr, Ext, Felt, Usize, Var}; impl Builder { + /// - 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>, @@ -17,6 +20,11 @@ impl Builder { 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>,