pub struct StarkMachine<SC: StarkGenericConfig, A> { /* private fields */ }
Expand description
A STARK for proving RISC-V execution.
Implementations§
source§impl<SC: StarkGenericConfig, A> StarkMachine<SC, A>
impl<SC: StarkGenericConfig, A> StarkMachine<SC, A>
source§impl<SC: StarkGenericConfig, A: MachineAir<Val<SC>>> StarkMachine<SC, A>
impl<SC: StarkGenericConfig, A: MachineAir<Val<SC>>> StarkMachine<SC, A>
sourcepub fn chips(&self) -> &[MachineChip<SC, A>]
pub fn chips(&self) -> &[MachineChip<SC, A>]
Get an array containing a ChipRef
for all the chips of this RISC-V STARK machine.
sourcepub const fn num_pv_elts(&self) -> usize
pub const fn num_pv_elts(&self) -> usize
Returns the number of public values elements.
sourcepub const fn contains_global_bus(&self) -> bool
pub const fn contains_global_bus(&self) -> bool
Returns whether the machine contains a global bus.
sourcepub fn preprocessed_chip_ids(&self) -> Vec<usize>
pub fn preprocessed_chip_ids(&self) -> Vec<usize>
Returns the id of all chips in the machine that have preprocessed columns.
sourcepub fn shard_chips<'a, 'b>(
&'a self,
shard: &'b A::Record,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>where
'a: 'b,
pub fn shard_chips<'a, 'b>(
&'a self,
shard: &'b A::Record,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>where
'a: 'b,
Returns an iterator over the chips in the machine that are included in the given shard.
sourcepub fn shard_chips_ordered<'a, 'b>(
&'a self,
chip_ordering: &'b HashMap<String, usize>,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>where
'a: 'b,
pub fn shard_chips_ordered<'a, 'b>(
&'a self,
chip_ordering: &'b HashMap<String, usize>,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>where
'a: 'b,
Returns an iterator over the chips in the machine that are included in the given shard.
sourcepub fn chips_sorted_indices(&self, proof: &ShardProof<SC>) -> Vec<Option<usize>>
pub fn chips_sorted_indices(&self, proof: &ShardProof<SC>) -> Vec<Option<usize>>
Returns the indices of the chips in the machine that are included in the given shard.
sourcepub fn setup(
&self,
program: &A::Program,
) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>)
pub fn setup( &self, program: &A::Program, ) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>)
The setup preprocessing phase.
Given a program, this function generates the proving and verifying keys. The keys correspond to the program code and other preprocessed colunms such as lookup tables.
sourcepub fn generate_dependencies(
&self,
records: &mut [A::Record],
opts: &<A::Record as MachineRecord>::Config,
chips_filter: Option<&[String]>,
)
pub fn generate_dependencies( &self, records: &mut [A::Record], opts: &<A::Record as MachineRecord>::Config, chips_filter: Option<&[String]>, )
Generates the dependencies of the given records.
sourcepub fn verify(
&self,
vk: &StarkVerifyingKey<SC>,
proof: &MachineProof<SC>,
challenger: &mut SC::Challenger,
) -> Result<(), MachineVerificationError<SC>>
pub fn verify( &self, vk: &StarkVerifyingKey<SC>, proof: &MachineProof<SC>, challenger: &mut SC::Challenger, ) -> Result<(), MachineVerificationError<SC>>
Verify that a proof is complete and valid given a verifying key and a claimed digest.
sourcepub fn debug_constraints(
&self,
pk: &StarkProvingKey<SC>,
records: Vec<A::Record>,
challenger: &mut SC::Challenger,
)
pub fn debug_constraints( &self, pk: &StarkProvingKey<SC>, records: Vec<A::Record>, challenger: &mut SC::Challenger, )
Debugs the constraints of the given records.
Auto Trait Implementations§
impl<SC, A> Freeze for StarkMachine<SC, A>where
SC: Freeze,
impl<SC, A> RefUnwindSafe for StarkMachine<SC, A>
impl<SC, A> Send for StarkMachine<SC, A>where
A: Send,
impl<SC, A> Sync for StarkMachine<SC, A>where
A: Sync,
impl<SC, A> Unpin for StarkMachine<SC, A>
impl<SC, A> UnwindSafe for StarkMachine<SC, A>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more