Trait CircuitConfig

Source
pub trait CircuitConfig: Config {
    type Bit: Clone + Variable<Self>;

    // Required methods
    fn read_bit(builder: &mut Builder<Self>) -> Self::Bit;
    fn read_felt(builder: &mut Builder<Self>) -> Felt<Self::F>;
    fn read_ext(builder: &mut Builder<Self>) -> Ext<Self::F, Self::EF>;
    fn ext2felt(
        builder: &mut Builder<Self>,
        ext: Ext<<Self as Config>::F, <Self as Config>::EF>,
    ) -> [Felt<<Self as Config>::F>; 4];
    fn exp_reverse_bits(
        builder: &mut Builder<Self>,
        input: Felt<<Self as Config>::F>,
        power_bits: Vec<Self::Bit>,
    ) -> Felt<<Self as Config>::F>;
    fn num2bits(
        builder: &mut Builder<Self>,
        num: Felt<<Self as Config>::F>,
        num_bits: usize,
    ) -> Vec<Self::Bit>;
    fn bits2num(
        builder: &mut Builder<Self>,
        bits: impl IntoIterator<Item = Self::Bit>,
    ) -> Felt<<Self as Config>::F>;
    fn select_chain_ef(
        builder: &mut Builder<Self>,
        should_swap: Self::Bit,
        first: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone,
        second: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone,
    ) -> Vec<Ext<<Self as Config>::F, <Self as Config>::EF>>;
}

Required Associated Types§

Source

type Bit: Clone + Variable<Self>

Required Methods§

Source

fn read_bit(builder: &mut Builder<Self>) -> Self::Bit

Source

fn read_felt(builder: &mut Builder<Self>) -> Felt<Self::F>

Source

fn read_ext(builder: &mut Builder<Self>) -> Ext<Self::F, Self::EF>

Source

fn ext2felt( builder: &mut Builder<Self>, ext: Ext<<Self as Config>::F, <Self as Config>::EF>, ) -> [Felt<<Self as Config>::F>; 4]

Source

fn exp_reverse_bits( builder: &mut Builder<Self>, input: Felt<<Self as Config>::F>, power_bits: Vec<Self::Bit>, ) -> Felt<<Self as Config>::F>

Source

fn num2bits( builder: &mut Builder<Self>, num: Felt<<Self as Config>::F>, num_bits: usize, ) -> Vec<Self::Bit>

Source

fn bits2num( builder: &mut Builder<Self>, bits: impl IntoIterator<Item = Self::Bit>, ) -> Felt<<Self as Config>::F>

Source

fn select_chain_ef( builder: &mut Builder<Self>, should_swap: Self::Bit, first: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone, second: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone, ) -> Vec<Ext<<Self as Config>::F, <Self as Config>::EF>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CircuitConfig for OuterConfig

Source§

type Bit = Var<<OuterConfig as Config>::N>

Source§

fn read_bit(builder: &mut Builder<Self>) -> Self::Bit

Source§

fn read_felt(builder: &mut Builder<Self>) -> Felt<Self::F>

Source§

fn read_ext(builder: &mut Builder<Self>) -> Ext<Self::F, Self::EF>

Source§

fn ext2felt( builder: &mut Builder<Self>, ext: Ext<<Self as Config>::F, <Self as Config>::EF>, ) -> [Felt<<Self as Config>::F>; 4]

Source§

fn exp_reverse_bits( builder: &mut Builder<Self>, input: Felt<<Self as Config>::F>, power_bits: Vec<Var<<Self as Config>::N>>, ) -> Felt<<Self as Config>::F>

Source§

fn num2bits( builder: &mut Builder<Self>, num: Felt<<Self as Config>::F>, num_bits: usize, ) -> Vec<Var<<Self as Config>::N>>

Source§

fn bits2num( builder: &mut Builder<Self>, bits: impl IntoIterator<Item = Var<<Self as Config>::N>>, ) -> Felt<<Self as Config>::F>

Source§

fn select_chain_ef( builder: &mut Builder<Self>, should_swap: Self::Bit, first: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone, second: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone, ) -> Vec<Ext<<Self as Config>::F, <Self as Config>::EF>>

Source§

impl CircuitConfig for InnerConfig

Source§

type Bit = Felt<<AsmConfig<BabyBear, BinomialExtensionField<BabyBear, 4>> as Config>::F>

Source§

fn read_bit(builder: &mut Builder<Self>) -> Self::Bit

Source§

fn read_felt(builder: &mut Builder<Self>) -> Felt<Self::F>

Source§

fn read_ext(builder: &mut Builder<Self>) -> Ext<Self::F, Self::EF>

Source§

fn ext2felt( builder: &mut Builder<Self>, ext: Ext<<Self as Config>::F, <Self as Config>::EF>, ) -> [Felt<<Self as Config>::F>; 4]

Source§

fn exp_reverse_bits( builder: &mut Builder<Self>, input: Felt<<Self as Config>::F>, power_bits: Vec<Felt<<Self as Config>::F>>, ) -> Felt<<Self as Config>::F>

Source§

fn num2bits( builder: &mut Builder<Self>, num: Felt<<Self as Config>::F>, num_bits: usize, ) -> Vec<Felt<<Self as Config>::F>>

Source§

fn bits2num( builder: &mut Builder<Self>, bits: impl IntoIterator<Item = Felt<<Self as Config>::F>>, ) -> Felt<<Self as Config>::F>

Source§

fn select_chain_ef( builder: &mut Builder<Self>, should_swap: Self::Bit, first: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone, second: impl IntoIterator<Item = Ext<<Self as Config>::F, <Self as Config>::EF>> + Clone, ) -> Vec<Ext<<Self as Config>::F, <Self as Config>::EF>>

Implementors§