openvm_sdk/verifier/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use internal::types::InternalVmVerifierPvs;
use openvm_native_circuit::NativeConfig;
use openvm_native_compiler::ir::DIGEST_SIZE;

use crate::{config::AggStarkConfig, verifier::common::types::VmVerifierPvs};

pub mod common;
pub mod internal;
pub mod leaf;
pub mod root;
pub(crate) mod utils;

const SBOX_SIZE: usize = 7;

impl AggStarkConfig {
    pub fn leaf_vm_config(&self) -> NativeConfig {
        NativeConfig::aggregation(
            VmVerifierPvs::<u8>::width(),
            SBOX_SIZE.min(self.leaf_fri_params.max_constraint_degree()),
        )
    }
    pub fn internal_vm_config(&self) -> NativeConfig {
        NativeConfig::aggregation(
            InternalVmVerifierPvs::<u8>::width(),
            SBOX_SIZE.min(self.internal_fri_params.max_constraint_degree()),
        )
    }
    pub fn root_verifier_vm_config(&self) -> NativeConfig {
        NativeConfig::aggregation(
            // app_commit + leaf_verifier_commit + public_values
            DIGEST_SIZE * 2 + self.max_num_user_public_values,
            SBOX_SIZE.min(self.root_fri_params.max_constraint_degree()),
        )
    }
}