Struct sp1_core::stark::StarkMachine
source · 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.
pub const fn num_pv_elts(&self) -> usize
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.
pub 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_ordered<'a, 'b>(
&'a self,
chip_ordering: &'b HashMap<String, usize>,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>where
'a: 'b,
pub fn chips_sorted_indices(&self, proof: &ShardProof<SC>) -> Vec<Option<usize>>
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.
pub fn generate_dependencies( &self, records: &mut [A::Record], opts: &<A::Record as MachineRecord>::Config, )
pub const fn config(&self) -> &SC
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.
pub fn debug_constraints( &self, pk: &StarkProvingKey<SC>, records: Vec<A::Record>, challenger: &mut SC::Challenger, )
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
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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>
Converts
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>
Converts
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